php8: fixup libiconv usage (refs openwrt/openwrt#10024)
authorMichael Heimpold <redacted>
Thu, 7 Jul 2022 20:37:22 +0000 (22:37 +0200)
committerMichael Heimpold <redacted>
Sun, 17 Jul 2022 12:11:39 +0000 (14:11 +0200)
Since the OpenWrt's stub libiconv implementation is now gone,
we can build against musl's internal one or the external libiconv
implementation.
This needs minor adjustements in the makefile to allow PHPs build
to choose the right path when cross-compiling.

Signed-off-by: Michael Heimpold <redacted>
lang/php8/Makefile

index ebe56e0378fad3f587b5a46eba61060134305f8c..e1aee1ba160447da2c5117592fe8e38455e88c2a 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
 PKG_VERSION:=8.1.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 PKG_LICENSE:=PHP-3.01
@@ -270,7 +270,13 @@ else
 endif
 
 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-iconv),)
-  CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+  ifeq ($(CONFIG_BUILD_NLS),y)
+    CONFIGURE_VARS+= iconv_impl_name="gnu_libiconv"
+    CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+  else
+    CONFIGURE_VARS+= ac_cv_func_iconv=yes
+    CONFIGURE_ARGS+= --with-iconv=shared
+  endif
 else
   CONFIGURE_ARGS+= --without-iconv
 endif
@@ -485,7 +491,6 @@ endif
 CONFIGURE_VARS+= \
        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
        php_cv_cc_rpath="no" \
-       iconv_impl_name="gnu_libiconv" \
        ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
        ac_cv_u8t_decompose=yes \
        ac_cv_have_pcre2_jit=no
git clone https://git.99rst.org/PROJECT