]> The Tcpdump Group git mirrors - tcpdump/blobdiff - build_matrix.sh
On Solaris, for 64-bit builds, use the 64-bit pcap-config.
[tcpdump] / build_matrix.sh
index 42bbaa99a71bd2f7147476c76a02d11fca67451d..c5f699a0c177864b159cff4351177334fd3747a8 100755 (executable)
 : "${MATRIX_CMAKE:=no yes}"
 : "${MATRIX_CRYPTO:=no yes}"
 : "${MATRIX_SMB:=no yes}"
+# 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}"
 
 . ./build_common.sh
 print_sysinfo
@@ -24,68 +30,68 @@ if [ -z "$PREFIX" ]; then
     export PREFIX
 fi
 COUNT=0
+export TCPDUMP_TAINTED
 
 build_tcpdump() {
-    for CC in $MATRIX_CC; do
-        export CC
-        # Exclude gcc on macOS (it is just an alias for clang).
-        # shellcheck disable=SC2006
-        if [ "$CC" = gcc ] && [ "`uname -s`" = Darwin ]; then
-            echo '(skipped)'
-            continue
-        fi
-        for CMAKE in $MATRIX_CMAKE; do
-            export CMAKE
-            for CRYPTO in $MATRIX_CRYPTO; do
-                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 ====="
-                    # Run one build with setup environment variables:
-                    # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
-                    run_after_echo ./build.sh
-                    echo 'Cleaning...'
-                    if [ "$CMAKE" = yes ]; then
-                        run_after_echo rm -rf build
-                    else
-                        run_after_echo make 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
+    for CMAKE in $MATRIX_CMAKE; do
+        export CMAKE
+        for CRYPTO in $MATRIX_CRYPTO; do
+            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:
+                # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
+                run_after_echo ./build.sh
+                echo 'Cleaning...'
+                if [ "$CMAKE" = yes ]; then
+                    run_after_echo rm -rf build
+                else
+                    run_after_echo make 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
-for BUILD_LIBPCAP in $MATRIX_BUILD_LIBPCAP; do
-    export BUILD_LIBPCAP
-    if [ "$BUILD_LIBPCAP" = yes ]; then
-        for REMOTE in $MATRIX_REMOTE; do
-            export REMOTE
-            # Build libpcap with Autoconf.
-            echo_magenta "Build libpcap (CMAKE=no REMOTE=$REMOTE)"
-            (cd ../libpcap && CMAKE=no ./build.sh)
-            # Set PKG_CONFIG_PATH for configure when building libpcap
-            if [ "$CMAKE" != no ]; then
-                PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
-                export PKG_CONFIG_PATH
-            fi
-            build_tcpdump
-        done
-    else
-        echo_magenta 'Use system libpcap'
-        purge_directory "$PREFIX"
-        (cd ../libpcap; make distclean || echo '(Ignoring the make error.)')
-        build_tcpdump
+for CC in $MATRIX_CC; do
+    export CC
+    discard_cc_cache
+    if gcc_is_clang_in_disguise; then
+        echo '(skipped)'
+        continue
     fi
+    for BUILD_LIBPCAP in $MATRIX_BUILD_LIBPCAP; do
+        export BUILD_LIBPCAP
+        if [ "$BUILD_LIBPCAP" = yes ]; then
+            for REMOTE in $MATRIX_REMOTE; do
+                export REMOTE
+                # Build libpcap with Autoconf.
+                echo_magenta "Build libpcap (CMAKE=no REMOTE=$REMOTE)" >&2
+                (cd ../libpcap && CMAKE=no ./build.sh)
+                # Set PKG_CONFIG_PATH for configure when building libpcap
+                if [ "$CMAKE" != no ]; then
+                    PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
+                    export PKG_CONFIG_PATH
+                fi
+                build_tcpdump
+            done
+        else
+            echo_magenta 'Use system libpcap' >&2
+            purge_directory "$PREFIX"
+            (cd ../libpcap; make distclean || echo '(Ignoring the make error.)')
+            build_tcpdump
+        fi
+    done
 done
 
 run_after_echo rm -rf "$PREFIX"
-echo_magenta "Tested setup count: $COUNT"
+echo_magenta "Tested setup count: $COUNT" >&2
 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :