X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9b40c0b7675a2f361dc8cfdb01abeba1cb32092c..dd7d97a439da4d31ba8c9295b308fe7f183ab35e:/build_matrix.sh diff --git a/build_matrix.sh b/build_matrix.sh index c5f699a0..4df235d2 100755 --- a/build_matrix.sh +++ b/build_matrix.sh @@ -19,18 +19,21 @@ # not warning-free because of the OS, the compiler or whatever other factor # that the scripts can detect both in and out of CI. : "${TCPDUMP_TAINTED:=no}" +# Some OSes have native make without parallel jobs support and sometimes have +# GNU Make available as "gmake". +: "${MAKE_BIN:=make}" . ./build_common.sh print_sysinfo # Install directory prefix if [ -z "$PREFIX" ]; then - # shellcheck disable=SC2006 PREFIX=`mktempdir tcpdump_build_matrix` echo "PREFIX set to '$PREFIX'" export PREFIX fi COUNT=0 export TCPDUMP_TAINTED +export MAKE_BIN build_tcpdump() { for CMAKE in $MATRIX_CMAKE; do @@ -39,7 +42,6 @@ build_tcpdump() { export CRYPTO for SMB in $MATRIX_SMB; do export SMB - # shellcheck disable=SC2006 COUNT=`increment $COUNT` echo_magenta "===== SETUP $COUNT: BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CC=$CC CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB =====" >&2 # Run one build with setup environment variables: @@ -49,7 +51,7 @@ build_tcpdump() { if [ "$CMAKE" = yes ]; then run_after_echo rm -rf build else - run_after_echo make distclean + run_after_echo "$MAKE_BIN" distclean fi run_after_echo rm -rf "$PREFIX"/bin/tcpdump* run_after_echo git status -suall @@ -86,7 +88,9 @@ for CC in $MATRIX_CC; do else echo_magenta 'Use system libpcap' >&2 purge_directory "$PREFIX" - (cd ../libpcap; make distclean || echo '(Ignoring the make error.)') + if [ -d ../libpcap ]; then + (cd ../libpcap; "$MAKE_BIN" distclean || echo '(Ignoring the make error.)') + fi build_tcpdump fi done