]> The Tcpdump Group git mirrors - tcpdump/blobdiff - build_matrix.sh
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / build_matrix.sh
index c5f699a0c177864b159cff4351177334fd3747a8..93daca63b5cb3d27117e149e42745e68cb6836ca 100755 (executable)
@@ -7,30 +7,40 @@
 # MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO
 # and MATRIX_SMB.
 
-: "${MATRIX_BUILD_LIBPCAP:=no yes}"
+: "${MATRIX_BUILD_LIBPCAP:=yes no}"
 : "${MATRIX_REMOTE:=no}"
 : "${MATRIX_CC:=gcc clang}"
 : "${MATRIX_CMAKE:=no yes}"
 : "${MATRIX_CRYPTO:=no yes}"
 : "${MATRIX_SMB:=no yes}"
+# Set this variable to "yes" before calling this script to disregard all cmake
+# warnings in a particular environment (CI or a local working copy).  Set it
+# to "yes" in this script or in build.sh when a matrix subset is known to be
+# not cmake warning-free because of the version or whatever other factor
+# that the scripts can detect both in and out of CI.
+: "${TCPDUMP_CMAKE_TAINTED:=no}"
 # Set this variable to "yes" before calling this script to disregard all
 # warnings in a particular environment (CI or a local working copy).  Set it
 # to "yes" in this script or in build.sh when a matrix subset is known to be
 # 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 TCPDUMP_CMAKE_TAINTED
+export MAKE_BIN
 
 build_tcpdump() {
     for CMAKE in $MATRIX_CMAKE; do
@@ -39,9 +49,8 @@ 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
+                COUNT=`increment "$COUNT"`
+                echo_magenta "===== SETUP $COUNT: CC=$CC BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB =====" >&2
                 # Run one build with setup environment variables:
                 # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
                 run_after_echo ./build.sh
@@ -49,18 +58,17 @@ 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
-                # Cancel changes in configure
-                run_after_echo git checkout configure
             done
         done
     done
 }
 
-touch .devel configure
+run_after_echo git show --oneline -s | cat
+touch .devel
 for CC in $MATRIX_CC; do
     export CC
     discard_cc_cache
@@ -86,7 +94,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