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 # (default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
7 # The matrix can be configured with environment variables
8 # MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO
10 # (default: MATRIX_BUILD_LIBPCAP='no yes', MATRIX_REMOTE='no yes',
11 # MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
12 # MATRIX_SMB='no yes').
16 # ANSI color escape sequences
17 ANSI_MAGENTA
="\\033[35;1m"
21 # Install directory prefix
22 if [ -z "$PREFIX" ]; then
23 PREFIX
=$
(mktemp
-d -t tcpdump_build_matrix_XXXXXXXX
)
24 echo "PREFIX set to '$PREFIX'"
32 if [ "$TRAVIS" != true
]; then return; fi
33 echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
37 # Display text in magenta
39 echo -ne "$ANSI_MAGENTA"
41 echo -ne "$ANSI_RESET"
45 for CC
in ${MATRIX_CC:-gcc clang}; do
47 # Exclude gcc on macOS (it is just an alias for clang).
48 if [ "$CC" = gcc
] && [ "$(uname -s)" = Darwin
]; then
52 for CMAKE
in ${MATRIX_CMAKE:-no yes}; do
54 for CRYPTO
in ${MATRIX_CRYPTO:-no yes}; do
56 for SMB
in ${MATRIX_SMB:-no yes}; do
59 echo_magenta
"===== SETUP $COUNT: BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CC=$CC CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB ====="
60 # LABEL is needed to build the travis fold labels
61 LABEL
="$BUILD_LIBPCAP.$REMOTE.$CC.$CMAKE.$CRYPTO.$SMB"
62 # Run one build with setup environment variables:
63 # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
66 travis_fold start cleaning
67 if [ "$CMAKE" = yes ]; then rm -rf build
; else make distclean
; fi
68 rm -rf "$PREFIX"/bin
/tcpdump
*
70 # Cancel changes in configure
71 git checkout configure
72 travis_fold end cleaning
80 if [ "$BUILD_LIBPCAP" = no
]; then
81 echo_magenta
'Use system libpcap'
83 make -C ..
/libpcap distclean ||
:
85 # Build libpcap with autoconf
88 echo_magenta
"Build libpcap (CMAKE=$CMAKE REMOTE=$REMOTE)"
89 (cd ..
/libpcap
&& .
/build.sh
)
94 touch .devel configure
95 for BUILD_LIBPCAP
in ${MATRIX_BUILD_LIBPCAP:-no yes}; do
97 if [ "$BUILD_LIBPCAP" = yes ]; then
98 for REMOTE
in ${MATRIX_REMOTE:-no}; do
101 # Set PKG_CONFIG_PATH for configure when building libpcap
102 if [ "$CMAKE" != no
]; then
103 export PKG_CONFIG_PATH
="$PREFIX/lib/pkgconfig"
114 echo_magenta
"Tested setup count: $COUNT"
115 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :