2021-05-15 06:46:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
curl -fsSL https://github.com/vtest/VTest/archive/master.tar.gz -o VTest.tar.gz
|
|
|
|
mkdir ../vtest
|
|
|
|
tar xvf VTest.tar.gz -C ../vtest --strip-components=1
|
|
|
|
# Special flags due to: https://github.com/vtest/VTest/issues/12
|
|
|
|
|
2024-05-27 09:50:31 +00:00
|
|
|
# Note: do not use "make -C ../vtest", otherwise MAKEFLAGS contains "w"
|
|
|
|
# and fails (see Options/Recursion in GNU Make doc, it contains the list
|
|
|
|
# of options without the leading '-').
|
|
|
|
# MFLAGS works on BSD but misses variable definitions on GNU Make.
|
|
|
|
# Better just avoid the -C and do the cd ourselves then.
|
|
|
|
|
|
|
|
cd ../vtest
|
|
|
|
|
2024-05-27 09:59:46 +00:00
|
|
|
set +e
|
|
|
|
CPUS=${CPUS:-$(nproc 2>/dev/null)}
|
|
|
|
CPUS=${CPUS:-1}
|
|
|
|
set -e
|
|
|
|
|
2024-04-19 05:16:45 +00:00
|
|
|
#
|
|
|
|
# temporarily detect Apple Silicon (it's using /opt/homebrew instead of /usr/local)
|
|
|
|
#
|
|
|
|
if test -f /opt/homebrew/include/pcre2.h; then
|
2024-05-27 09:59:46 +00:00
|
|
|
make -j${CPUS} FLAGS="-O2 -s -Wall" INCS="-Isrc -Ilib -I/usr/local/include -I/opt/homebrew/include -pthread"
|
2024-04-19 05:16:45 +00:00
|
|
|
else
|
2024-05-27 09:59:46 +00:00
|
|
|
make -j${CPUS} FLAGS="-O2 -s -Wall"
|
2024-04-19 05:16:45 +00:00
|
|
|
fi
|