@@ -29,9 +29,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a
29
29
LIBBITCOIN_CONSENSUS =libbitcoin_consensus.a
30
30
LIBBITCOIN_CLI =libbitcoin_cli.a
31
31
LIBBITCOIN_UTIL =libbitcoin_util.a
32
- LIBBITCOIN_CRYPTO =crypto/libbitcoin_crypto.a
33
- LIBBITCOIN_CRYPTO_SSE41 =crypto/libbitcoin_crypto_sse41.a
34
- LIBBITCOIN_CRYPTO_AVX2 =crypto/libbitcoin_crypto_avx2.a
32
+ LIBBITCOIN_CRYPTO_BASE =crypto/libbitcoin_crypto_base.a
35
33
LIBBITCOINQT =qt/libbitcoinqt.a
36
34
LIBSECP256K1 =secp256k1/libsecp256k1.la
37
35
@@ -45,15 +43,23 @@ if ENABLE_WALLET
45
43
LIBBITCOIN_WALLET =libbitcoin_wallet.a
46
44
endif
47
45
46
+ LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE )
47
+ if ENABLE_SSE41
48
+ LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.a
49
+ LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41 )
50
+ endif
51
+ if ENABLE_AVX2
52
+ LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.a
53
+ LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_AVX2 )
54
+ endif
55
+
48
56
$(LIBSECP256K1 ) : $(wildcard secp256k1/src/* ) $(wildcard secp256k1/include/* )
49
57
$(AM_V_at )$(MAKE ) $(AM_MAKEFLAGS ) -C $(@D ) $(@F )
50
58
51
59
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
52
60
# But to build the less dependent modules first, we manually select their order here:
53
61
EXTRA_LIBRARIES += \
54
62
$(LIBBITCOIN_CRYPTO ) \
55
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
56
- $(LIBBITCOIN_CRYPTO_AVX2 ) \
57
63
$(LIBBITCOIN_UTIL ) \
58
64
$(LIBBITCOIN_COMMON ) \
59
65
$(LIBBITCOIN_CONSENSUS ) \
@@ -270,9 +276,9 @@ libbitcoin_wallet_a_SOURCES = \
270
276
$(BITCOIN_CORE_H )
271
277
272
278
# crypto primitives library
273
- crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS )
274
- crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
275
- crypto_libbitcoin_crypto_a_SOURCES = \
279
+ crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS )
280
+ crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
281
+ crypto_libbitcoin_crypto_base_a_SOURCES = \
276
282
crypto/aes.cpp \
277
283
crypto/aes.h \
278
284
crypto/chacha20.h \
@@ -292,23 +298,19 @@ crypto_libbitcoin_crypto_a_SOURCES = \
292
298
crypto/sha512.h
293
299
294
300
if USE_ASM
295
- crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
301
+ crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
296
302
endif
297
303
298
304
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
299
305
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS )
300
- if ENABLE_SSE41
301
306
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS )
302
307
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
303
- endif
304
308
crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
305
309
306
310
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
307
311
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS )
308
- if ENABLE_AVX2
309
312
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS )
310
313
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
311
- endif
312
314
crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
313
315
314
316
# consensus: shared between all executables that validate any consensus rules.
@@ -433,8 +435,6 @@ bitcoind_LDADD = \
433
435
$(LIBBITCOIN_ZMQ ) \
434
436
$(LIBBITCOIN_CONSENSUS ) \
435
437
$(LIBBITCOIN_CRYPTO ) \
436
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
437
- $(LIBBITCOIN_CRYPTO_AVX2 ) \
438
438
$(LIBLEVELDB ) \
439
439
$(LIBLEVELDB_SSE42 ) \
440
440
$(LIBMEMENV ) \
@@ -456,9 +456,7 @@ bitcoin_cli_LDADD = \
456
456
$(LIBBITCOIN_CLI ) \
457
457
$(LIBUNIVALUE ) \
458
458
$(LIBBITCOIN_UTIL ) \
459
- $(LIBBITCOIN_CRYPTO ) \
460
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
461
- $(LIBBITCOIN_CRYPTO_AVX2 )
459
+ $(LIBBITCOIN_CRYPTO )
462
460
463
461
bitcoin_cli_LDADD += $(BOOST_LIBS ) $(SSL_LIBS ) $(CRYPTO_LIBS ) $(EVENT_LIBS )
464
462
#
@@ -479,8 +477,6 @@ bitcoin_tx_LDADD = \
479
477
$(LIBBITCOIN_UTIL ) \
480
478
$(LIBBITCOIN_CONSENSUS ) \
481
479
$(LIBBITCOIN_CRYPTO ) \
482
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
483
- $(LIBBITCOIN_CRYPTO_AVX2 ) \
484
480
$(LIBSECP256K1 )
485
481
486
482
bitcoin_tx_LDADD += $(BOOST_LIBS ) $(CRYPTO_LIBS )
@@ -489,7 +485,7 @@ bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
489
485
# bitcoinconsensus library #
490
486
if BUILD_BITCOIN_LIBS
491
487
include_HEADERS = script/bitcoinconsensus.h
492
- libbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_a_SOURCES ) $(libbitcoin_consensus_a_SOURCES )
488
+ libbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_base_a_SOURCES ) $(libbitcoin_consensus_a_SOURCES )
493
489
494
490
if GLIBC_BACK_COMPAT
495
491
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
0 commit comments