@@ -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 ) \
@@ -268,9 +274,9 @@ libbitcoin_wallet_a_SOURCES = \
268
274
$(BITCOIN_CORE_H )
269
275
270
276
# crypto primitives library
271
- crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS )
272
- crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
273
- crypto_libbitcoin_crypto_a_SOURCES = \
277
+ crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS )
278
+ crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
279
+ crypto_libbitcoin_crypto_base_a_SOURCES = \
274
280
crypto/aes.cpp \
275
281
crypto/aes.h \
276
282
crypto/chacha20.h \
@@ -290,23 +296,19 @@ crypto_libbitcoin_crypto_a_SOURCES = \
290
296
crypto/sha512.h
291
297
292
298
if USE_ASM
293
- crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
299
+ crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
294
300
endif
295
301
296
302
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
297
303
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS )
298
- if ENABLE_SSE41
299
304
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS )
300
305
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
301
- endif
302
306
crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
303
307
304
308
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
305
309
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS )
306
- if ENABLE_AVX2
307
310
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS )
308
311
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
309
- endif
310
312
crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
311
313
312
314
# consensus: shared between all executables that validate any consensus rules.
@@ -431,8 +433,6 @@ bitcoind_LDADD = \
431
433
$(LIBBITCOIN_ZMQ ) \
432
434
$(LIBBITCOIN_CONSENSUS ) \
433
435
$(LIBBITCOIN_CRYPTO ) \
434
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
435
- $(LIBBITCOIN_CRYPTO_AVX2 ) \
436
436
$(LIBLEVELDB ) \
437
437
$(LIBLEVELDB_SSE42 ) \
438
438
$(LIBMEMENV ) \
@@ -454,9 +454,7 @@ bitcoin_cli_LDADD = \
454
454
$(LIBBITCOIN_CLI ) \
455
455
$(LIBUNIVALUE ) \
456
456
$(LIBBITCOIN_UTIL ) \
457
- $(LIBBITCOIN_CRYPTO ) \
458
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
459
- $(LIBBITCOIN_CRYPTO_AVX2 )
457
+ $(LIBBITCOIN_CRYPTO )
460
458
461
459
bitcoin_cli_LDADD += $(BOOST_LIBS ) $(SSL_LIBS ) $(CRYPTO_LIBS ) $(EVENT_LIBS )
462
460
#
@@ -477,8 +475,6 @@ bitcoin_tx_LDADD = \
477
475
$(LIBBITCOIN_UTIL ) \
478
476
$(LIBBITCOIN_CONSENSUS ) \
479
477
$(LIBBITCOIN_CRYPTO ) \
480
- $(LIBBITCOIN_CRYPTO_SSE41 ) \
481
- $(LIBBITCOIN_CRYPTO_AVX2 ) \
482
478
$(LIBSECP256K1 )
483
479
484
480
bitcoin_tx_LDADD += $(BOOST_LIBS ) $(CRYPTO_LIBS )
@@ -487,7 +483,7 @@ bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
487
483
# bitcoinconsensus library #
488
484
if BUILD_BITCOIN_LIBS
489
485
include_HEADERS = script/bitcoinconsensus.h
490
- libbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_a_SOURCES ) $(libbitcoin_consensus_a_SOURCES )
486
+ libbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_base_a_SOURCES ) $(libbitcoin_consensus_a_SOURCES )
491
487
492
488
if GLIBC_BACK_COMPAT
493
489
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
0 commit comments