Clean up internal library dependencies so we can avoid building unused code#5542
Clean up internal library dependencies so we can avoid building unused code#5542laanwj merged 4 commits intobitcoin:masterfrom
Conversation
daa99ae to
c936da2
Compare
|
lightly tested ACK |
|
@theuni can you take a look here? |
|
Looking into this. |
|
Concept ACK, but I think this approach is overly-complicated. Since the binaries know their own deps, there should be no need to explicitly tell the convenience libs to build or not build. The current problem is that This should be the only change needed: diff --git a/src/Makefile.am b/src/Makefile.am
index d6ac6e1..81b16d1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,7 +37,7 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
# But to build the less dependent modules first, we manually select their order here:
-noinst_LIBRARIES = \
+EXTRA_LIBRARIES = \
crypto/libbitcoin_crypto.a \
libbitcoin_util.a \
libbitcoin_common.a \
@@ -46,7 +46,7 @@ noinst_LIBRARIES = \
libbitcoin_cli.a
if ENABLE_WALLET
BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
-noinst_LIBRARIES += libbitcoin_wallet.a
+EXTRA_LIBRARIES += libbitcoin_wallet.a
endif
if BUILD_BITCOIN_LIBS
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 1192b7b..cdd8f8d 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -1,5 +1,5 @@
bin_PROGRAMS += qt/bitcoin-qt
-noinst_LIBRARIES += qt/libbitcoinqt.a
+EXTRA_LIBRARIES += qt/libbitcoinqt.a
# bitcoin qt core #
QT_TS = \
With this change, building with This is significantly easier to maintain, since we don't have to keep up with the tangled web of convenience lib dependencies. |
a08cf67 to
44f1ff7
Compare
|
Rewrote based on @theuni 's version (nice!), but also fixed configure to tolerate missing boost for lib-only builds, and check for openssl/ec.h (missing on Gentoo if OpenSSL is built with "bindist" USE flag). |
e5bfbd0 to
3e477cd
Compare
configure.ac
Outdated
There was a problem hiding this comment.
BITCOIN_QT_CONFIGURE needs to be run before we know about bitcoin_enable_qt.
|
Looks good to me. |
d36beee to
6526c44
Compare
|
Added another bugfix and retested here (incl boost-less and ec-less systems). I think this is finally done. |
|
Thanks for this! ut ACK if travis is happy. |
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr) b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr) a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr) fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr) b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr) a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr) fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
Without this, we unnecessarily compile libbitcoin_server for utils-only configurations.