diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh index cfc29654cb..6c6577de33 100755 --- a/contrib/install_db4.sh +++ b/contrib/install_db4.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://opensource.org/licenses/mit-license.php. @@ -20,6 +20,10 @@ expand_path() { cd "${1}" && pwd -P } +prev_dir=$(pwd) +script_dir=$(expand_path $(dirname ${0})) +cd "${prev_dir}" + BDB_PREFIX="$(expand_path ${1})/db4"; shift; BDB_VERSION='db-4.8.30.NC' BDB_HASH='12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef' @@ -221,19 +225,15 @@ EOF # The packaged config.guess and config.sub are ancient (2009) and can cause build issues. # Replace them with modern versions. # See https://github.com/bitcoin/bitcoin/issues/16064 -CONFIG_GUESS_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b' -CONFIG_GUESS_HASH='2d1ff7bca773d2ec3c6217118129220fa72d8adda67c7d2bf79994b3129232c1' -CONFIG_SUB_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b' -CONFIG_SUB_HASH='3a4befde9bcdf0fdb2763fc1bfa74e8696df94e1ad7aac8042d133c8ff1d2e32' - rm -f "dist/config.guess" rm -f "dist/config.sub" -http_get "${CONFIG_GUESS_URL}" dist/config.guess "${CONFIG_GUESS_HASH}" -http_get "${CONFIG_SUB_URL}" dist/config.sub "${CONFIG_SUB_HASH}" +cp "$script_dir/../depends/config.guess" dist/config.guess +cp "$script_dir/../depends/config.sub" dist/config.sub cd build_unix/ +CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration" \ "${BDB_PREFIX}/${BDB_VERSION}/dist/configure" \ --enable-cxx --disable-shared --disable-replication --with-pic --prefix="${BDB_PREFIX}" \ "${@}"