build: Add options to override BDB cflags/libs

Add environment settings to specify the CFLAGS and LIBS to be used for
BerkeleyDB directly. These will completely by-pass autodetection in the
same way as other similar flags.

```
BDB_CFLAGS  C compiler flags for BerkeleyDB, bypasses autodetection
BDB_LIBS    Linker flags for BerkeleyDB, bypasses autodetection
```

Implements #3921.
This commit is contained in:
Wladimir J. van der Laan 2017-02-07 09:41:47 +00:00
parent 02464da5e4
commit 8713de83a0
1 changed files with 64 additions and 56 deletions

View File

@ -3,9 +3,12 @@ dnl Distributed under the MIT software license, see the accompanying
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
AC_DEFUN([BITCOIN_FIND_BDB48],[ AC_DEFUN([BITCOIN_FIND_BDB48],[
AC_ARG_VAR(BDB_CFLAGS, [C compiler flags for BerkeleyDB, bypasses autodetection])
AC_ARG_VAR(BDB_LIBS, [Linker flags for BerkeleyDB, bypasses autodetection])
if test "x$BDB_CFLAGS" = "x"; then
AC_MSG_CHECKING([for Berkeley DB C++ headers]) AC_MSG_CHECKING([for Berkeley DB C++ headers])
BDB_CPPFLAGS= BDB_CPPFLAGS=
BDB_LIBS=
bdbpath=X bdbpath=X
bdb48path=X bdb48path=X
bdbdirlist= bdbdirlist=
@ -54,8 +57,12 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx) BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx)
bdbpath="${bdb48path}" bdbpath="${bdb48path}"
fi fi
else
BDB_CPPFLAGS=${BDB_CFLAGS}
fi
AC_SUBST(BDB_CPPFLAGS) AC_SUBST(BDB_CPPFLAGS)
if test "x$BDB_LIBS" = "x"; then
# TODO: Ideally this could find the library version and make sure it matches the headers being used # TODO: Ideally this could find the library version and make sure it matches the headers being used
for searchlib in db_cxx-4.8 db_cxx; do for searchlib in db_cxx-4.8 db_cxx; do
AC_CHECK_LIB([$searchlib],[main],[ AC_CHECK_LIB([$searchlib],[main],[
@ -66,5 +73,6 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
if test "x$BDB_LIBS" = "x"; then if test "x$BDB_LIBS" = "x"; then
AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
fi fi
fi
AC_SUBST(BDB_LIBS) AC_SUBST(BDB_LIBS)
]) ])