Skip to content

Commit 4a290b5

Browse files
committed
Cleanup LevelDB library dependencies
1 parent 9b4e03b commit 4a290b5

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,14 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
328328
[ AC_MSG_RESULT(no)]
329329
)
330330

331+
LEVELDB_CPPFLAGS=
332+
LIBLEVELDB=
333+
LIBMEMENV=
334+
AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
335+
AC_SUBST(LEVELDB_CPPFLAGS)
336+
AC_SUBST(LIBLEVELDB)
337+
AC_SUBST(LIBMEMENV)
338+
331339
if test x$enable_wallet != xno; then
332340
dnl Check for libdb_cxx only if wallet enabled
333341
BITCOIN_FIND_BDB48

src/Makefile.am

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
include Makefile.include
22

3-
AM_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv \
4-
-I$(builddir)
3+
AM_CPPFLAGS += -I$(builddir)
54

65
noinst_LIBRARIES = \
76
libbitcoin_server.a \
@@ -140,8 +139,8 @@ bitcoind_LDADD = \
140139
libbitcoin_server.a \
141140
libbitcoin_cli.a \
142141
libbitcoin_common.a \
143-
leveldb/libleveldb.a \
144-
leveldb/libmemenv.a
142+
$(LIBLEVELDB) \
143+
$(LIBMEMENV)
145144
if ENABLE_WALLET
146145
bitcoind_LDADD += libbitcoin_wallet.a
147146
endif
@@ -167,6 +166,7 @@ if TARGET_WINDOWS
167166
bitcoin_cli_SOURCES += bitcoin-cli-res.rc
168167
endif
169168

169+
# 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
170170
leveldb/libleveldb.a: leveldb/libmemenv.a
171171

172172
leveldb/%.a:

src/Makefile.include

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1+
if EMBEDDED_LEVELDB
2+
LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include
3+
LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv
4+
LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a
5+
LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a
6+
endif
7+
18
AM_CPPFLAGS = $(INCLUDES) \
29
-I$(top_builddir)/src/obj \
3-
-I$(top_srcdir)/src/leveldb/include \
410
$(BDB_CPPFLAGS) \
511
$(BOOST_INCLUDES)
12+
AM_CPPFLAGS += $(LEVELDB_CPPFLAGS)
613
AM_LDFLAGS = $(PTHREAD_CFLAGS)
714

815
LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a
916
LIBBITCOIN_WALLET=$(top_builddir)/src/libbitcoin_wallet.a
1017
LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a
1118
LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a
12-
LIBLEVELDB=$(top_builddir)/src/leveldb/libleveldb.a
13-
LIBMEMENV=$(top_builddir)/src/leveldb/libmemenv.a
1419
LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a
1520

1621
$(LIBBITCOIN):
1722
$(MAKE) -C $(top_builddir)/src $(@F)
1823

24+
if EMBEDDED_LEVELDB
1925
$(LIBLEVELDB) $(LIBMEMENV):
2026
$(MAKE) -C $(top_builddir)/src leveldb/$(@F)
27+
endif
2128

2229
$(LIBBITCOINQT):
2330
$(MAKE) -C $(top_builddir)/src/qt $(@F)

0 commit comments

Comments
 (0)