Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/build_autotools.sh
#!/usr/bin/env bash | #!/usr/bin/env bash | ||||
export LC_ALL=C | export LC_ALL=C | ||||
set -euxo pipefail | set -euxo pipefail | ||||
: "${TOPLEVEL:=$(git rev-parse --show-toplevel)}" | : "${TOPLEVEL:=$(git rev-parse --show-toplevel)}" | ||||
: "${BUILD_DIR:=${TOPLEVEL}/build}" | : "${BUILD_DIR:=${TOPLEVEL}/build}" | ||||
# Default to nothing | # Default to nothing | ||||
: "${CONFIGURE_FLAGS:=}" | : "${CONFIGURE_FLAGS:=}" | ||||
: "${THREADS:=$(nproc || sysctl -n hw.ncpu)}" | |||||
# Generate necessary autoconf files | # Generate necessary autoconf files | ||||
cd ${TOPLEVEL} | cd ${TOPLEVEL} | ||||
./autogen.sh | ./autogen.sh | ||||
mkdir -p "${BUILD_DIR}" | mkdir -p "${BUILD_DIR}" | ||||
cd ${BUILD_DIR} | cd ${BUILD_DIR} | ||||
rm -f build.status test_bitcoin.xml | rm -f build.status test_bitcoin.xml | ||||
read -a CONFIGURE_FLAGS <<< "$CONFIGURE_FLAGS --prefix=$(pwd)" | read -a CONFIGURE_FLAGS <<< "$CONFIGURE_FLAGS --prefix=$(pwd)" | ||||
../configure "${CONFIGURE_FLAGS[@]}" | ../configure "${CONFIGURE_FLAGS[@]}" | ||||
# Run build | # Run build | ||||
make -j "${THREADS}" | make -j "${THREADS}" |