Add --disable-wallet option to build system

Make it possible to build Bitcoin without wallet
(and thus without BDB) so that it only functions as node.
This commit is contained in:
Wladimir J. van der Laan 2013-11-29 16:50:11 +01:00
parent d004d7279f
commit 4f9e993bc9
6 changed files with 77 additions and 14 deletions

View File

@ -37,6 +37,13 @@ AM_MAINTAINER_MODE([enable])
dnl make the compilation flags quiet unless V=1 is used dnl make the compilation flags quiet unless V=1 is used
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Enable wallet
AC_ARG_ENABLE([wallet],
[AS_HELP_STRING([--enable-wallet],
[enable wallet (default is yes)])],
[enable_wallet=$enableval],
[enable_wallet=yes])
AC_ARG_WITH([miniupnpc], AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc], [AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])], [enable UPNP (default is yes if libminiupnpc is found)])],
@ -362,8 +369,10 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
[ AC_MSG_RESULT(no)] [ AC_MSG_RESULT(no)]
) )
dnl Check for libdb_cxx if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
BITCOIN_FIND_BDB48 BITCOIN_FIND_BDB48
fi
dnl Check for libminiupnpc (optional) dnl Check for libminiupnpc (optional)
if test x$use_upnp != xno; then if test x$use_upnp != xno; then
@ -593,6 +602,20 @@ if test "x$use_ccache" != "xno"; then
AC_MSG_RESULT($use_ccache) AC_MSG_RESULT($use_ccache)
fi fi
dnl enable wallet
AC_MSG_CHECKING([if wallet should be enabled])
if test x$enable_wallet != xno; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
else
AC_MSG_RESULT(no)
if test "x$use_qt" != "xno"; then
AC_MSG_ERROR([Cannot currently build Qt GUI with wallet disabled. Use --without-qt.])
fi
fi
dnl enable ipv6 support dnl enable ipv6 support
AC_MSG_CHECKING([if ipv6 should be enabled]) AC_MSG_CHECKING([if ipv6 should be enabled])
if test x$have_ipv6 = xno; then if test x$have_ipv6 = xno; then
@ -705,6 +728,7 @@ fi
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])

View File

@ -4,6 +4,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv \
-I$(builddir) -I$(builddir)
noinst_LIBRARIES = libbitcoin_server.a libbitcoin_common.a libbitcoin_cli.a noinst_LIBRARIES = libbitcoin_server.a libbitcoin_common.a libbitcoin_cli.a
if ENABLE_WALLET
noinst_LIBRARIES += libbitcoin_wallet.a
endif
bin_PROGRAMS = bitcoind bitcoin-cli bin_PROGRAMS = bitcoind bitcoin-cli
@ -33,14 +36,37 @@ obj/build.h: FORCE
$(abs_top_srcdir) $(abs_top_srcdir)
version.o: obj/build.h version.o: obj/build.h
libbitcoin_server_a_SOURCES = addrman.cpp alert.cpp \ libbitcoin_server_a_SOURCES = \
addrman.cpp \
alert.cpp \
crypter.cpp \
rpcserver.cpp \ rpcserver.cpp \
bloom.cpp \ bloom.cpp \
chainparams.cpp checkpoints.cpp coins.cpp crypter.cpp db.cpp \ chainparams.cpp \
init.cpp keystore.cpp leveldbwrapper.cpp main.cpp miner.cpp \ checkpoints.cpp \
net.cpp noui.cpp rpcblockchain.cpp rpcdump.cpp \ coins.cpp \
rpcmining.cpp rpcnet.cpp rpcrawtransaction.cpp rpcwallet.cpp \ init.cpp \
txdb.cpp txmempool.cpp wallet.cpp walletdb.cpp $(JSON_H) \ keystore.cpp \
leveldbwrapper.cpp \
main.cpp \
net.cpp \
noui.cpp \
rpcblockchain.cpp \
rpcnet.cpp \
rpcrawtransaction.cpp \
txdb.cpp \
txmempool.cpp \
$(JSON_H) \
$(BITCOIN_CORE_H)
libbitcoin_wallet_a_SOURCES = \
db.cpp \
miner.cpp \
rpcdump.cpp \
rpcmining.cpp \
rpcwallet.cpp \
wallet.cpp \
walletdb.cpp \
$(BITCOIN_CORE_H) $(BITCOIN_CORE_H)
libbitcoin_common_a_SOURCES = \ libbitcoin_common_a_SOURCES = \
@ -68,6 +94,9 @@ nodist_libbitcoin_common_a_SOURCES = $(top_srcdir)/src/obj/build.h
# bitcoind binary # # bitcoind binary #
bitcoind_LDADD = libbitcoin_server.a libbitcoin_cli.a libbitcoin_common.a leveldb/libleveldb.a leveldb/libmemenv.a \ bitcoind_LDADD = libbitcoin_server.a libbitcoin_cli.a libbitcoin_common.a leveldb/libleveldb.a leveldb/libmemenv.a \
$(BOOST_LIBS) $(BOOST_LIBS)
if ENABLE_WALLET
bitcoind_LDADD += libbitcoin_wallet.a
endif
bitcoind_SOURCES = bitcoind.cpp bitcoind_SOURCES = bitcoind.cpp
# #

View File

@ -6,6 +6,7 @@ AM_CPPFLAGS = $(INCLUDES) \
AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS)
LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a
LIBBITCOIN_WALLET=$(top_builddir)/src/libbitcoin_wallet.a
LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a
LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a
LIBLEVELDB=$(top_builddir)/src/leveldb/libleveldb.a LIBLEVELDB=$(top_builddir)/src/leveldb/libleveldb.a

View File

@ -197,7 +197,7 @@ endif
bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \
-I$(top_srcdir)/src/qt/forms -I$(top_srcdir)/src/qt/forms
bitcoin_qt_SOURCES = bitcoin.cpp bitcoin_qt_SOURCES = bitcoin.cpp
bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)
# forms/foo.h -> forms/ui_foo.h # forms/foo.h -> forms/ui_foo.h

View File

@ -17,7 +17,7 @@ BUILT_SOURCES = $(TEST_QT_MOC_CPP)
test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES)
test_bitcoin_qt_SOURCES = test_main.cpp uritests.cpp paymentservertests.cpp $(TEST_QT_H) test_bitcoin_qt_SOURCES = test_main.cpp uritests.cpp paymentservertests.cpp $(TEST_QT_H)
nodist_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) nodist_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)
test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \
$(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)

View File

@ -21,16 +21,25 @@ BUILT_SOURCES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
# test_bitcoin binary # # test_bitcoin binary #
test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS)
test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(BDB_LIBS) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
test_bitcoin_SOURCES = accounting_tests.cpp alert_tests.cpp \ if ENABLE_WALLET
test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
endif
test_bitcoin_LDADD += $(BDB_LIBS)
test_bitcoin_SOURCES = alert_tests.cpp \
allocator_tests.cpp base32_tests.cpp base58_tests.cpp base64_tests.cpp \ allocator_tests.cpp base32_tests.cpp base58_tests.cpp base64_tests.cpp \
bignum_tests.cpp bloom_tests.cpp canonical_tests.cpp checkblock_tests.cpp \ bignum_tests.cpp bloom_tests.cpp canonical_tests.cpp checkblock_tests.cpp \
Checkpoints_tests.cpp compress_tests.cpp DoS_tests.cpp getarg_tests.cpp \ Checkpoints_tests.cpp compress_tests.cpp DoS_tests.cpp getarg_tests.cpp \
key_tests.cpp miner_tests.cpp mruset_tests.cpp multisig_tests.cpp \ key_tests.cpp mruset_tests.cpp multisig_tests.cpp \
netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp script_P2SH_tests.cpp \ netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp script_P2SH_tests.cpp \
script_tests.cpp serialize_tests.cpp sigopcount_tests.cpp test_bitcoin.cpp \ script_tests.cpp serialize_tests.cpp sigopcount_tests.cpp test_bitcoin.cpp \
transaction_tests.cpp uint160_tests.cpp uint256_tests.cpp util_tests.cpp \ transaction_tests.cpp uint160_tests.cpp uint256_tests.cpp util_tests.cpp \
wallet_tests.cpp sighash_tests.cpp $(JSON_TEST_FILES) $(RAW_TEST_FILES) sighash_tests.cpp $(JSON_TEST_FILES) $(RAW_TEST_FILES)
if ENABLE_WALLET
test_bitcoin_SOURCES += accounting_tests.cpp wallet_tests.cpp miner_tests.cpp
endif
nodist_test_bitcoin_SOURCES = $(BUILT_SOURCES) nodist_test_bitcoin_SOURCES = $(BUILT_SOURCES)