Skip to content

Commit 8578c6f

Browse files
committed
build: Fix search for brew-installed BDB 4 on OS X
On OS X, when searching Homebrew keg-only packages for BDB 4.8, if we find it, use BDB_CPPFLAGS and BDB_LIBS instead of CFLAGS and LIBS for the result. This is (1) more correct, and (2) necessary in order to give this location priority over other directories in the include search path, which may include system include directories with other versions of BDB.
1 parent 80fd474 commit 8578c6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,10 @@ case $host in
635635

636636
bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null)
637637
qt5_prefix=$($BREW --prefix qt5 2>/dev/null)
638-
if test x$bdb_prefix != x; then
639-
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
640-
LIBS="$LIBS -L$bdb_prefix/lib"
638+
if test x$bdb_prefix != x && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x"; then
639+
dnl This must precede the call to BITCOIN_FIND_BDB48 below.
640+
BDB_CFLAGS="-I$bdb_prefix/include"
641+
BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8"
641642
fi
642643
if test x$qt5_prefix != x; then
643644
PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"

0 commit comments

Comments
 (0)