]> The Tcpdump Group git mirrors - libpcap/blob - build_matrix.sh
CI: Call print_so_deps() on rpcapd in remote enabled build
[libpcap] / build_matrix.sh
1 #!/bin/sh -e
2
3 # This script executes the matrix loops, exclude tests and cleaning.
4 # The matrix can be configured with the following environment variables:
5 : "${MATRIX_CC:=gcc clang}"
6 : "${MATRIX_CMAKE:=no yes}"
7 : "${MATRIX_REMOTE:=no yes}"
8 : "${MATRIX_PROTOCHAIN:=yes no}"
9 # Set this variable to "yes" before calling this script to disregard all cmake
10 # warnings in a particular environment (CI or a local working copy). Set it
11 # to "yes" in this script or in build.sh when a matrix subset is known to be
12 # not cmake warning-free because of the version or whatever other factor
13 # that the scripts can detect both in and out of CI.
14 : "${LIBPCAP_CMAKE_TAINTED:=no}"
15 # Set this variable to "yes" before calling this script to disregard all
16 # warnings in a particular environment (CI or a local working copy). Set it
17 # to "yes" in this script or in build.sh when a matrix subset is known to be
18 # not warning-free because of the OS, the compiler or whatever other factor
19 # that the scripts can detect both in and out of CI.
20 : "${LIBPCAP_TAINTED:=no}"
21 # Some OSes have native make without parallel jobs support and sometimes have
22 # GNU Make available as "gmake".
23 : "${MAKE_BIN:=make}"
24 # Custom path to Valgrind (default: use "valgrind" if available). Set to
25 # "false" to avoid using Valgrind on a slow host.
26 : "${VALGRIND_BIN:=valgrind}"
27 # It calls the build.sh script which runs one build with setup environment
28 # variables as set below.
29
30 . ./build_common.sh
31 print_sysinfo
32 # Install directory prefix
33 if [ -z "$PREFIX" ]; then
34 PREFIX=`mktempdir libpcap_build_matrix`
35 echo "PREFIX set to '$PREFIX'"
36 export PREFIX
37 fi
38 COUNT=0
39 export LIBPCAP_TAINTED
40 export LIBPCAP_CMAKE_TAINTED
41 if "$VALGRIND_BIN" --version >/dev/null 2>&1; then
42 VALGRIND_CMD="$VALGRIND_BIN --leak-check=full --error-exitcode=1 --quiet"
43 export VALGRIND_CMD
44 # With Valgrind filtertest takes significantly longer to complete.
45 : "${FILTERTEST_TIMEOUT:=5}"
46 export FILTERTEST_TIMEOUT
47 fi
48
49 run_after_echo git show --oneline -s | cat
50 touch .devel
51 for CC in $MATRIX_CC; do
52 export CC
53 discard_cc_cache
54 if gcc_is_clang_in_disguise; then
55 echo '(skipped)'
56 continue
57 fi
58 for CMAKE in $MATRIX_CMAKE; do
59 export CMAKE
60 for PROTOCHAIN in $MATRIX_PROTOCHAIN; do
61 export PROTOCHAIN
62 for REMOTE in $MATRIX_REMOTE; do
63 export REMOTE
64 COUNT=`increment "$COUNT"`
65 echo_magenta "===== SETUP $COUNT: CC=$CC CMAKE=$CMAKE REMOTE=$REMOTE PROTOCHAIN=$PROTOCHAIN =====" >&2
66 # Run one build as specified.
67 run_after_echo ./build.sh
68 echo 'Cleaning...'
69 if [ "$CMAKE" = yes ]; then rm -rf build; else "$MAKE_BIN" distclean; fi
70 purge_directory "$PREFIX"
71 run_after_echo git status -suall
72 done
73 done
74 done
75 done
76 run_after_echo rm -rf "$PREFIX"
77 echo_magenta "Tested setup count: $COUNT" >&2
78 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :