mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03:00
05d1525b6d
Libtool will yell at you if you try to link a shared library against static ones. This change creates a libtool archive library for crc32c and allows a shared library to be linked against it portably. Also specify -static in both: - ..._la_CXXFLAGS so that libtool will avoid building two versions of each object (one PIC, one non-PIC). We just need the one that is suitable for static linking. - ..._la_LDFLAGS so that libtool will create a static library. [META] This change is done in preparation for a future commit where we link the libbitcoinkernel library against this one.
81 lines
3 KiB
Text
81 lines
3 KiB
Text
# Copyright (c) 2019 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
LIBCRC32C_INT = crc32c/libcrc32c.la
|
|
|
|
noinst_LTLIBRARIES += $(LIBCRC32C_INT)
|
|
|
|
LIBCRC32C = $(LIBCRC32C_INT)
|
|
|
|
CRC32C_CPPFLAGS_INT =
|
|
CRC32C_CPPFLAGS_INT += -I$(srcdir)/crc32c/include
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_BUILTIN_PREFETCH=@HAVE_BUILTIN_PREFETCH@
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_MM_PREFETCH=@HAVE_MM_PREFETCH@
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_STRONG_GETAUXVAL=@HAVE_STRONG_GETAUXVAL@
|
|
CRC32C_CPPFLAGS_INT += -DCRC32C_TESTS_BUILT_WITH_GLOG=0
|
|
|
|
if ENABLE_SSE42
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=0
|
|
endif
|
|
|
|
if ENABLE_ARM_CRC
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=0
|
|
endif
|
|
|
|
if WORDS_BIGENDIAN
|
|
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=1
|
|
else
|
|
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0
|
|
endif
|
|
|
|
crc32c_libcrc32c_la_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS)
|
|
|
|
# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a
|
|
# static version of this library. We don't need a dynamic version, and a dynamic
|
|
# version can't be used on windows anyway because the library doesn't currently
|
|
# export DLL symbols.
|
|
crc32c_libcrc32c_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static
|
|
crc32c_libcrc32c_la_LDFLAGS = $(AM_LDFLAGS) -static
|
|
|
|
crc32c_libcrc32c_la_SOURCES =
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/include/crc32c/crc32c.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64_check.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_internal.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_prefetch.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_read_le.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_round_up.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42_check.h
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42.h
|
|
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c.cc
|
|
crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_portable.cc
|
|
|
|
if ENABLE_SSE42
|
|
LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.la
|
|
noinst_LTLIBRARIES += $(LIBCRC32C_SSE42_INT)
|
|
LIBCRC32C += $(LIBCRC32C_SSE42_INT)
|
|
|
|
crc32c_libcrc32c_sse42_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS)
|
|
crc32c_libcrc32c_sse42_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(SSE42_CXXFLAGS)
|
|
crc32c_libcrc32c_sse42_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS)
|
|
|
|
crc32c_libcrc32c_sse42_la_SOURCES = crc32c/src/crc32c_sse42.cc
|
|
endif
|
|
|
|
if ENABLE_ARM_CRC
|
|
LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.la
|
|
noinst_LTLIBRARIES += $(LIBCRC32C_ARM_CRC_INT)
|
|
LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT)
|
|
|
|
crc32c_libcrc32c_arm_crc_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS)
|
|
crc32c_libcrc32c_arm_crc_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(ARM_CRC_CXXFLAGS)
|
|
crc32c_libcrc32c_arm_crc_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS)
|
|
|
|
crc32c_libcrc32c_arm_crc_la_SOURCES = crc32c/src/crc32c_arm64.cc
|
|
endif
|