2018-08-03 15:21:03 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018 The Bitcoin Core developers
|
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2018-08-07 11:50:05 +02:00
|
|
|
export LC_ALL=C.UTF-8
|
2018-08-03 15:21:03 +02:00
|
|
|
|
2019-08-10 18:56:46 +02:00
|
|
|
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$BASE_BUILD_DIR/depends/$HOST --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib"
|
2018-08-03 15:21:03 +02:00
|
|
|
if [ -z "$NO_DEPENDS" ]; then
|
|
|
|
DOCKER_EXEC ccache --max-size=$CCACHE_SIZE
|
|
|
|
fi
|
|
|
|
|
|
|
|
BEGIN_FOLD autogen
|
|
|
|
if [ -n "$CONFIG_SHELL" ]; then
|
|
|
|
DOCKER_EXEC "$CONFIG_SHELL" -c "./autogen.sh"
|
|
|
|
else
|
|
|
|
DOCKER_EXEC ./autogen.sh
|
|
|
|
fi
|
|
|
|
END_FOLD
|
|
|
|
|
2019-11-09 15:16:16 +01:00
|
|
|
# Create folder on host and docker, so that `cd` works
|
2019-08-10 18:56:46 +02:00
|
|
|
mkdir -p build
|
2019-11-09 15:16:16 +01:00
|
|
|
DOCKER_EXEC mkdir -p build
|
2019-10-14 23:00:49 +02:00
|
|
|
|
|
|
|
# Temporarily disable errexit, because Travis macOS fails without error message
|
|
|
|
set +o errexit
|
2018-08-03 15:21:03 +02:00
|
|
|
cd build || (echo "could not enter build directory"; exit 1)
|
2019-10-14 23:00:49 +02:00
|
|
|
set -o errexit
|
2018-08-03 15:21:03 +02:00
|
|
|
|
|
|
|
BEGIN_FOLD configure
|
2019-11-09 15:16:16 +01:00
|
|
|
DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false)
|
2018-08-03 15:21:03 +02:00
|
|
|
END_FOLD
|
|
|
|
|
|
|
|
BEGIN_FOLD distdir
|
2019-11-09 15:16:16 +01:00
|
|
|
# Create folder on host and docker, so that `cd` works
|
|
|
|
mkdir -p "bitcoin-$HOST"
|
2018-08-03 15:21:03 +02:00
|
|
|
DOCKER_EXEC make distdir VERSION=$HOST
|
|
|
|
END_FOLD
|
|
|
|
|
2019-10-14 23:00:49 +02:00
|
|
|
set +o errexit
|
2018-08-03 15:21:03 +02:00
|
|
|
cd "bitcoin-$HOST" || (echo "could not enter distdir bitcoin-$HOST"; exit 1)
|
2019-10-14 23:00:49 +02:00
|
|
|
set -o errexit
|
2018-08-03 15:21:03 +02:00
|
|
|
|
|
|
|
BEGIN_FOLD configure
|
2019-11-09 15:16:16 +01:00
|
|
|
DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false)
|
2018-08-03 15:21:03 +02:00
|
|
|
END_FOLD
|
|
|
|
|
2018-12-14 17:14:50 +01:00
|
|
|
set -o errtrace
|
2019-11-21 01:10:55 +01:00
|
|
|
trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR
|
2018-12-14 17:14:50 +01:00
|
|
|
|
2018-08-03 15:21:03 +02:00
|
|
|
BEGIN_FOLD build
|
2018-12-14 17:14:50 +01:00
|
|
|
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false )
|
2018-08-03 15:21:03 +02:00
|
|
|
END_FOLD
|
|
|
|
|
2019-10-14 23:00:49 +02:00
|
|
|
set +o errexit
|
2019-08-10 18:56:46 +02:00
|
|
|
cd ${BASE_BUILD_DIR} || (echo "could not enter travis build dir $BASE_BUILD_DIR"; exit 1)
|
2019-10-14 23:00:49 +02:00
|
|
|
set -o errexit
|