3 # This script executes the matrix loops, exclude tests and cleaning.
4 # It calls the build.sh script which runs one build with setup environment
5 # variables: BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB.
6 # The matrix can be configured with environment variables
7 # MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO
10 : "${MATRIX_BUILD_LIBPCAP:=no yes}"
11 : "${MATRIX_REMOTE:=no}"
12 : "${MATRIX_CC:=gcc clang}"
13 : "${MATRIX_CMAKE:=no yes}"
14 : "${MATRIX_CRYPTO:=no yes}"
15 : "${MATRIX_SMB:=no yes}"
16 # Set this variable to "yes" before calling this script to disregard all
17 # warnings in a particular environment (CI or a local working copy). Set it
18 # to "yes" in this script or in build.sh when a matrix subset is known to be
19 # not warning-free because of the OS, the compiler or whatever other factor
20 # that the scripts can detect both in and out of CI.
21 : "${TCPDUMP_TAINTED:=no}"
22 # Some OSes have native make without parallel jobs support and sometimes have
23 # GNU Make available as "gmake".
28 # Install directory prefix
29 if [ -z "$PREFIX" ]; then
30 # shellcheck disable=SC2006
31 PREFIX
=`mktempdir tcpdump_build_matrix`
32 echo "PREFIX set to '$PREFIX'"
36 export TCPDUMP_TAINTED
40 for CMAKE
in $MATRIX_CMAKE; do
42 for CRYPTO
in $MATRIX_CRYPTO; do
44 for SMB
in $MATRIX_SMB; do
46 # shellcheck disable=SC2006
47 COUNT
=`increment $COUNT`
48 echo_magenta
"===== SETUP $COUNT: BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CC=$CC CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB =====" >&2
49 # Run one build with setup environment variables:
50 # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
51 run_after_echo .
/build.sh
53 if [ "$CMAKE" = yes ]; then
54 run_after_echo
rm -rf build
56 run_after_echo
"$MAKE_BIN" distclean
58 run_after_echo
rm -rf "$PREFIX"/bin
/tcpdump
*
59 run_after_echo git status
-suall
60 # Cancel changes in configure
61 run_after_echo git checkout configure
67 touch .devel configure
68 for CC
in $MATRIX_CC; do
71 if gcc_is_clang_in_disguise
; then
75 for BUILD_LIBPCAP
in $MATRIX_BUILD_LIBPCAP; do
77 if [ "$BUILD_LIBPCAP" = yes ]; then
78 for REMOTE
in $MATRIX_REMOTE; do
80 # Build libpcap with Autoconf.
81 echo_magenta
"Build libpcap (CMAKE=no REMOTE=$REMOTE)" >&2
82 (cd ..
/libpcap
&& CMAKE
=no .
/build.sh
)
83 # Set PKG_CONFIG_PATH for configure when building libpcap
84 if [ "$CMAKE" != no
]; then
85 PKG_CONFIG_PATH
="$PREFIX/lib/pkgconfig"
86 export PKG_CONFIG_PATH
91 echo_magenta
'Use system libpcap' >&2
92 purge_directory
"$PREFIX"
93 if [ -d ..
/libpcap
]; then
94 (cd ..
/libpcap
; "$MAKE_BIN" distclean ||
echo '(Ignoring the make error.)')
101 run_after_echo
rm -rf "$PREFIX"
102 echo_magenta
"Tested setup count: $COUNT" >&2
103 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :