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>
Tue, 12 Jan 2021 19:03:54 +0000 (20:03 +0100)
config9.m4

index 6a3c3e8de30163d1b75457961f0f1ede05f263bb..d653a7c72fa9101be03f92cfb6b48bf4147d474f 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