Browse Source

Changes to upgrade bdb to 6.2.23

Closes #1255
pull/4/head
Robert C. Seacord 8 years ago
committed by Jack Grigg
parent
commit
4734b29ecd
  1. 30
      build-aux/m4/bitcoin_find_bdb48.m4
  2. 8
      configure.ac
  3. 12
      depends/packages/bdb.mk

30
build-aux/m4/bitcoin_find_bdb48.m4

@ -1,11 +1,11 @@
AC_DEFUN([BITCOIN_FIND_BDB48],[
AC_DEFUN([BITCOIN_FIND_BDB62],[
AC_MSG_CHECKING([for Berkeley DB C++ headers])
BDB_CPPFLAGS=
BDB_LIBS=
bdbpath=X
bdb48path=X
bdb62path=X
bdbdirlist=
for _vn in 4.8 48 4 5 ''; do
for _vn in 6.2 62 6 ''; do
for _pfx in b lib ''; do
bdbdirlist="$bdbdirlist ${_pfx}db${_vn}"
done
@ -15,8 +15,8 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
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+"
#if !((DB_VERSION_MAJOR == 6 && DB_VERSION_MINOR >= 2) || DB_VERSION_MAJOR > 6)
#error "failed to find bdb 6.2+"
#endif
]])],[
if test "x$bdbpath" = "xX"; then
@ -28,32 +28,32 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
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"
#if !(DB_VERSION_MAJOR == 6 && DB_VERSION_MINOR == 2)
#error "failed to find bdb 6.2"
#endif
]])],[
bdb48path="${searchpath}"
bdb62path="${searchpath}"
break
],[])
done
if test "x$bdbpath" = "xX"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
elif test "x$bdb48path" = "xX"; then
elif test "x$bdb62path" = "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])],[
AC_MSG_WARN([Found Berkeley DB other than 4.8; wallets opened by this build will not be portable!])
AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 6.2])],[
AC_MSG_WARN([Found Berkeley DB other than 6.2; wallets opened by this build will not be portable!])
],[
AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)])
AC_MSG_ERROR([Found Berkeley DB other than 6.2, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)])
])
else
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx)
bdbpath="${bdb48path}"
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb62path}],db_cxx)
bdbpath="${bdb62path}"
fi
AC_SUBST(BDB_CPPFLAGS)
# TODO: Ideally this could find the library version and make sure it matches the headers being used
for searchlib in db_cxx-4.8 db_cxx; do
for searchlib in db_cxx-6.2 db_cxx; do
AC_CHECK_LIB([$searchlib],[main],[
BDB_LIBS="-l${searchlib}"
break

8
configure.ac

@ -263,9 +263,9 @@ case $host in
dnl add default macports paths
CPPFLAGS="$CPPFLAGS -isystem /opt/local/include"
LIBS="$LIBS -L/opt/local/lib"
if test -d /opt/local/include/db48; then
CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48"
LIBS="$LIBS -L/opt/local/lib/db48"
if test -d /opt/local/include/db62; then
CPPFLAGS="$CPPFLAGS -I/opt/local/include/db62"
LIBS="$LIBS -L/opt/local/lib/db62"
fi
fi
@ -512,7 +512,7 @@ AC_SUBST(LIBMEMENV)
if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
BITCOIN_FIND_BDB48
BITCOIN_FIND_BDB62
fi
dnl Check for libminiupnpc (optional)

12
depends/packages/bdb.mk

@ -1,8 +1,8 @@
package=bdb
$(package)_version=4.8.30
$(package)_version=6.2.23
$(package)_download_path=http://download.oracle.com/berkeley-db
$(package)_file_name=db-$($(package)_version).NC.tar.gz
$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
$(package)_file_name=db-$($(package)_version).tar.gz
$(package)_sha256_hash=47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea24e95dc7
$(package)_build_subdir=build_unix
define $(package)_set_vars
@ -11,16 +11,12 @@ $(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
endef
define $(package)_preprocess_cmds
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h
endef
define $(package)_config_cmds
../dist/$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE) libdb_cxx-4.8.a libdb-4.8.a
$(MAKE) libdb_cxx-6.2.a libdb-6.2.a
endef
define $(package)_stage_cmds

Loading…
Cancel
Save