Browse Source

Downgrade bdb to 5.3.28

bdb 6.X was released under the AGPL, which is incompatible with MIT-licensed
software (the result must be licensed under AGPL). bdb 5.X uses the same license
as bdb 4.8, and thus retains the same compatibility as in upstream Bitcoin.

Thanks to Luke-Jr for raising this issue.
pull/4/head
Jack Grigg 8 years ago
parent
commit
63bc8c9a17
  1. 30
      build-aux/m4/bitcoin_find_bdb48.m4
  2. 8
      configure.ac
  3. 6
      depends/packages/bdb.mk

30
build-aux/m4/bitcoin_find_bdb48.m4

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

8
configure.ac

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

6
depends/packages/bdb.mk

@ -1,8 +1,8 @@
package=bdb package=bdb
$(package)_version=6.2.23 $(package)_version=5.3.28
$(package)_download_path=http://download.oracle.com/berkeley-db $(package)_download_path=http://download.oracle.com/berkeley-db
$(package)_file_name=db-$($(package)_version).tar.gz $(package)_file_name=db-$($(package)_version).tar.gz
$(package)_sha256_hash=47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea24e95dc7 $(package)_sha256_hash=e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628
$(package)_build_subdir=build_unix $(package)_build_subdir=build_unix
define $(package)_set_vars define $(package)_set_vars
@ -16,7 +16,7 @@ define $(package)_config_cmds
endef endef
define $(package)_build_cmds define $(package)_build_cmds
$(MAKE) libdb_cxx-6.2.a libdb-6.2.a $(MAKE) libdb_cxx-5.3.a libdb-5.3.a
endef endef
define $(package)_stage_cmds define $(package)_stage_cmds

Loading…
Cancel
Save