Skip to content

Commit

Permalink
Changes to upgrade bdb to 6.2.23
Browse files Browse the repository at this point in the history
  • Loading branch information
daira committed Oct 25, 2016
1 parent 86b671e commit 9cb7aba
Show file tree
Hide file tree
Showing 5 changed files with 693 additions and 67 deletions.
15 changes: 2 additions & 13 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,5 @@ and UPnP software written by Thomas Bernard.

Although almost all of the Zcash code is licensed under "permissive" open source
licenses, users and distributors should note that when built using the default
build options, Zcash depends on Oracle Berkeley DB, which includes the following
license clause:

Redistributions in any form must be accompanied by information on
how to obtain complete source code for the DB software and any
accompanying software that uses the DB software. The source code
must either be included in the distribution or be available for no
more than the cost of distribution plus a nominal fee, and must be
freely redistributable under reasonable conditions. For an
executable file, complete source code means the source code for all
modules it contains. It does not include source code for modules or
files that typically accompany the major components of the operating
system on which the executable file runs.
build options, Zcash depends on Oracle Berkeley DB 6.2.x, which is licensed
under the GNU Affero General Public License.
30 changes: 15 additions & 15 deletions build-aux/m4/bitcoin_find_bdb48.m4
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
AC_DEFUN([BITCOIN_FIND_BDB53],[
AC_DEFUN([BITCOIN_FIND_BDB62],[
AC_MSG_CHECKING([for Berkeley DB C++ headers])
BDB_CPPFLAGS=
BDB_LIBS=
bdbpath=X
bdb53path=X
bdb62path=X
bdbdirlist=
for _vn in 5.3 53 5 ''; do
for _vn in 6.2 62 6 ''; do
for _pfx in b lib ''; do
bdbdirlist="$bdbdirlist ${_pfx}db${_vn}"
done
Expand All @@ -15,8 +15,8 @@ AC_DEFUN([BITCOIN_FIND_BDB53],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <${searchpath}db_cxx.h>
]],[[
#if !((DB_VERSION_MAJOR == 5 && DB_VERSION_MINOR >= 3) || DB_VERSION_MAJOR > 5)
#error "failed to find bdb 5.3+"
#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
Expand All @@ -28,32 +28,32 @@ AC_DEFUN([BITCOIN_FIND_BDB53],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <${searchpath}db_cxx.h>
]],[[
#if !(DB_VERSION_MAJOR == 5 && DB_VERSION_MINOR == 3)
#error "failed to find bdb 5.3"
#if !(DB_VERSION_MAJOR == 6 && DB_VERSION_MINOR == 2)
#error "failed to find bdb 6.2"
#endif
]])],[
bdb53path="${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$bdb53path" = "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 5.3])],[
AC_MSG_WARN([Found Berkeley DB other than 5.3; 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 5.3, 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,[${bdb53path}],db_cxx)
bdbpath="${bdb53path}"
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-5.3 db_cxx; do
for searchlib in db_cxx-6.2 db_cxx; do
AC_CHECK_LIB([$searchlib],[main],[
BDB_LIBS="-l${searchlib}"
break
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,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/db53; then
CPPFLAGS="$CPPFLAGS -I/opt/local/include/db53"
LIBS="$LIBS -L/opt/local/lib/db53"
if test -d /opt/local/include/db62; then
CPPFLAGS="$CPPFLAGS -I/opt/local/include/db62"
LIBS="$LIBS -L/opt/local/lib/db62"
fi
fi

Expand Down Expand Up @@ -522,7 +522,7 @@ AC_SUBST(LIBMEMENV)

if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
BITCOIN_FIND_BDB53
BITCOIN_FIND_BDB62
fi

dnl Check for libminiupnpc (optional)
Expand Down
Loading

0 comments on commit 9cb7aba

Please sign in to comment.