From 1a54be06cd359257478b584611f34058d21fe723 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 24 Jun 2018 22:56:07 +0000 Subject: Simplify Travis CI builds. Have one script per build. This means more duplication between the scripts, but it's much easier to understand and to run locally. --- .travis/autotools-linux | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 .travis/autotools-linux (limited to '.travis/autotools-linux') diff --git a/.travis/autotools-linux b/.travis/autotools-linux new file mode 100755 index 00000000..6d38e34e --- /dev/null +++ b/.travis/autotools-linux @@ -0,0 +1,52 @@ +#!/bin/sh + +ACTION="$1" + +set -eu + +CACHEDIR="$HOME/cache" +NPROC=`nproc` + +travis_install() { + # Install vanilla NaCl only. + [ -f "$CACHEDIR/lib/amd64/libnacl.a" ] || { + curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx + cd nacl-20110221 # pushd + "./do" + # "make install" + mkdir -p "$CACHEDIR/include"; mv build/*/include/* "$CACHEDIR/include" + mkdir -p "$CACHEDIR/lib" ; mv build/*/lib/* "$CACHEDIR/lib" + cd - # popd + } +} + +travis_script() { + . ".travis/flags-$CC.sh" + + add_ld_flag -Wl,-z,defs + + # Make compilation error on a warning + add_flag -Werror + + add_config_flag --with-nacl-libs="$CACHEDIR/lib/amd64" + add_config_flag --with-nacl-headers="$CACHEDIR/include/amd64" + add_config_flag --disable-ipv6 + add_config_flag --enable-nacl + add_config_flag --enable-daemon + add_config_flag --enable-logging + add_config_flag --with-log-level=TRACE + + autoreconf -fi + mkdir -p _build + cd _build # pushd + ../configure $CONFIG_FLAGS || (cat config.log && false) + make "-j$NPROC" -k CFLAGS="$C_FLAGS" LDFLAGS="$LD_FLAGS" + make "-j$NPROC" -k distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIG_FLAGS" + cd - # popd +} + +if [ "-z" "$ACTION" ]; then + "travis_script" +else + "travis_$ACTION" +fi -- cgit v1.2.3