From 90888fabf062a5b7b8ece3d7b55a0a7651fe78c5 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 7 Dec 2014 00:53:27 -0800 Subject: [PATCH] check for bdb compat. --- build-libbitcoind.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build-libbitcoind.sh b/build-libbitcoind.sh index 32707f4d..3dda8911 100755 --- a/build-libbitcoind.sh +++ b/build-libbitcoind.sh @@ -40,11 +40,21 @@ if ! test -d .git; then exit 1 fi +bdb_compat=0 +if cat /usr/include/db.h | grep -i DB_VERSION_STRING | grep -q 'DB 4.8' \ + || test -e /usr/include/db4.8 \ + || test -e /usr/include/db4.8.h; then + bdb_compat=1 +fi +if test $bdb_compat -eq 0; then + set -- "--with-incompatible-bdb" "$@" +fi + ./autogen.sh || exit 1 if test -n "$1"; then - ./configure --enable-daemonlib --with-incompatible-bdb "$@" || exit 1 + ./configure --enable-daemonlib "$@" || exit 1 else - ./configure --enable-daemonlib --with-incompatible-bdb || exit 1 + ./configure --enable-daemonlib || exit 1 fi make || exit 1