aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-02-04 17:43:10 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-02-04 17:43:19 +0100
commit152a8216cc7b170eed26ee4c3a65dbe592e55f05 (patch)
treee996b24909e3448d86a77c39057972186b9d16ff /src
parentd2228384de3a870803697a6cc95467b97e9a37a5 (diff)
parent42407ed43ad24ac1016eb457a7b0e720e63188cd (diff)
Merge #7349: Build against system UniValue when available
42407ed build-unix: Update UniValue build conditions (Luke Dashjr) cdcad9f LDADD dependency order shuffling (Luke Dashjr) 62f7f2e Bugfix: Always include univalue in DIST_SUBDIRS (Luke Dashjr) 2356515 Change default configure option --with-system-univalue to "no" (Luke Dashjr) 5d3b29b doc: Add UniValue to build instructions (Luke Dashjr) ab22705 Build against system UniValue when available (Luke Dashjr) 2adf7e2 Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE (Luke Dashjr)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am15
-rw-r--r--src/Makefile.bench.include4
-rw-r--r--src/Makefile.test.include2
3 files changed, 14 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b6578cf48..c4f7188971 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,6 +4,15 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS)
AM_CXXFLAGS = $(HARDENED_CXXFLAGS)
AM_CPPFLAGS = $(HARDENED_CPPFLAGS)
+if EMBEDDED_UNIVALUE
+LIBUNIVALUE = univalue/libunivalue.la
+
+$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+else
+LIBUNIVALUE = $(UNIVALUE_LIBS)
+endif
+
if EMBEDDED_LEVELDB
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
@@ -23,7 +32,7 @@ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
-BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
+BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_WALLET=libbitcoin_wallet.a
@@ -34,13 +43,9 @@ LIBBITCOIN_UTIL=libbitcoin_util.a
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
LIBBITCOINQT=qt/libbitcoinqt.a
LIBSECP256K1=secp256k1/libsecp256k1.la
-LIBUNIVALUE=univalue/libunivalue.la
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
-$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)
- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
# 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:
diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include
index d3cecb6b43..8e7b59b461 100644
--- a/src/Makefile.bench.include
+++ b/src/Makefile.bench.include
@@ -14,13 +14,13 @@ bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bench_bench_bitcoin_LDADD = \
$(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_COMMON) \
- $(LIBBITCOIN_UNIVALUE) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBLEVELDB) \
$(LIBMEMENV) \
- $(LIBSECP256K1)
+ $(LIBSECP256K1) \
+ $(LIBUNIVALUE)
if ENABLE_ZMQ
bench_bench_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index b22b8b8b96..468d3043a7 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -129,7 +129,9 @@ check-local:
@echo "Running test/bitcoin-util-test.py..."
$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
+if EMBEDDED_UNIVALUE
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
+endif
%.json.h: %.json
@$(MKDIR_P) $(@D)