]> The Tcpdump Group git mirrors - tcpdump/blobdiff - build.sh
bgp: Parse BGP extended message support capability
[tcpdump] / build.sh
index 40ffbace2558e94d0a0b2fdf2a3a9c44dc974a06..0d06cf748e9aafe4aeb1bb7027d45b5b500c54f6 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -10,6 +10,7 @@
 : "${CRYPTO:=no}"
 : "${SMB:=no}"
 : "${TCPDUMP_TAINTED:=no}"
+: "${MAKE_BIN:=make}"
 
 . ./build_common.sh
 # Install directory prefix
@@ -18,8 +19,8 @@ if [ -z "$PREFIX" ]; then
     PREFIX=`mktempdir tcpdump_build`
     echo "PREFIX set to '$PREFIX'"
 fi
-# For TESTrun
 TCPDUMP_BIN="$PREFIX/bin/tcpdump"
+# For TESTrun
 export TCPDUMP_BIN
 
 print_cc_version
@@ -28,27 +29,19 @@ print_cc_version
 # are not warning-free for one or another reason.  If you manage to fix one of
 # these cases, please remember to remove respective exemption below to help any
 # later warnings in the same matrix subset trigger an error.
+
 # shellcheck disable=SC2006
-case `os_id`/"$CMAKE" in
-FreeBSD-*/yes)
-    # tcpdump.c:2290:3: error: implicit declaration of function 'bpf_dump'
-    #   [-Werror=implicit-function-declaration]
-    [ "$BUILD_LIBPCAP" = yes ] && TCPDUMP_TAINTED=yes
-    case `cc_id` in
-    clang-*)
-        # tcpdump.c:2434:32: error: '_Generic' is a C11 extension
-        #   [-Werror,-Wc11-extensions]
-        # tcpdump.c:2439:26: error: '_Generic' is a C11 extension
-        #   [-Werror,-Wc11-extensions]
-        # tcpdump.c:2443:9: error: '_Generic' is a C11 extension
-        #   [-Werror,-Wc11-extensions]
-        # tcpdump.c:244:16: error: no previous extern declaration for non-static variable
-        #   'capdns' [-Werror,-Wmissing-variable-declarations]
-        TCPDUMP_TAINTED=yes
-        ;;
-    esac
+case `cc_id`/`os_id` in
+clang-9.*/SunOS-5.11)
+    # (OpenIndiana)
+    # tcpdump.c:2312:51: warning: this function declaration is not a prototype
+    #   [-Wstrict-prototypes]
+    # tcpdump.c:2737:11: warning: this function declaration is not a prototype
+    #   [-Wstrict-prototypes]
+    [ "`uname -o`" = illumos ] && TCPDUMP_TAINTED=yes
     ;;
 esac
+
 # shellcheck disable=SC2006
 [ "$TCPDUMP_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
 
@@ -79,18 +72,25 @@ else
             -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
     fi
 fi
-run_after_echo make -s clean
+run_after_echo "$MAKE_BIN" -s clean
 if [ "$CMAKE" = no ]; then
-    run_after_echo make -s ${CFLAGS:+CFLAGS="$CFLAGS"}
+    run_after_echo "$MAKE_BIN" -s ${CFLAGS:+CFLAGS="$CFLAGS"}
 else
     # The "-s" flag is a no-op and CFLAGS is set using -DEXTRA_CFLAGS above.
-    run_after_echo make
+    run_after_echo "$MAKE_BIN"
 fi
-run_after_echo make install
+run_after_echo "$MAKE_BIN" install
 print_so_deps "$TCPDUMP_BIN"
 run_after_echo "$TCPDUMP_BIN" -h
+# The "-D" flag depends on HAVE_PCAP_FINDALLDEVS and it would not be difficult
+# to run the command below only if the macro is defined.  That said, it seems
+# more useful to run it anyway: every system that currently runs this script
+# has pcap_findalldevs(), thus if the macro isn't defined, it means something
+# went wrong in the build process (as was observed with GCC, CMake and the
+# system libpcap on Solaris 11).
 run_after_echo "$TCPDUMP_BIN" -D
 if [ "$CIRRUS_CI" = true ]; then
+    # Likewise for the "-J" flag and HAVE_PCAP_SET_TSTAMP_TYPE.
     run_after_echo sudo \
         ${LD_LIBRARY_PATH:+LD_LIBRARY_PATH="$LD_LIBRARY_PATH"} \
         "$TCPDUMP_BIN" -J
@@ -99,10 +99,10 @@ if [ "$CIRRUS_CI" = true ]; then
         "$TCPDUMP_BIN" -L
 fi
 if [ "$BUILD_LIBPCAP" = yes ]; then
-    run_after_echo make check
+    run_after_echo "$MAKE_BIN" check
 fi
 if [ "$CMAKE" = no ]; then
-    run_after_echo make releasetar
+    run_after_echo "$MAKE_BIN" releasetar
 fi
 if [ "$CIRRUS_CI" = true ]; then
     run_after_echo sudo \