3 # This script executes the matrix loop, exclude tests and cleaning.
4 # The matrix can be configured with the following environment variables:
5 : "${MATRIX_CC:=gcc clang}"
6 : "${MATRIX_BUILD_LIBPCAP:=yes no}"
7 # Set this variable to "yes" before calling this script to disregard all
8 # warnings in a particular environment (CI or a local working copy). Set it to
9 # "yes" in this script or in build.sh when a matrix subset is known to be not
10 # warning-free because of the OS, the compiler or whatever other factor that
11 # the scripts can detect both in and out of CI.
12 : "${TCPSLICE_TAINTED:=no}"
13 # Some OSes have native make without parallel jobs support and sometimes have
14 # GNU Make available as "gmake".
16 # It calls the build.sh script which runs one build with the setup environment
21 # Install directory prefix
22 if [ -z "$PREFIX" ]; then
23 PREFIX
=`mktempdir tcpslice_build_matrix`
24 echo "PREFIX set to '$PREFIX'"
28 export TCPSLICE_TAINTED
31 run_after_echo git show
--oneline -s
33 for CC
in $MATRIX_CC; do
36 if gcc_is_clang_in_disguise
; then
40 for BUILD_LIBPCAP
in $MATRIX_BUILD_LIBPCAP; do
41 COUNT
=`increment "$COUNT"`
42 echo_magenta
"===== SETUP $COUNT: CC=$CC BUILD_LIBPCAP=$BUILD_LIBPCAP =====" >&2
43 if [ "$BUILD_LIBPCAP" = yes ]; then
44 echo_magenta
"Build libpcap (CMAKE=no)" >&2
45 (cd ..
/libpcap
&& CMAKE
=no .
/build.sh
)
47 echo_magenta
'Use system libpcap' >&2
48 purge_directory
"$PREFIX"
49 if [ -d ..
/libpcap
]; then
50 (cd ..
/libpcap
; "$MAKE_BIN" distclean ||
echo '(Ignoring the make error.)')
53 # Run one build with the setup environment variable: CC
54 run_after_echo .
/build.sh
57 purge_directory
"$PREFIX"
58 run_after_echo git status
-suall
61 run_after_echo
rm -rf "$PREFIX"
62 echo_magenta
"Tested setup count: $COUNT" >&2
63 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :