build: fix configuring when building depends with NO_BDB=1

Currently, if you build depends using `NO_BDB=1` (only sqlite wallets),
./configure will fail as it still tries to find bdb. i.e:
```bash
checking for Berkeley DB C++ headers... default
configure: error: Found Berkeley DB other than 4.8, required for portable BDB wallets (--with-incompatible-bdb to ignore or --without-bdb to disable BDB wallet support)
```

This PR fixes the build such that you can build depends, opting out of
bdb without opting out of wallets entirely, and still configure
successfully.
This commit is contained in:
fanquake 2021-04-07 15:22:49 +08:00
parent aa69471ecd
commit a5491882a0
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
3 changed files with 16 additions and 2 deletions

View File

@ -1326,9 +1326,11 @@ fi
if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
BITCOIN_FIND_BDB48
if test x$suppress_external_warnings != xno ; then
if test "x$use_bdb" != "xno"; then
BITCOIN_FIND_BDB48
if test x$suppress_external_warnings != xno ; then
BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS)
fi
fi
dnl Check for sqlite3

View File

@ -34,6 +34,8 @@ BASE_CACHE ?= $(BASEDIR)/built
SDK_PATH ?= $(BASEDIR)/SDKs
NO_QT ?=
NO_QR ?=
NO_BDB ?=
NO_SQLITE ?=
NO_WALLET ?=
NO_ZMQ ?=
NO_UPNP ?=
@ -233,6 +235,8 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@no_qr@|$(NO_QR)|' \
-e 's|@no_zmq@|$(NO_ZMQ)|' \
-e 's|@no_wallet@|$(NO_WALLET)|' \
-e 's|@no_bdb@|$(NO_BDB)|' \
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \
-e 's|@no_natpmp@|$(NO_NATPMP)|' \
-e 's|@multiprocess@|$(MULTIPROCESS)|' \

View File

@ -38,6 +38,14 @@ if test -z "$enable_wallet" && test -n "@no_wallet@"; then
enable_wallet=no
fi
if test -z "$with_bdb" && test -n "@no_bdb@"; then
with_bdb=no
fi
if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
with_sqlite=no
fi
if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
enable_multiprocess=yes
fi