Skip to content

Commit cdcf826

Browse files
committed
Merge bitcoin/bitcoin#21629: build: fix configuring when building depends with NO_BDB=1
a549188 build: fix configuring when building depends with NO_BDB=1 (fanquake) Pull request description: 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 make -C depends/ NO_QT=1 NO_BDB=1 NO_UPNP=1 NO_ZMQ=1 NO_NATPMP=1 -j8 ... copying packages: native_b2 boost libevent sqlite ./autogen.sh ./configure --prefix=/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu ... 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. I think I've tested across most potential configurations. i.e: ```bash ./configure (bdb and sqlite on system) bdb & sqlite are both are available ./configure --without-bdb (bdb and sqlite on system) only sqlite ./configure --without-sqlite (bdb and sqlite on system) only bdb ./configure --disable-wallet (bdb and sqlite on system) neither bdb or sqlite depends NO_WALLET=1 ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0 neither bdb or sqlite depends NO_BDB=1 ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0 only sqlite depends NO_SQLITE=1 ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0 only bdb depends ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0 bdb and sqlite ``` ACKs for top commit: laanwj: Code review ACK a549188 jarolrod: ACK a549188 Tree-SHA512: baf7d2543a401db0d846095415ff449c04ecfb4a74c734dc51e79453702f9051210daeef686970f11fcffd32cdfadbc58acd54f0706aceecfb3edb0ff17310d7
2 parents b7c2625 + a549188 commit cdcf826

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

configure.ac

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,9 +1326,11 @@ fi
13261326

13271327
if test x$enable_wallet != xno; then
13281328
dnl Check for libdb_cxx only if wallet enabled
1329-
BITCOIN_FIND_BDB48
1330-
if test x$suppress_external_warnings != xno ; then
1329+
if test "x$use_bdb" != "xno"; then
1330+
BITCOIN_FIND_BDB48
1331+
if test x$suppress_external_warnings != xno ; then
13311332
BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS)
1333+
fi
13321334
fi
13331335

13341336
dnl Check for sqlite3

depends/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ BASE_CACHE ?= $(BASEDIR)/built
3434
SDK_PATH ?= $(BASEDIR)/SDKs
3535
NO_QT ?=
3636
NO_QR ?=
37+
NO_BDB ?=
38+
NO_SQLITE ?=
3739
NO_WALLET ?=
3840
NO_ZMQ ?=
3941
NO_UPNP ?=
@@ -233,6 +235,8 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
233235
-e 's|@no_qr@|$(NO_QR)|' \
234236
-e 's|@no_zmq@|$(NO_ZMQ)|' \
235237
-e 's|@no_wallet@|$(NO_WALLET)|' \
238+
-e 's|@no_bdb@|$(NO_BDB)|' \
239+
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
236240
-e 's|@no_upnp@|$(NO_UPNP)|' \
237241
-e 's|@no_natpmp@|$(NO_NATPMP)|' \
238242
-e 's|@multiprocess@|$(MULTIPROCESS)|' \

depends/config.site.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if test -z "$enable_wallet" && test -n "@no_wallet@"; then
3838
enable_wallet=no
3939
fi
4040

41+
if test -z "$with_bdb" && test -n "@no_bdb@"; then
42+
with_bdb=no
43+
fi
44+
45+
if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
46+
with_sqlite=no
47+
fi
48+
4149
if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
4250
enable_multiprocess=yes
4351
fi

0 commit comments

Comments
 (0)