kumquat-buildroot/package/cryptopp/cryptopp.mk
Fabrice Fontaine 81945bde7c package/cryptopp: disable neon if needed
Fix the following build failure raised since commit
bf4cf9de83:

In file included from aria_simd.cpp:18:0:
/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/lib/gcc/arm-none-linux-gnueabi/4.8.3/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
 #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
  ^

Fixes:
 - http://autobuild.buildroot.org/results/e4fd947c118174a4fad62cbed18816f02d39ec25

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-11 21:59:27 +01:00

75 lines
2.1 KiB
Makefile

################################################################################
#
# cryptopp
#
################################################################################
CRYPTOPP_VERSION = 8.6.0
CRYPTOPP_SOURCE = cryptopp$(subst .,,$(CRYPTOPP_VERSION)).zip
CRYPTOPP_SITE = https://cryptopp.com
CRYPTOPP_LICENSE = BSL-1.0, BSD-3-Clause (CRYPTOGAMS), Public domain (ChaCha SSE2 and AVX)
CRYPTOPP_LICENSE_FILES = License.txt
CRYPTOPP_CPE_ID_VENDOR = cryptopp
CRYPTOPP_CPE_ID_PRODUCT = crypto\+\+
CRYPTOPP_INSTALL_STAGING = YES
define HOST_CRYPTOPP_EXTRACT_CMDS
$(UNZIP) $(HOST_CRYPTOPP_DL_DIR)/$(CRYPTOPP_SOURCE) -d $(@D)
endef
HOST_CRYPTOPP_CXXFLAGS = $(HOST_CFLAGS) -fPIC
# _mm256_broadcastsi128_si256 has been added only in gcc 4.9
ifneq ($(BR2_HOST_GCC_AT_LEAST_4_9),y)
HOST_CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX2
endif
HOST_CRYPTOPP_MAKE_OPTS = \
$(HOST_CONFIGURE_OPTS) \
CXXFLAGS="$(HOST_CRYPTOPP_CXXFLAGS)"
define HOST_CRYPTOPP_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CRYPTOPP_MAKE_OPTS) shared
endef
define HOST_CRYPTOPP_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install-lib
endef
define CRYPTOPP_EXTRACT_CMDS
$(UNZIP) $(CRYPTOPP_DL_DIR)/$(CRYPTOPP_SOURCE) -d $(@D)
endef
CRYPTOPP_CXXFLAGS = $(TARGET_CXXFLAGS) -fPIC
# _mm256_broadcastsi128_si256 has been added only in gcc 4.9
ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_9),y)
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX2
endif
ifneq ($(BR2_ARM_CPU_HAS_NEON),y)
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_ARM_NEON
endif
CRYPTOPP_MAKE_OPTS = \
$(TARGET_CONFIGURE_OPTS) \
CXXFLAGS="$(CRYPTOPP_CXXFLAGS)"
define CRYPTOPP_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(CRYPTOPP_MAKE_OPTS) \
PREFIX=/usr shared libcryptopp.pc
endef
define CRYPTOPP_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(TARGET_DIR) \
LDCONFIG=/bin/true install-lib
endef
define CRYPTOPP_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=/usr DESTDIR=$(STAGING_DIR) \
LDCONFIG=/bin/true install-lib
endef
$(eval $(generic-package))
$(eval $(host-generic-package))