mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-11 23:30:05 +02:00
build, wallet, doc: Remove BDB
This commit is contained in:
@@ -36,7 +36,6 @@ NO_BOOST ?=
|
||||
NO_LIBEVENT ?=
|
||||
NO_QT ?=
|
||||
NO_QR ?=
|
||||
NO_BDB ?=
|
||||
NO_WALLET ?=
|
||||
NO_ZMQ ?=
|
||||
NO_USDT ?=
|
||||
@@ -159,8 +158,7 @@ qrencode_packages_$(NO_QR) = $(qrencode_$(host_os)_packages)
|
||||
qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_)
|
||||
qt_native_packages_$(NO_QT) = $(qt_native_packages)
|
||||
|
||||
bdb_packages_$(NO_BDB) = $(bdb_packages)
|
||||
wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages)
|
||||
wallet_packages_$(NO_WALLET) = $(sqlite_packages)
|
||||
|
||||
zmq_packages_$(NO_ZMQ) = $(zmq_packages)
|
||||
multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages)
|
||||
@@ -232,7 +230,6 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina
|
||||
-e 's|@qrencode_packages@|$(qrencode_packages_)|' \
|
||||
-e 's|@zmq_packages@|$(zmq_packages_)|' \
|
||||
-e 's|@wallet_packages@|$(wallet_packages_)|' \
|
||||
-e 's|@bdb_packages@|$(bdb_packages_)|' \
|
||||
-e 's|@usdt_packages@|$(usdt_packages_)|' \
|
||||
-e 's|@multiprocess@|$(MULTIPROCESS)|' \
|
||||
$< > $@
|
||||
|
||||
@@ -79,7 +79,6 @@ The following can be set when running make: `make FOO=bar`
|
||||
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
|
||||
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ
|
||||
- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet (SQLite)
|
||||
- `NO_BDB`: Don't download/build/cache BerkeleyDB
|
||||
- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints
|
||||
- `MULTIPROCESS`: Build libmultiprocess (experimental)
|
||||
- `DEBUG`: Disable some optimizations and enable more runtime checking
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package=bdb
|
||||
$(package)_version=4.8.30
|
||||
$(package)_download_path=https://download.oracle.com/berkeley-db
|
||||
$(package)_file_name=db-$($(package)_version).NC.tar.gz
|
||||
$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
|
||||
$(package)_build_subdir=build_unix
|
||||
$(package)_patches=clang_cxx_11.patch
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking
|
||||
$(package)_config_opts_mingw32=--enable-mingw
|
||||
$(package)_cflags+=-Wno-error=implicit-function-declaration -Wno-error=format-security -Wno-error=implicit-int
|
||||
$(package)_cppflags_freebsd=-D_XOPEN_SOURCE=600 -D__BSD_VISIBLE=1
|
||||
$(package)_cppflags_netbsd=-D_XOPEN_SOURCE=600
|
||||
$(package)_cppflags_mingw32=-DUNICODE -D_UNICODE
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/clang_cxx_11.patch && \
|
||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
../dist/$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) libdb_cxx-4.8.a libdb-4.8.a
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include
|
||||
endef
|
||||
@@ -15,7 +15,6 @@ ifneq ($(host),$(build))
|
||||
qt_native_packages := native_qt
|
||||
endif
|
||||
|
||||
bdb_packages=bdb
|
||||
sqlite_packages=sqlite
|
||||
|
||||
zmq_packages=zeromq
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
commit 3311d68f11d1697565401eee6efc85c34f022ea7
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Mon Aug 17 20:03:56 2020 +0800
|
||||
|
||||
Fix C++11 compatibility
|
||||
|
||||
diff --git a/dbinc/atomic.h b/dbinc/atomic.h
|
||||
index 0034dcc..7c11d4a 100644
|
||||
--- a/dbinc/atomic.h
|
||||
+++ b/dbinc/atomic.h
|
||||
@@ -70,7 +70,7 @@ typedef struct {
|
||||
* These have no memory barriers; the caller must include them when necessary.
|
||||
*/
|
||||
#define atomic_read(p) ((p)->value)
|
||||
-#define atomic_init(p, val) ((p)->value = (val))
|
||||
+#define atomic_init_db(p, val) ((p)->value = (val))
|
||||
|
||||
#ifdef HAVE_ATOMIC_SUPPORT
|
||||
|
||||
@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
|
||||
#define atomic_inc(env, p) __atomic_inc(p)
|
||||
#define atomic_dec(env, p) __atomic_dec(p)
|
||||
#define atomic_compare_exchange(env, p, o, n) \
|
||||
- __atomic_compare_exchange((p), (o), (n))
|
||||
+ __atomic_compare_exchange_db((p), (o), (n))
|
||||
static inline int __atomic_inc(db_atomic_t *p)
|
||||
{
|
||||
int temp;
|
||||
@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
|
||||
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
|
||||
* which configure could be changed to use.
|
||||
*/
|
||||
-static inline int __atomic_compare_exchange(
|
||||
+static inline int __atomic_compare_exchange_db(
|
||||
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
|
||||
{
|
||||
atomic_value_t was;
|
||||
@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
|
||||
#define atomic_dec(env, p) (--(p)->value)
|
||||
#define atomic_compare_exchange(env, p, oldval, newval) \
|
||||
(DB_ASSERT(env, atomic_read(p) == (oldval)), \
|
||||
- atomic_init(p, (newval)), 1)
|
||||
+ atomic_init_db(p, (newval)), 1)
|
||||
#else
|
||||
#define atomic_inc(env, p) __atomic_inc(env, p)
|
||||
#define atomic_dec(env, p) __atomic_dec(env, p)
|
||||
diff --git a/mp/mp_fget.c b/mp/mp_fget.c
|
||||
index 5fdee5a..0b75f57 100644
|
||||
--- a/mp/mp_fget.c
|
||||
+++ b/mp/mp_fget.c
|
||||
@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */
|
||||
|
||||
/* Initialize enough so we can call __memp_bhfree. */
|
||||
alloc_bhp->flags = 0;
|
||||
- atomic_init(&alloc_bhp->ref, 1);
|
||||
+ atomic_init_db(&alloc_bhp->ref, 1);
|
||||
#ifdef DIAGNOSTIC
|
||||
if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
|
||||
__db_errx(env,
|
||||
@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */
|
||||
MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
|
||||
PROT_READ);
|
||||
|
||||
- atomic_init(&alloc_bhp->ref, 1);
|
||||
+ atomic_init_db(&alloc_bhp->ref, 1);
|
||||
MUTEX_LOCK(env, alloc_bhp->mtx_buf);
|
||||
alloc_bhp->priority = bhp->priority;
|
||||
alloc_bhp->pgno = bhp->pgno;
|
||||
diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c
|
||||
index 34467d2..f05aa0c 100644
|
||||
--- a/mp/mp_mvcc.c
|
||||
+++ b/mp/mp_mvcc.c
|
||||
@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
|
||||
#else
|
||||
memcpy(frozen_bhp, bhp, SSZA(BH, buf));
|
||||
#endif
|
||||
- atomic_init(&frozen_bhp->ref, 0);
|
||||
+ atomic_init_db(&frozen_bhp->ref, 0);
|
||||
if (mutex != MUTEX_INVALID)
|
||||
frozen_bhp->mtx_buf = mutex;
|
||||
else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
|
||||
@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
|
||||
#endif
|
||||
alloc_bhp->mtx_buf = mutex;
|
||||
MUTEX_LOCK(env, alloc_bhp->mtx_buf);
|
||||
- atomic_init(&alloc_bhp->ref, 1);
|
||||
+ atomic_init_db(&alloc_bhp->ref, 1);
|
||||
F_CLR(alloc_bhp, BH_FROZEN);
|
||||
}
|
||||
|
||||
diff --git a/mp/mp_region.c b/mp/mp_region.c
|
||||
index e6cece9..ddbe906 100644
|
||||
--- a/mp/mp_region.c
|
||||
+++ b/mp/mp_region.c
|
||||
@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
|
||||
MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
|
||||
return (ret);
|
||||
SH_TAILQ_INIT(&htab[i].hash_bucket);
|
||||
- atomic_init(&htab[i].hash_page_dirty, 0);
|
||||
+ atomic_init_db(&htab[i].hash_page_dirty, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
|
||||
hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
|
||||
mtx_base + i;
|
||||
SH_TAILQ_INIT(&hp->hash_bucket);
|
||||
- atomic_init(&hp->hash_page_dirty, 0);
|
||||
+ atomic_init_db(&hp->hash_page_dirty, 0);
|
||||
#ifdef HAVE_STATISTICS
|
||||
hp->hash_io_wait = 0;
|
||||
hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
|
||||
diff --git a/mutex/mut_method.c b/mutex/mut_method.c
|
||||
index 2588763..5c6d516 100644
|
||||
--- a/mutex/mut_method.c
|
||||
+++ b/mutex/mut_method.c
|
||||
@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval)
|
||||
MUTEX_LOCK(env, mtx);
|
||||
ret = atomic_read(v) == oldval;
|
||||
if (ret)
|
||||
- atomic_init(v, newval);
|
||||
+ atomic_init_db(v, newval);
|
||||
MUTEX_UNLOCK(env, mtx);
|
||||
|
||||
return (ret);
|
||||
diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c
|
||||
index f3922e0..e40fcdf 100644
|
||||
--- a/mutex/mut_tas.c
|
||||
+++ b/mutex/mut_tas.c
|
||||
@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags)
|
||||
|
||||
#ifdef HAVE_SHARED_LATCHES
|
||||
if (F_ISSET(mutexp, DB_MUTEX_SHARED))
|
||||
- atomic_init(&mutexp->sharecount, 0);
|
||||
+ atomic_init_db(&mutexp->sharecount, 0);
|
||||
else
|
||||
#endif
|
||||
if (MUTEX_INIT(&mutexp->tas)) {
|
||||
@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex)
|
||||
F_CLR(mutexp, DB_MUTEX_LOCKED);
|
||||
/* Flush flag update before zeroing count */
|
||||
MEMBAR_EXIT();
|
||||
- atomic_init(&mutexp->sharecount, 0);
|
||||
+ atomic_init_db(&mutexp->sharecount, 0);
|
||||
} else {
|
||||
DB_ASSERT(env, sharecount > 0);
|
||||
MEMBAR_EXIT();
|
||||
@@ -144,13 +144,6 @@ else()
|
||||
set(ENABLE_WALLET ON CACHE BOOL "")
|
||||
endif()
|
||||
|
||||
set(bdb_packages @bdb_packages@)
|
||||
if("${wallet_packages}" STREQUAL "" OR "${bdb_packages}" STREQUAL "")
|
||||
set(WITH_BDB OFF CACHE BOOL "")
|
||||
else()
|
||||
set(WITH_BDB ON CACHE BOOL "")
|
||||
endif()
|
||||
|
||||
set(usdt_packages @usdt_packages@)
|
||||
if("${usdt_packages}" STREQUAL "")
|
||||
set(WITH_USDT OFF CACHE BOOL "")
|
||||
|
||||
Reference in New Issue
Block a user