Skip to content

Commit 0a36b9a

Browse files
theunisipa
authored andcommitted
crypter: shuffle Makefile so that crypto can be used by the wallet
Wallet must come before crypto, otherwise linking fails on some platforms. Includes a tangentially-related general cleanup rather than making the Makefile sloppier.
1 parent 976f9ec commit 0a36b9a

File tree

1 file changed

+23
-32
lines changed

1 file changed

+23
-32
lines changed

src/Makefile.am

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ LIBUNIVALUE = $(UNIVALUE_LIBS)
1515
endif
1616

1717
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
18-
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
18+
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
1919

2020
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
2121
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
2222

2323
LIBBITCOIN_SERVER=libbitcoin_server.a
24-
LIBBITCOIN_WALLET=libbitcoin_wallet.a
2524
LIBBITCOIN_COMMON=libbitcoin_common.a
2625
LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
2726
LIBBITCOIN_CLI=libbitcoin_cli.a
@@ -30,32 +29,32 @@ LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
3029
LIBBITCOINQT=qt/libbitcoinqt.a
3130
LIBSECP256K1=secp256k1/libsecp256k1.la
3231

32+
if ENABLE_ZMQ
33+
LIBBITCOIN_ZMQ=libbitcoin_zmq.a
34+
endif
35+
if BUILD_BITCOIN_LIBS
36+
LIBBITCOINCONSENSUS=libbitcoinconsensus.la
37+
endif
38+
if ENABLE_WALLET
39+
LIBBITCOIN_WALLET=libbitcoin_wallet.a
40+
endif
41+
3342
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
3443
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
3544

3645
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
3746
# But to build the less dependent modules first, we manually select their order here:
3847
EXTRA_LIBRARIES += \
39-
crypto/libbitcoin_crypto.a \
40-
libbitcoin_util.a \
41-
libbitcoin_common.a \
42-
libbitcoin_consensus.a \
43-
libbitcoin_server.a \
44-
libbitcoin_cli.a
45-
if ENABLE_WALLET
46-
BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
47-
EXTRA_LIBRARIES += libbitcoin_wallet.a
48-
endif
49-
if ENABLE_ZMQ
50-
EXTRA_LIBRARIES += libbitcoin_zmq.a
51-
endif
48+
$(LIBBITCOIN_CRYPTO) \
49+
$(LIBBITCOIN_UTIL) \
50+
$(LIBBITCOIN_COMMON) \
51+
$(LIBBITCOIN_CONSENSUS) \
52+
$(LIBBITCOIN_SERVER) \
53+
$(LIBBITCOIN_CLI) \
54+
$(LIBBITCOIN_WALLET) \
55+
$(LIBBITCOIN_ZMQ)
5256

53-
if BUILD_BITCOIN_LIBS
54-
lib_LTLIBRARIES = libbitcoinconsensus.la
55-
LIBBITCOINCONSENSUS=libbitcoinconsensus.la
56-
else
57-
LIBBITCOINCONSENSUS=
58-
endif
57+
lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)
5958

6059
bin_PROGRAMS =
6160
TESTS =
@@ -196,8 +195,6 @@ libbitcoin_server_a_SOURCES = \
196195
$(BITCOIN_CORE_H)
197196

198197
if ENABLE_ZMQ
199-
LIBBITCOIN_ZMQ=libbitcoin_zmq.a
200-
201198
libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
202199
libbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
203200
libbitcoin_zmq_a_SOURCES = \
@@ -347,21 +344,15 @@ bitcoind_LDADD = \
347344
$(LIBBITCOIN_COMMON) \
348345
$(LIBUNIVALUE) \
349346
$(LIBBITCOIN_UTIL) \
347+
$(LIBBITCOIN_WALLET) \
348+
$(LIBBITCOIN_ZMQ) \
350349
$(LIBBITCOIN_CONSENSUS) \
351350
$(LIBBITCOIN_CRYPTO) \
352351
$(LIBLEVELDB) \
353352
$(LIBMEMENV) \
354353
$(LIBSECP256K1)
355354

356-
if ENABLE_ZMQ
357-
bitcoind_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
358-
endif
359-
360-
if ENABLE_WALLET
361-
bitcoind_LDADD += libbitcoin_wallet.a
362-
endif
363-
364-
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
355+
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS)
365356

366357
# bitcoin-cli binary #
367358
bitcoin_cli_SOURCES = bitcoin-cli.cpp

0 commit comments

Comments
 (0)