@@ -29,9 +29,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a
2929LIBBITCOIN_CONSENSUS =libbitcoin_consensus.a
3030LIBBITCOIN_CLI =libbitcoin_cli.a
3131LIBBITCOIN_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
3533LIBBITCOINQT =qt/libbitcoinqt.a
3634LIBSECP256K1 =secp256k1/libsecp256k1.la
3735
@@ -45,15 +43,23 @@ if ENABLE_WALLET
4543LIBBITCOIN_WALLET =libbitcoin_wallet.a
4644endif
4745
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+
4856$(LIBSECP256K1 ) : $(wildcard secp256k1/src/* ) $(wildcard secp256k1/include/* )
4957 $(AM_V_at )$(MAKE ) $(AM_MAKEFLAGS ) -C $(@D ) $(@F )
5058
5159# Make is not made aware of per-object dependencies to avoid limiting building parallelization
5260# But to build the less dependent modules first, we manually select their order here:
5361EXTRA_LIBRARIES += \
5462 $(LIBBITCOIN_CRYPTO ) \
55- $(LIBBITCOIN_CRYPTO_SSE41 ) \
56- $(LIBBITCOIN_CRYPTO_AVX2 ) \
5763 $(LIBBITCOIN_UTIL ) \
5864 $(LIBBITCOIN_COMMON ) \
5965 $(LIBBITCOIN_CONSENSUS ) \
@@ -268,9 +274,9 @@ libbitcoin_wallet_a_SOURCES = \
268274 $(BITCOIN_CORE_H )
269275
270276# 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 = \
274280 crypto/aes.cpp \
275281 crypto/aes.h \
276282 crypto/chacha20.h \
@@ -290,23 +296,19 @@ crypto_libbitcoin_crypto_a_SOURCES = \
290296 crypto/sha512.h
291297
292298if USE_ASM
293- crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
299+ crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
294300endif
295301
296302crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
297303crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS )
298- if ENABLE_SSE41
299304crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS )
300305crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
301- endif
302306crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
303307
304308crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $(AM_CXXFLAGS ) $(PIE_FLAGS )
305309crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS )
306- if ENABLE_AVX2
307310crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS )
308311crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
309- endif
310312crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
311313
312314# consensus: shared between all executables that validate any consensus rules.
@@ -431,8 +433,6 @@ bitcoind_LDADD = \
431433 $(LIBBITCOIN_ZMQ ) \
432434 $(LIBBITCOIN_CONSENSUS ) \
433435 $(LIBBITCOIN_CRYPTO ) \
434- $(LIBBITCOIN_CRYPTO_SSE41 ) \
435- $(LIBBITCOIN_CRYPTO_AVX2 ) \
436436 $(LIBLEVELDB ) \
437437 $(LIBLEVELDB_SSE42 ) \
438438 $(LIBMEMENV ) \
@@ -454,9 +454,7 @@ bitcoin_cli_LDADD = \
454454 $(LIBBITCOIN_CLI ) \
455455 $(LIBUNIVALUE ) \
456456 $(LIBBITCOIN_UTIL ) \
457- $(LIBBITCOIN_CRYPTO ) \
458- $(LIBBITCOIN_CRYPTO_SSE41 ) \
459- $(LIBBITCOIN_CRYPTO_AVX2 )
457+ $(LIBBITCOIN_CRYPTO )
460458
461459bitcoin_cli_LDADD += $(BOOST_LIBS ) $(SSL_LIBS ) $(CRYPTO_LIBS ) $(EVENT_LIBS )
462460#
@@ -477,8 +475,6 @@ bitcoin_tx_LDADD = \
477475 $(LIBBITCOIN_UTIL ) \
478476 $(LIBBITCOIN_CONSENSUS ) \
479477 $(LIBBITCOIN_CRYPTO ) \
480- $(LIBBITCOIN_CRYPTO_SSE41 ) \
481- $(LIBBITCOIN_CRYPTO_AVX2 ) \
482478 $(LIBSECP256K1 )
483479
484480bitcoin_tx_LDADD += $(BOOST_LIBS ) $(CRYPTO_LIBS )
@@ -487,7 +483,7 @@ bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
487483# bitcoinconsensus library #
488484if BUILD_BITCOIN_LIBS
489485include_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 )
491487
492488if GLIBC_BACK_COMPAT
493489 libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
0 commit comments