2016-09-29 07:57:47 +02:00
|
|
|
dnl Copyright (c) 2013-2015 The Bitcoin Core developers
|
|
|
|
dnl Distributed under the MIT software license, see the accompanying
|
|
|
|
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-09-07 21:43:25 +02:00
|
|
|
AC_DEFUN([BITCOIN_FIND_BDB48],[
|
2017-02-08 14:18:18 +01:00
|
|
|
AC_ARG_VAR(BDB_CFLAGS, [C compiler flags for BerkeleyDB, bypasses autodetection])
|
|
|
|
AC_ARG_VAR(BDB_LIBS, [Linker flags for BerkeleyDB, bypasses autodetection])
|
|
|
|
|
2023-02-04 19:28:21 +01:00
|
|
|
if test "x$use_bdb" = "xno"; then
|
|
|
|
use_bdb=no
|
|
|
|
elif test "x$BDB_CFLAGS" = "x"; then
|
2017-02-08 14:18:18 +01:00
|
|
|
AC_MSG_CHECKING([for Berkeley DB C++ headers])
|
|
|
|
BDB_CPPFLAGS=
|
|
|
|
bdbpath=X
|
|
|
|
bdb48path=X
|
|
|
|
bdbdirlist=
|
2017-07-17 09:49:23 +02:00
|
|
|
for _vn in 4.8 48 4 5 5.3 ''; do
|
2017-02-08 14:18:18 +01:00
|
|
|
for _pfx in b lib ''; do
|
|
|
|
bdbdirlist="$bdbdirlist ${_pfx}db${_vn}"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
for searchpath in $bdbdirlist ''; do
|
|
|
|
test -n "${searchpath}" && searchpath="${searchpath}/"
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <${searchpath}db_cxx.h>
|
|
|
|
]],[[
|
|
|
|
#if !((DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || DB_VERSION_MAJOR > 4)
|
|
|
|
#error "failed to find bdb 4.8+"
|
|
|
|
#endif
|
|
|
|
]])],[
|
|
|
|
if test "x$bdbpath" = "xX"; then
|
|
|
|
bdbpath="${searchpath}"
|
|
|
|
fi
|
|
|
|
],[
|
|
|
|
continue
|
|
|
|
])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <${searchpath}db_cxx.h>
|
|
|
|
]],[[
|
|
|
|
#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8)
|
|
|
|
#error "failed to find bdb 4.8"
|
|
|
|
#endif
|
|
|
|
]])],[
|
|
|
|
bdb48path="${searchpath}"
|
|
|
|
break
|
|
|
|
],[])
|
2013-09-07 21:43:25 +02:00
|
|
|
done
|
2017-02-08 14:18:18 +01:00
|
|
|
if test "x$bdbpath" = "xX"; then
|
2023-02-04 19:28:21 +01:00
|
|
|
use_bdb=no
|
2017-02-08 14:18:18 +01:00
|
|
|
AC_MSG_RESULT([no])
|
Merge bitcoin/bitcoin#23168: build: no-longer fail default configure if BDB isn't available
747cd17404832604c50d03d58e11ba816bb229f7 build: no-longer fail default configure if BDB isn't available (fanquake)
Pull request description:
Inline with moving to descriptor (sqlite) wallets by default for 0.23,
this adapts the build system so that a default `./configure` invocation
no-longer fails if BDB isn't present. Currently, if configure is run
with no options, and no BDB is present, we'll fail with:
```bash
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
```
If descriptor wallets are to be the default, this behaviour no longer
makes sense, as a builder should be able to configure and build, to use
a wallet, without BDB installed, and without passing additional
arguments, i.e `--without-bdb` or `--with-incompatible-bdb`, to
configure.
With this change, running configure will no-longer fail, but will
instead print:
```bash
checking for Berkeley DB C++ headers... no
configure: WARNING: libdb_cxx headers missing
configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support
configure: WARNING: Passing --without-bdb will suppress this warning
checking for sqlite3 >= 3.7.17... yes
checking whether to build wallet with support for sqlite... yes
```
ACKs for top commit:
hebasto:
ACK 747cd17404832604c50d03d58e11ba816bb229f7, tested on Linux Mint 20.2 (x86_64) with the (un)installed system packages `libdb-dev` and `libdb++-dev`.
Tree-SHA512: ae316d71ad0803c9d4b02a5fedcade08242650d987cc047840493ba4a881e71ff48b099075bb7c325307d44744fcdeccb57f7fa8db4135c81a5835841f562afa
2021-10-11 02:35:43 +02:00
|
|
|
AC_MSG_WARN([libdb_cxx headers missing])
|
|
|
|
AC_MSG_WARN(AC_PACKAGE_NAME[ requires this library for BDB (legacy) wallet support])
|
|
|
|
AC_MSG_WARN([Passing --without-bdb will suppress this warning])
|
2017-02-08 14:18:18 +01:00
|
|
|
elif test "x$bdb48path" = "xX"; then
|
|
|
|
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx)
|
|
|
|
AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[
|
Merge bitcoin/bitcoin#23168: build: no-longer fail default configure if BDB isn't available
747cd17404832604c50d03d58e11ba816bb229f7 build: no-longer fail default configure if BDB isn't available (fanquake)
Pull request description:
Inline with moving to descriptor (sqlite) wallets by default for 0.23,
this adapts the build system so that a default `./configure` invocation
no-longer fails if BDB isn't present. Currently, if configure is run
with no options, and no BDB is present, we'll fail with:
```bash
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
```
If descriptor wallets are to be the default, this behaviour no longer
makes sense, as a builder should be able to configure and build, to use
a wallet, without BDB installed, and without passing additional
arguments, i.e `--without-bdb` or `--with-incompatible-bdb`, to
configure.
With this change, running configure will no-longer fail, but will
instead print:
```bash
checking for Berkeley DB C++ headers... no
configure: WARNING: libdb_cxx headers missing
configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support
configure: WARNING: Passing --without-bdb will suppress this warning
checking for sqlite3 >= 3.7.17... yes
checking whether to build wallet with support for sqlite... yes
```
ACKs for top commit:
hebasto:
ACK 747cd17404832604c50d03d58e11ba816bb229f7, tested on Linux Mint 20.2 (x86_64) with the (un)installed system packages `libdb-dev` and `libdb++-dev`.
Tree-SHA512: ae316d71ad0803c9d4b02a5fedcade08242650d987cc047840493ba4a881e71ff48b099075bb7c325307d44744fcdeccb57f7fa8db4135c81a5835841f562afa
2021-10-11 02:35:43 +02:00
|
|
|
AC_MSG_WARN([Found Berkeley DB other than 4.8])
|
|
|
|
AC_MSG_WARN([BDB (legacy) wallets opened by this build will not be portable!])
|
|
|
|
use_bdb=yes
|
2017-02-08 14:18:18 +01:00
|
|
|
],[
|
Merge bitcoin/bitcoin#23168: build: no-longer fail default configure if BDB isn't available
747cd17404832604c50d03d58e11ba816bb229f7 build: no-longer fail default configure if BDB isn't available (fanquake)
Pull request description:
Inline with moving to descriptor (sqlite) wallets by default for 0.23,
this adapts the build system so that a default `./configure` invocation
no-longer fails if BDB isn't present. Currently, if configure is run
with no options, and no BDB is present, we'll fail with:
```bash
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
```
If descriptor wallets are to be the default, this behaviour no longer
makes sense, as a builder should be able to configure and build, to use
a wallet, without BDB installed, and without passing additional
arguments, i.e `--without-bdb` or `--with-incompatible-bdb`, to
configure.
With this change, running configure will no-longer fail, but will
instead print:
```bash
checking for Berkeley DB C++ headers... no
configure: WARNING: libdb_cxx headers missing
configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support
configure: WARNING: Passing --without-bdb will suppress this warning
checking for sqlite3 >= 3.7.17... yes
checking whether to build wallet with support for sqlite... yes
```
ACKs for top commit:
hebasto:
ACK 747cd17404832604c50d03d58e11ba816bb229f7, tested on Linux Mint 20.2 (x86_64) with the (un)installed system packages `libdb-dev` and `libdb++-dev`.
Tree-SHA512: ae316d71ad0803c9d4b02a5fedcade08242650d987cc047840493ba4a881e71ff48b099075bb7c325307d44744fcdeccb57f7fa8db4135c81a5835841f562afa
2021-10-11 02:35:43 +02:00
|
|
|
AC_MSG_WARN([Found Berkeley DB other than 4.8])
|
|
|
|
AC_MSG_WARN([BDB (legacy) wallets opened by this build would not be portable!])
|
|
|
|
AC_MSG_WARN([If this is intended, pass --with-incompatible-bdb])
|
|
|
|
AC_MSG_WARN([Passing --without-bdb will suppress this warning])
|
|
|
|
use_bdb=no
|
2017-02-08 14:18:18 +01:00
|
|
|
])
|
|
|
|
else
|
|
|
|
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx)
|
|
|
|
bdbpath="${bdb48path}"
|
2023-02-04 19:28:21 +01:00
|
|
|
use_bdb=yes
|
2017-02-08 14:18:18 +01:00
|
|
|
fi
|
2013-09-07 21:43:25 +02:00
|
|
|
else
|
2017-02-08 14:18:18 +01:00
|
|
|
BDB_CPPFLAGS=${BDB_CFLAGS}
|
2013-09-07 21:43:25 +02:00
|
|
|
fi
|
|
|
|
AC_SUBST(BDB_CPPFLAGS)
|
Merge #16812: doc: Fix whitespace errs in .md files, bitcoin.conf, and Info.plist.in
6aab7649d30b19d136a27f1287fd2c8b00fb460c doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 (Jon Layton)
Pull request description:
Although there is an existing `test/lint/lint-whitespace.sh` linter, it only prevents new errors from being introduced. This commit removes all existing whitespace errors from Core markdown files (skips `src/crypto/ctaes/`, `leveldb/`, and `doc/release-notes/`), `bitcoin.conf`, and `Info.plist.in`.
Further formatting could be done on the markdown documents, but seeing as there several coexisting styles that break a few `markdownlint` rules, a first step would be to define and add a linter to Travis. For now, the small fix is made.
ACKs for top commit:
fanquake:
ACK 6aab7649d30b19d136a27f1287fd2c8b00fb460c - Thanks for following up. Hopefully we now never have to deal with whitespace again.
Tree-SHA512: 810cc31ae4364b2dedf85783e67315d7b4e11589e4b32c599606e1b1ba8de0663bcae9ddb1bd8c9762a3636a2d65bdcd64ec22d2e90943f374a0c9574b77ca23
2019-09-17 10:33:29 +02:00
|
|
|
|
2023-02-04 19:28:21 +01:00
|
|
|
if test "x$use_bdb" = "xno"; then
|
|
|
|
use_bdb=no
|
|
|
|
elif test "x$BDB_LIBS" = "x"; then
|
2017-02-08 14:18:18 +01:00
|
|
|
# TODO: Ideally this could find the library version and make sure it matches the headers being used
|
2018-01-30 09:56:38 +01:00
|
|
|
for searchlib in db_cxx-4.8 db_cxx db4_cxx; do
|
2017-02-08 14:18:18 +01:00
|
|
|
AC_CHECK_LIB([$searchlib],[main],[
|
|
|
|
BDB_LIBS="-l${searchlib}"
|
|
|
|
break
|
|
|
|
])
|
|
|
|
done
|
|
|
|
if test "x$BDB_LIBS" = "x"; then
|
Merge bitcoin/bitcoin#23168: build: no-longer fail default configure if BDB isn't available
747cd17404832604c50d03d58e11ba816bb229f7 build: no-longer fail default configure if BDB isn't available (fanquake)
Pull request description:
Inline with moving to descriptor (sqlite) wallets by default for 0.23,
this adapts the build system so that a default `./configure` invocation
no-longer fails if BDB isn't present. Currently, if configure is run
with no options, and no BDB is present, we'll fail with:
```bash
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
```
If descriptor wallets are to be the default, this behaviour no longer
makes sense, as a builder should be able to configure and build, to use
a wallet, without BDB installed, and without passing additional
arguments, i.e `--without-bdb` or `--with-incompatible-bdb`, to
configure.
With this change, running configure will no-longer fail, but will
instead print:
```bash
checking for Berkeley DB C++ headers... no
configure: WARNING: libdb_cxx headers missing
configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support
configure: WARNING: Passing --without-bdb will suppress this warning
checking for sqlite3 >= 3.7.17... yes
checking whether to build wallet with support for sqlite... yes
```
ACKs for top commit:
hebasto:
ACK 747cd17404832604c50d03d58e11ba816bb229f7, tested on Linux Mint 20.2 (x86_64) with the (un)installed system packages `libdb-dev` and `libdb++-dev`.
Tree-SHA512: ae316d71ad0803c9d4b02a5fedcade08242650d987cc047840493ba4a881e71ff48b099075bb7c325307d44744fcdeccb57f7fa8db4135c81a5835841f562afa
2021-10-11 02:35:43 +02:00
|
|
|
AC_MSG_WARN([libdb_cxx headers missing])
|
|
|
|
AC_MSG_WARN(AC_PACKAGE_NAME[ requires this library for BDB (legacy) wallet support])
|
|
|
|
AC_MSG_WARN([Passing --without-bdb will suppress this warning])
|
2017-02-08 14:18:18 +01:00
|
|
|
fi
|
2013-09-07 21:43:25 +02:00
|
|
|
fi
|
2023-02-04 19:28:21 +01:00
|
|
|
if test "x$use_bdb" != "xno"; then
|
|
|
|
AC_DEFINE([USE_BDB], [1], [Define if BDB support should be compiled in])
|
|
|
|
use_bdb=yes
|
|
|
|
fi
|
2013-09-07 21:43:25 +02:00
|
|
|
])
|