MAKEFLAGS: -j 4
MATRIX_CC: clang gcc10
script:
MAKEFLAGS: -j 4
MATRIX_CC: clang gcc10
script:
- pkg install -qy git autoconf gcc10
- pkg install -qy bash cmake # for build_matrix.sh and build.sh
- pkg install -qy pkgconf # for cmake, replaces pkg-config
- pkg install -qy git autoconf gcc10
- pkg install -qy bash cmake # for build_matrix.sh and build.sh
- pkg install -qy pkgconf # for cmake, replaces pkg-config
# "cpu" and "memory" are invalid keywords for macOS tasks now
env:
MAKEFLAGS: '-j 12'
# "cpu" and "memory" are invalid keywords for macOS tasks now
env:
MAKEFLAGS: '-j 12'
- MATRIX_CC: clang # GCC is a symlink to Clang in macOS
script:
- brew update >/dev/null
- brew install libsmi | grep -v '%'
script:
- brew update >/dev/null
- brew install libsmi | grep -v '%'
- gem install travis-conditions
- apt list --installed 'lib*-dev'
- (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git)
- gem install travis-conditions
- apt list --installed 'lib*-dev'
- (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git)
REMOTE=${REMOTE:-no}
# CC: gcc or clang
CC=${CC:-gcc}
REMOTE=${REMOTE:-no}
# CC: gcc or clang
CC=${CC:-gcc}
+# GCC and Clang recognize --version and print to stdout. Sun compilers
+# recognize -V and print to stderr.
+"$CC" --version 2>/dev/null || "$CC" -V || :
# CMAKE: no or yes
CMAKE=${CMAKE:-no}
# CRYPTO: no or yes
# CMAKE: no or yes
CMAKE=${CMAKE:-no}
# CRYPTO: no or yes
# SMB: no or yes
SMB=${SMB:-no}
# Install directory prefix
# SMB: no or yes
SMB=${SMB:-no}
# Install directory prefix
+if [ -z "$PREFIX" ]; then
+ PREFIX=$(mktemp -d -t tcpdump_build_XXXXXXXX)
+ echo "PREFIX set to '$PREFIX'"
+fi
-export TCPDUMP_BIN=$PREFIX/bin/tcpdump
+export TCPDUMP_BIN="$PREFIX/bin/tcpdump"
- local action="$1"
- local name="$2"
+ local action=${1:?}
+ local name=${2:?}
if [ "$TRAVIS" != true ]; then return; fi
echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
sleep 1
if [ "$TRAVIS" != true ]; then return; fi
echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
sleep 1
travis_fold start configure
if [ "$BUILD_LIBPCAP" = yes ]; then
echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
travis_fold start configure
if [ "$BUILD_LIBPCAP" = yes ]; then
echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
- ./configure --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix=$PREFIX
- export LD_LIBRARY_PATH=$PREFIX/lib
+ ./configure --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix="$PREFIX"
+ export LD_LIBRARY_PATH="$PREFIX/lib"
- ./configure --disable-local-libpcap --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix=$PREFIX
+ ./configure --disable-local-libpcap --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix="$PREFIX"
fi
travis_fold end configure
else
fi
travis_fold end configure
else
echo '$ cmake [...]'
travis_fold start cmake
if [ "$BUILD_LIBPCAP" = yes ]; then
echo '$ cmake [...]'
travis_fold start cmake
if [ "$BUILD_LIBPCAP" = yes ]; then
- cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX ..
- export LD_LIBRARY_PATH=$PREFIX/lib
+ cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_PREFIX_PATH="$PREFIX" -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
+ export LD_LIBRARY_PATH="$PREFIX/lib"
- cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_INSTALL_PREFIX=$PREFIX ..
+ cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
fi
travis_fold end cmake
fi
fi
travis_fold end cmake
fi
if [ "$TRAVIS" = true ] && [ -n "$DEBUG_BUILD" ] ; then
echo '$ cat Makefile [...]'
travis_fold start cat_makefile
if [ "$TRAVIS" = true ] && [ -n "$DEBUG_BUILD" ] ; then
echo '$ cat Makefile [...]'
travis_fold start cat_makefile
- if [ "$CMAKE" = no ]; then
- sed -n '1,/DO NOT DELETE THIS LINE -- mkdep uses it/p' < Makefile
- else
- cat Makefile
- fi
+ sed '/DO NOT DELETE THIS LINE -- mkdep uses it/q' < Makefile
travis_fold end cat_makefile
echo '$ cat config.h'
travis_fold start cat_config_h
travis_fold end cat_makefile
echo '$ cat config.h'
travis_fold start cat_config_h
travis_fold end cat_config_log
fi
fi
travis_fold end cat_config_log
fi
fi
+if [ "$DELETE_PREFIX" = yes ]; then
+ rm -rf "$PREFIX"
+fi
# vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :
# vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :
# ANSI color escape sequences
ANSI_MAGENTA="\\033[35;1m"
ANSI_RESET="\\033[0m"
# ANSI color escape sequences
ANSI_MAGENTA="\\033[35;1m"
ANSI_RESET="\\033[0m"
# Install directory prefix
# Install directory prefix
+if [ -z "$PREFIX" ]; then
+ PREFIX=$(mktemp -d -t tcpdump_build_matrix_XXXXXXXX)
+ echo "PREFIX set to '$PREFIX'"
+ export PREFIX
+fi
- local action="$1"
- local name="$2"
+ local action=${1:?}
+ local name=${2:?}
if [ "$TRAVIS" != true ]; then return; fi
echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
sleep 1
if [ "$TRAVIS" != true ]; then return; fi
echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
sleep 1
build_tcpdump() {
for CC in ${MATRIX_CC:-gcc clang}; do
export CC
build_tcpdump() {
for CC in ${MATRIX_CC:-gcc clang}; do
export CC
- # Exclude gcc on OSX (it is just an alias for clang)
- if [ "$CC" = gcc ] && [ "$TRAVIS_OS_NAME" = osx ]; then continue; fi
+ # Exclude gcc on macOS (it is just an alias for clang).
+ if [ "$CC" = gcc ] && [ "$(uname -s)" = Darwin ]; then
+ echo '(skipped)'
+ continue
+ fi
for CMAKE in ${MATRIX_CMAKE:-no yes}; do
export CMAKE
for CRYPTO in ${MATRIX_CRYPTO:-no yes}; do
for CMAKE in ${MATRIX_CMAKE:-no yes}; do
export CMAKE
for CRYPTO in ${MATRIX_CRYPTO:-no yes}; do
echo 'Cleaning...'
travis_fold start cleaning
if [ "$CMAKE" = yes ]; then rm -rf build; else make distclean; fi
echo 'Cleaning...'
travis_fold start cleaning
if [ "$CMAKE" = yes ]; then rm -rf build; else make distclean; fi
- rm -rf $PREFIX/bin/tcpdump*
+ rm -rf "$PREFIX"/bin/tcpdump*
git status -suall
# Cancel changes in configure
git checkout configure
git status -suall
# Cancel changes in configure
git checkout configure
choose_libpcap() {
if [ "$BUILD_LIBPCAP" = no ]; then
echo_magenta 'Use system libpcap'
choose_libpcap() {
if [ "$BUILD_LIBPCAP" = no ]; then
echo_magenta 'Use system libpcap'
make -C ../libpcap distclean || :
else
# Build libpcap with autoconf
make -C ../libpcap distclean || :
else
# Build libpcap with autoconf
choose_libpcap
# Set PKG_CONFIG_PATH for configure when building libpcap
if [ "$CMAKE" != no ]; then
choose_libpcap
# Set PKG_CONFIG_PATH for configure when building libpcap
if [ "$CMAKE" != no ]; then
- export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
+ export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
echo_magenta "Tested setup count: $COUNT"
# vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :
echo_magenta "Tested setup count: $COUNT"
# vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :