configure: libidn 1.36-1.38 has broken locale detection
authorMichael Wallner <mike@php.net>
Thu, 25 May 2023 09:57:14 +0000 (11:57 +0200)
committerMichael Wallner <mike@php.net>
Thu, 25 May 2023 11:04:10 +0000 (13:04 +0200)
autoconf/pecl/pecl.m4
config9.m4

index d8735b0326628c8baf76dc78bf2e9c99065d8eab..cb2bb70e17c110d47d34d9535a8691534534bab9 100644 (file)
@@ -271,7 +271,7 @@ AC_DEFUN([PECL_CHECK_CUSTOM], [
                LDFLAGS="$LDFLAGS -L$PECL_CACHE_VAR([$1_prefix])/$PHP_LIBDIR"
                LIBS="$LIBS -l$4"
                dnl PECL_EVAL_LIBLINE([$LDFLAGS $LIBS])
-               
+
                AC_CACHE_VAL(PECL_CACHE_VAR([$1_version]), [
                        pushd $PECL_CACHE_VAR([$1_prefix]) >/dev/null
                        PECL_CACHE_VAR([$1_version])=$5
@@ -281,7 +281,6 @@ AC_DEFUN([PECL_CHECK_CUSTOM], [
 
                if test -n "$PECL_CHECKED_VERSION([$1])"; then
                        PECL_VAR([HAVE_$1])=true
-                       PECL_DEFINE([HAVE_$1])
                        PECL_DEFINE_UQ($1[_VERSION], "$PECL_CHECKED_VERSION([$1])")
                else
                        PECL_VAR([HAVE_$1])=false
@@ -336,7 +335,6 @@ AC_DEFUN([PECL_CHECK_CONFIG], [
 
        if test -n "$PECL_CHECKED_VERSION([$1])"; then
                PECL_VAR([HAVE_$1])=true
-               PECL_DEFINE([HAVE_$1])
                PECL_DEFINE_UQ([$1_VERSION], "$PECL_CHECKED_VERSION([$1])")
        else
                PECL_VAR([HAVE_$1])=false
index 695701b6362ec620a970528b0d315ba3109d7fbf..35f1af159719e3ebb0a00496a783b091528f2fc4 100644 (file)
@@ -24,7 +24,7 @@ if test "$PHP_HTTP" != "no"; then
                AC_CHECK_LIB(nsl, getdomainname)
        ])
        AC_CHECK_FUNCS(mbrtowc mbtowc iswalnum inet_pton)
-       
+
        CFLAGS="$CFLAGS -Wno-strict-prototypes"
 
        dnl ZLIB
@@ -80,7 +80,16 @@ if test "$PHP_HTTP" != "no"; then
        if test "$PHP_HTTP_LIBIDN_DIR" != "no"; then
                PECL_CHECK_PKGCONFIG(libidn, [$PHP_HTTP_LIBIDN_DIR])
                if $PECL_VAR([HAVE_LIBIDN]); then
-                       PECL_DEFINE([HAVE_IDNA2003])
+                       PECL_HAVE_VERSION(libidn, 1.36, [
+                               PECL_HAVE_VERSION(libidn, 1.39, [
+                                       PECL_DEFINE([HAVE_IDNA2003])
+                               ], [
+                                       PECL_VAR([HAVE_LIBIDN])=false
+                                       AC_MSG_WARN([libidn locale detection broken; disabling libidn support])
+                               ])
+                       ], [
+                               PECL_DEFINE([HAVE_IDNA2003])
+                       ])
                fi
                PECL_CHECK_DONE(libidn, $PECL_VAR([HAVE_LIBIDN]))
        fi