aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorChen Minqiang <ptpt52@gmail.com>2023-01-25 07:55:12 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2023-02-03 12:18:19 +0100
commitfcde517d35c8591cbb578b1a7a49a0446b1ac646 (patch)
treed33b68e0c7ca3e21337c3e298eb1536eb2bcc37e /package
parentd4c63c77866bf09668b541760b6c9f277b41ac87 (diff)
downloadupstream-fcde517d35c8591cbb578b1a7a49a0446b1ac646.tar.gz
upstream-fcde517d35c8591cbb578b1a7a49a0446b1ac646.tar.bz2
upstream-fcde517d35c8591cbb578b1a7a49a0446b1ac646.zip
wolfssl: fix build with make < 4.2
Inline the preinst.arm-ce script. Support for including was added in make 4.2 and is not working with older make versions. Fixes: https://github.com/openwrt/openwrt/issues/11866 Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/libs/wolfssl/Makefile31
-rw-r--r--package/libs/wolfssl/preinst.arm-ce25
2 files changed, 28 insertions, 28 deletions
diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 1500a2cda7..6ad44a9acf 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -151,6 +151,33 @@ CONFIGURE_ARGS += \
--$(if $(CONFIG_WOLFSSL_HAS_ECC448),enable,disable)-curve448 \
--$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn
+define Package/libwolfsslcpu-crypto/preinst-aarch64
+#!/bin/sh
+exec >&2
+printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
+if [ -n "$${IPKG_INSTROOT}" ]; then
+ printf "...[offline]... "
+ eval "$$(grep '^DISTRIB_TARGET=' "$${IPKG_INSTROOT}/etc/openwrt_release")"
+ echo "$${DISTRIB_TARGET}" | grep '^bcm27xx/.*' > /dev/null && {
+ echo "not supported"
+ echo "Error: Target $${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
+ echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
+ exit 1
+ }
+else
+ grep -q '^Features.*\baes\b' /proc/cpuinfo || {
+ echo "not supported"
+ echo "Error: Arm v8-A Cryptographic Extension not supported."
+ echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
+ echo "Contents of /proc/cpuinfo:"
+ cat /proc/cpuinfo
+ exit 1
+ }
+fi
+echo OK
+exit 0
+endef
+
ifeq ($(BUILD_VARIANT),regular)
CONFIGURE_ARGS += \
--$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \
@@ -160,9 +187,7 @@ CONFIGURE_ARGS += \
else ifdef CONFIG_aarch64
CONFIGURE_ARGS += --enable-armasm
TARGET_CFLAGS:=$(TARGET_CFLAGS:-mcpu%=-mcpu%+crypto)
- WOLFSSL_NOASM_REGEX:=^bcm27xx/.*
- Package/libwolfsslcpu-crypto/preinst=\
- $(subst @@WOLFSSL_NOASM_REGEX@@,$(WOLFSSL_NOASM_REGEX),$(file <preinst.arm-ce))
+ Package/libwolfsslcpu-crypto/preinst=$(Package/libwolfsslcpu-crypto/preinst-aarch64)
else ifdef CONFIG_TARGET_x86_64
CONFIGURE_ARGS += --enable-intelasm
endif
diff --git a/package/libs/wolfssl/preinst.arm-ce b/package/libs/wolfssl/preinst.arm-ce
deleted file mode 100644
index d6e2996269..0000000000
--- a/package/libs/wolfssl/preinst.arm-ce
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-exec >&2
-printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
-if [ -n "${IPKG_INSTROOT}" ]; then
- printf "...[offline]... "
- eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")"
- ### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile
- echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && {
- echo "not supported"
- echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
- echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
- exit 1
- }
-else
- grep -q '^Features.*\baes\b' /proc/cpuinfo || {
- echo "not supported"
- echo "Error: Arm v8-A Cryptographic Extension not supported."
- echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
- echo "Contents of /proc/cpuinfo:"
- cat /proc/cpuinfo
- exit 1
- }
-fi
-echo OK
-exit 0