Cleanup LevelDB library dependencies

This commit is contained in:
Luke Dashjr 2013-11-12 20:09:55 +00:00
parent 9b4e03b27b
commit 4a290b526c
3 changed files with 22 additions and 7 deletions

View File

@ -328,6 +328,14 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
[ AC_MSG_RESULT(no)] [ AC_MSG_RESULT(no)]
) )
LEVELDB_CPPFLAGS=
LIBLEVELDB=
LIBMEMENV=
AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
AC_SUBST(LEVELDB_CPPFLAGS)
AC_SUBST(LIBLEVELDB)
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_BDB48 BITCOIN_FIND_BDB48

View File

@ -1,7 +1,6 @@
include Makefile.include include Makefile.include
AM_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv \ AM_CPPFLAGS += -I$(builddir)
-I$(builddir)
noinst_LIBRARIES = \ noinst_LIBRARIES = \
libbitcoin_server.a \ libbitcoin_server.a \
@ -140,8 +139,8 @@ bitcoind_LDADD = \
libbitcoin_server.a \ libbitcoin_server.a \
libbitcoin_cli.a \ libbitcoin_cli.a \
libbitcoin_common.a \ libbitcoin_common.a \
leveldb/libleveldb.a \ $(LIBLEVELDB) \
leveldb/libmemenv.a $(LIBMEMENV)
if ENABLE_WALLET if ENABLE_WALLET
bitcoind_LDADD += libbitcoin_wallet.a bitcoind_LDADD += libbitcoin_wallet.a
endif endif
@ -167,6 +166,7 @@ if TARGET_WINDOWS
bitcoin_cli_SOURCES += bitcoin-cli-res.rc bitcoin_cli_SOURCES += bitcoin-cli-res.rc
endif endif
# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race
leveldb/libleveldb.a: leveldb/libmemenv.a leveldb/libleveldb.a: leveldb/libmemenv.a
leveldb/%.a: leveldb/%.a:

View File

@ -1,23 +1,30 @@
if EMBEDDED_LEVELDB
LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include
LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv
LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a
LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a
endif
AM_CPPFLAGS = $(INCLUDES) \ AM_CPPFLAGS = $(INCLUDES) \
-I$(top_builddir)/src/obj \ -I$(top_builddir)/src/obj \
-I$(top_srcdir)/src/leveldb/include \
$(BDB_CPPFLAGS) \ $(BDB_CPPFLAGS) \
$(BOOST_INCLUDES) $(BOOST_INCLUDES)
AM_CPPFLAGS += $(LEVELDB_CPPFLAGS)
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_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
LIBMEMENV=$(top_builddir)/src/leveldb/libmemenv.a
LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a
$(LIBBITCOIN): $(LIBBITCOIN):
$(MAKE) -C $(top_builddir)/src $(@F) $(MAKE) -C $(top_builddir)/src $(@F)
if EMBEDDED_LEVELDB
$(LIBLEVELDB) $(LIBMEMENV): $(LIBLEVELDB) $(LIBMEMENV):
$(MAKE) -C $(top_builddir)/src leveldb/$(@F) $(MAKE) -C $(top_builddir)/src leveldb/$(@F)
endif
$(LIBBITCOINQT): $(LIBBITCOINQT):
$(MAKE) -C $(top_builddir)/src/qt $(@F) $(MAKE) -C $(top_builddir)/src/qt $(@F)