aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/Makefile.include13
2 files changed, 14 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 9917be2481..846de05d10 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,6 @@
include Makefile.include
-AM_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv \
- -I$(builddir)
+AM_CPPFLAGS += -I$(builddir)
noinst_LIBRARIES = \
libbitcoin_server.a \
@@ -140,8 +139,8 @@ bitcoind_LDADD = \
libbitcoin_server.a \
libbitcoin_cli.a \
libbitcoin_common.a \
- leveldb/libleveldb.a \
- leveldb/libmemenv.a
+ $(LIBLEVELDB) \
+ $(LIBMEMENV)
if ENABLE_WALLET
bitcoind_LDADD += libbitcoin_wallet.a
endif
@@ -167,6 +166,7 @@ if TARGET_WINDOWS
bitcoin_cli_SOURCES += bitcoin-cli-res.rc
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/%.a:
diff --git a/src/Makefile.include b/src/Makefile.include
index b9e6c262ca..dae7db7804 100644
--- a/src/Makefile.include
+++ b/src/Makefile.include
@@ -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) \
-I$(top_builddir)/src/obj \
- -I$(top_srcdir)/src/leveldb/include \
$(BDB_CPPFLAGS) \
$(BOOST_INCLUDES)
+AM_CPPFLAGS += $(LEVELDB_CPPFLAGS)
AM_LDFLAGS = $(PTHREAD_CFLAGS)
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_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
$(LIBBITCOIN):
$(MAKE) -C $(top_builddir)/src $(@F)
+if EMBEDDED_LEVELDB
$(LIBLEVELDB) $(LIBMEMENV):
$(MAKE) -C $(top_builddir)/src leveldb/$(@F)
+endif
$(LIBBITCOINQT):
$(MAKE) -C $(top_builddir)/src/qt $(@F)