Skip to content

Commit

Permalink
build: fix bdb detection through brew
Browse files Browse the repository at this point in the history
Fixes the detection of bdb on brew enabled systems by using
dogecoin_find_bdb53.m4 parametrization and checking if the
brew-located files actually work.

Searches brew installed packages in the order: 5.x, 4.x, default.

The reason for this order is that 4.x is still fully readable by
5.3.27NC that is distributed by default, and therefore prefered
over newer-than 5.x versions.
  • Loading branch information
patricklodder committed Aug 30, 2023
1 parent a32eb26 commit b09aa70
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,25 @@ case $host in
dnl the user (--without-wallet or --without-gui for example).

openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
bdb_prefix=`$BREW --prefix berkeley-db 2>/dev/null`
qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
if test x$openssl_prefix != x; then
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
fi
if test x$bdb_prefix != x; then
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
LIBS="$LIBS -L$bdb_prefix/lib"

dnl test brew installed bdb if no BDB_CFLAGS or BDB_LIBS was given.
dnl currently tests, in order, for 5.x, 4.x and the default version
if test x$BDB_CFLAGS = x && test x$BDB_LIBS = x; then
for brew_bdb_version in '@5' '@4' ''; do
bdb_prefix=`$BREW --prefix berkeley-db${brew_bdb_version} 2>/dev/null`
if test x$bdb_prefix != x && test -d $bdb_prefix; then
BDB_CFLAGS="-I$bdb_prefix/include"
BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx"
break
fi
done
fi

if test x$qt5_prefix != x; then
PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
Expand Down

0 comments on commit b09aa70

Please sign in to comment.