fix build with libicu-dev not providing icu-config
authorMichael Wallner <mike@php.net>
Tue, 12 Jan 2021 19:03:54 +0000 (20:03 +0100)
committerMichael Wallner <mike@php.net>
Wed, 13 Jan 2021 09:42:36 +0000 (10:42 +0100)
config9.m4

index 897b92ff94ef016e551a45fe8dabe1e2ec283500..4f6d589f6078697267caa69d58c12dd651dbcfb4 100644 (file)
@@ -87,7 +87,11 @@ if test "$PHP_HTTP" != "no"; then
        if test "$PHP_HTTP_LIBICU_DIR" != "no"; then
                AC_PATH_PROG(ICU_CONFIG, icu-config, false, [$PHP_HTTP_LIBICU_DIR/bin:$PATH:/usr/local/bin])
 
-               PECL_CHECK_CONFIG(libicu, [$ICU_CONFIG], [--version], [--cppflags], [--ldflags-searchpath], [--ldflags-libsonly])
+               if $ICU_CONFIG --exists >/dev/null 2>/dev/null; then
+                       PECL_CHECK_CONFIG(libicu, [$ICU_CONFIG], [--version], [--cppflags], [--ldflags-searchpath], [--ldflags-libsonly])
+               else
+                       PECL_CHECK_PKGCONFIG(icu-i18n, [$PHP_HTTP_LIBICU_DIR])
+               fi
                AC_CACHE_CHECK([for uidna_IDNToASCII], PECL_CACHE_VAR([HAVE_UIDNA_IDNToASCII]), [
                        if printf "%s" "$CFLAGS" | $EGREP -q "(^|\s)-Werror\b"; then
                                if ! printf "%s" "$CFLAGS" | $EGREP -q "(^|\s)-Wno-error=deprecated-declarations\b"; then