aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2013-09-16 01:22:50 -0400
committerCory Fields <cory-nospam-@coryfields.com>2013-09-16 01:59:03 -0400
commitcae63be6c95b19c236a2333c1f2456e016e13f0f (patch)
tree07be650bbbd9d7ac03e5f89d706f9aff523ee847 /src/Makefile.am
parent2975db76b3c6ce5f70d7dc547e74c61543191b22 (diff)
autotools: fix a parallel build race condition spotted by the pull-tester
libleveldb.a and libmemenv.a should be able to build in parallel, but in practice calling the leveldb makefile ends up rewriting build_config.mk. If one target tries to build while the other is halfway through writing the .mk, the make ends up in an undefined state. Fix that by making one depend on the other. This also reorders the variables to be passed by param rather than via the environment, and combines the targets into a single rule to avoid needless duplication.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 65e675e525..2935c2daa9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,13 +50,12 @@ bitcoind_SOURCES = bitcoind.cpp
AM_CPPFLAGS += $(BDB_CPPFLAGS)
bitcoind_LDADD += $(BDB_LIBS)
-leveldb/libleveldb.a:
- @echo "Building LevelDB ..." && cd leveldb && CXX="$(CXX)" CC="$(CC)" \
- PLATFORM=$(TARGET_OS) AR="$(AR)" $(MAKE) $(LEVELDB_TARGET_FLAGS) OPT="$(CXXFLAGS) $(CPPFLAGS)" libleveldb.a
+leveldb/libleveldb.a: leveldb/libmemenv.a
-leveldb/libmemenv.a:
- @echo "Building LevelDB ..." && cd leveldb && CXX="$(CXX)" CC="$(CC)" \
- PLATFORM=$(TARGET_OS) AR="$(AR)" $(MAKE) $(LEVELDB_TARGET_FLAGS) OPT="$(CXXFLAGS) $(CPPFLAGS)" libmemenv.a
+leveldb/%.a:
+ @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
+ CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
+ OPT="$(CXXFLAGS) $(CPPFLAGS)"
qt/bitcoinstrings.cpp: $(libbitcoin_a_SOURCES)
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"