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:=yes no}"
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 cmake
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 cmake warning-free because of the version or whatever other factor
20 # that the scripts can detect both in and out of CI.
21 : "${TCPDUMP_CMAKE_TAINTED:=no}"
22 # Set this variable to "yes" before calling this script to disregard all
23 # warnings in a particular environment (CI or a local working copy). Set it
24 # to "yes" in this script or in build.sh when a matrix subset is known to be
25 # not warning-free because of the OS, the compiler or whatever other factor
26 # that the scripts can detect both in and out of CI.
27 : "${TCPDUMP_TAINTED:=no}"
28 # Some OSes have native make without parallel jobs support and sometimes have
29 # GNU Make available as "gmake".
34 # Install directory prefix
35 if [ -z "$PREFIX" ]; then
36 PREFIX
=`mktempdir tcpdump_build_matrix`
37 echo "PREFIX set to '$PREFIX'"
41 export TCPDUMP_TAINTED
42 export TCPDUMP_CMAKE_TAINTED
46 for CMAKE
in $MATRIX_CMAKE; do
48 for CRYPTO
in $MATRIX_CRYPTO; do
50 for SMB
in $MATRIX_SMB; do
52 COUNT
=`increment "$COUNT"`
53 echo_magenta
"===== SETUP $COUNT: CC=$CC BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB =====" >&2
54 # Run one build with setup environment variables:
55 # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
56 run_after_echo .
/build.sh
58 if [ "$CMAKE" = yes ]; then
59 run_after_echo
rm -rf build
61 run_after_echo
"$MAKE_BIN" distclean
63 run_after_echo
rm -rf "$PREFIX"/bin
/tcpdump
*
64 run_after_echo git status
-suall
70 run_after_echo git show
--oneline -s |
cat
72 for CC
in $MATRIX_CC; do
75 if gcc_is_clang_in_disguise
; then
79 for BUILD_LIBPCAP
in $MATRIX_BUILD_LIBPCAP; do
81 if [ "$BUILD_LIBPCAP" = yes ]; then
82 for REMOTE
in $MATRIX_REMOTE; do
84 # Build libpcap with Autoconf.
85 echo_magenta
"Build libpcap (CMAKE=no REMOTE=$REMOTE)" >&2
86 (cd ..
/libpcap
&& CMAKE
=no .
/build.sh
)
87 # Set PKG_CONFIG_PATH for configure when building libpcap
88 if [ "$CMAKE" != no
]; then
89 PKG_CONFIG_PATH
="$PREFIX/lib/pkgconfig"
90 export PKG_CONFIG_PATH
95 echo_magenta
'Use system libpcap' >&2
96 purge_directory
"$PREFIX"
97 if [ -d ..
/libpcap
]; then
98 (cd ..
/libpcap
; "$MAKE_BIN" distclean ||
echo '(Ignoring the make error.)')
105 run_after_echo
rm -rf "$PREFIX"
106 echo_magenta
"Tested setup count: $COUNT" >&2
107 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :