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}"
19 # Install directory prefix
20 if [ -z "$PREFIX" ]; then
21 # shellcheck disable=SC2006
22 PREFIX
=`mktempdir tcpdump_build_matrix`
23 echo "PREFIX set to '$PREFIX'"
29 for CMAKE
in $MATRIX_CMAKE; do
31 for CRYPTO
in $MATRIX_CRYPTO; do
33 for SMB
in $MATRIX_SMB; do
35 # shellcheck disable=SC2006
36 COUNT
=`increment $COUNT`
37 echo_magenta
"===== SETUP $COUNT: BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CC=$CC CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB ====="
38 # Run one build with setup environment variables:
39 # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
40 run_after_echo .
/build.sh
42 if [ "$CMAKE" = yes ]; then
43 run_after_echo
rm -rf build
45 run_after_echo
make distclean
47 run_after_echo
rm -rf "$PREFIX"/bin
/tcpdump
*
48 run_after_echo git status
-suall
49 # Cancel changes in configure
50 run_after_echo git checkout configure
56 touch .devel configure
57 for CC
in $MATRIX_CC; do
59 # Exclude gcc on macOS (it is just an alias for clang).
60 # shellcheck disable=SC2006
61 if [ "$CC" = gcc
] && [ "`uname -s`" = Darwin
]; then
65 for BUILD_LIBPCAP
in $MATRIX_BUILD_LIBPCAP; do
67 if [ "$BUILD_LIBPCAP" = yes ]; then
68 for REMOTE
in $MATRIX_REMOTE; do
70 # Build libpcap with Autoconf.
71 echo_magenta
"Build libpcap (CMAKE=no REMOTE=$REMOTE)"
72 (cd ..
/libpcap
&& CMAKE
=no .
/build.sh
)
73 # Set PKG_CONFIG_PATH for configure when building libpcap
74 if [ "$CMAKE" != no
]; then
75 PKG_CONFIG_PATH
="$PREFIX/lib/pkgconfig"
76 export PKG_CONFIG_PATH
81 echo_magenta
'Use system libpcap'
82 purge_directory
"$PREFIX"
83 (cd ..
/libpcap
; make distclean ||
echo '(Ignoring the make error.)')
89 run_after_echo
rm -rf "$PREFIX"
90 echo_magenta
"Tested setup count: $COUNT"
91 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :