3 # This script runs one build with setup environment variables: BUILD_LIBPCAP,
4 # CC, CMAKE, CRYPTO and SMB
5 # (default: BUILD_LIBPCAP=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
9 # BUILD_LIBPCAP: no or yes
10 BUILD_LIBPCAP
=${BUILD_LIBPCAP:-no}
19 # Install directory prefix
22 export TCPDUMP_BIN
=/tmp
/local
/bin
/tcpdump
27 if [ "$TRAVIS" != true
]; then return; fi
28 echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
32 # Run a command after displaying it
39 # LABEL is needed to build the travis fold labels
40 LABEL
="$BUILD_LIBPCAP.$CC.$CMAKE.$CRYPTO.$SMB"
41 if [ "$CMAKE" = no
]; then
42 echo '$ ./configure [...]'
43 travis_fold start configure
44 if [ "$BUILD_LIBPCAP" = yes ]; then
45 echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
46 .
/configure
--with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix=$PREFIX
47 export LD_LIBRARY_PATH
=$PREFIX/lib
49 .
/configure
--disable-local-libpcap --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix=$PREFIX
51 travis_fold end configure
57 travis_fold start cmake
58 if [ "$BUILD_LIBPCAP" = yes ]; then
59 cmake
-DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX ..
60 export LD_LIBRARY_PATH
=$PREFIX/lib
62 cmake
-DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_INSTALL_PREFIX=$PREFIX ..
66 run_after_echo
"make -s clean"
67 run_after_echo
"make -s CFLAGS=-Werror"
69 travis_fold start make_install
71 travis_fold end make_install
72 run_after_echo
"$TCPDUMP_BIN --version"
73 run_after_echo
"$TCPDUMP_BIN -h"
74 run_after_echo
"$TCPDUMP_BIN -D"
76 if [ "$system" = Linux
]; then
77 run_after_echo
"ldd $TCPDUMP_BIN"
79 if [ "$TRAVIS" = true
]; then
80 if [ -n "$LD_LIBRARY_PATH" ]; then
81 run_after_echo
"sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -J"
82 run_after_echo
"sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -L"
84 run_after_echo
"sudo $TCPDUMP_BIN -J"
85 run_after_echo
"sudo $TCPDUMP_BIN -L"
88 if [ "$BUILD_LIBPCAP" = yes ]; then
89 run_after_echo
"make check"
91 if [ "$CMAKE" = no
]; then
93 if [ "$system" = Darwin
] ||
[ "$system" = Linux
]; then
94 run_after_echo
"make releasetar"
97 if [ "$TRAVIS" = true
]; then
98 if [ "$TRAVIS_OS_NAME" = linux
] && [ "$TRAVIS_CPU_ARCH" != ppc64le
] && [ "$TRAVIS_CPU_ARCH" != s390x
] && [ "$TRAVIS_CPU_ARCH" != arm64
]; then
99 if [ -n "$LD_LIBRARY_PATH" ]; then
100 run_after_echo
"sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -#n -c 10"
102 run_after_echo
"sudo $TCPDUMP_BIN -#n -c 10"
106 # The DEBUG_BUILD variable is not set by default to avoid Travis error message:
107 # "The job exceeded the maximum log length, and has been terminated."
108 # Setting it needs to reduce the matrix cases.
109 if [ "$TRAVIS" = true
] && [ -n "$DEBUG_BUILD" ] ; then
110 echo '$ cat Makefile [...]'
111 travis_fold start cat_makefile
112 if [ "$CMAKE" = no
]; then
113 sed -n '1,/DO NOT DELETE THIS LINE -- mkdep uses it/p' < Makefile
117 travis_fold end cat_makefile
118 echo '$ cat config.h'
119 travis_fold start cat_config_h
121 travis_fold end cat_config_h
122 if [ "$CMAKE" = no
]; then
123 echo '$ cat config.log'
124 travis_fold start cat_config_log
126 travis_fold end cat_config_log
129 # vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :