com php-src: Merge branch 'PHP-7.2' into PHP-7.3: acinclude.m4

From: Date: Thu, 07 Feb 2019 11:12:42 +0000
Subject: com php-src: Merge branch 'PHP-7.2' into PHP-7.3: acinclude.m4
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-104462@lists.php.net to get a copy of this message
Commit: 8be649d908bef9d1ec7e45eb6ffaa19b77c03317 Author: Derick Rethans <github@derickrethans.nl> Thu, 7 Feb 2019 11:12:42 +0000 Parents: b2907527e92088c172879bc8d462fb2b5628b8ba e2edaa0ceeb4dad61b8d38312c18cb73b160e13e Branches: PHP-7.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8be649d908bef9d1ec7e45eb6ffaa19b77c03317 Log: Merge branch 'PHP-7.2' into PHP-7.3 Changed paths: MM acinclude.m4 Diff: diff --cc acinclude.m4 index c2ae195,6249cb9..266c2cf --- a/acinclude.m4 +++ b/acinclude.m4 @@@ -2173,50 -2201,78 +2173,84 @@@ AC_DEFUN([PHP_SETUP_ICU], PHP_ICU_DIR=DEFAULT fi - if test "$PHP_ICU_DIR" = "DEFAULT"; then - dnl Try to find icu-config - AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin]) - else - ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config" + AC_MSG_CHECKING([for location of ICU headers and libraries]) + found_icu=no + + dnl First try to find pkg-config + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi - AC_MSG_CHECKING([for location of ICU headers and libraries]) + dnl If pkg-config is found try using it + if test "$PHP_ICU_DIR" = "DEFAULT" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists icu-uc icu-io icu-i18n; then + if $PKG_CONFIG --atleast-version=40 icu-uc; then + found_icu=yes + icu_version_full=$PKG_CONFIG --modversion icu-uc + ac_IFS=$IFS + IFS="." + set $icu_version_full + IFS=$ac_IFS + icu_version=expr [$]1 \* 1000 + [$]2 + AC_MSG_RESULT([found $icu_version_full]) + + ICU_LIBS=$PKG_CONFIG --libs icu-uc icu-io icu-i18n + ICU_INCS=$PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n + ICU_CXXFLAGS="-DU_USING_ICU_NAMESPACE=1" + + AC_MSG_RESULT([found $ICU_VERSION]) + + PHP_EVAL_LIBLINE($ICU_LIBS, $1) + PHP_EVAL_INCLINE($ICU_INCS) + else + AC_MSG_ERROR([ICU version 4.0 or later required.]) + fi + fi - dnl Trust icu-config to know better what the install prefix is.. - icu_install_prefix=$ICU_CONFIG --prefix 2> /dev/null - if test "$?" != "0" || test -z "$icu_install_prefix"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.]) - else - AC_MSG_RESULT([$icu_install_prefix]) - - dnl Check ICU version - AC_MSG_CHECKING([for ICU 4.0 or greater]) - icu_version_full=$ICU_CONFIG --version - ac_IFS=$IFS - IFS="." - set $icu_version_full - IFS=$ac_IFS - icu_version=expr [$]1 \* 1000 + [$]2 - AC_MSG_RESULT([found $icu_version_full]) - - if test "$icu_version" -lt "4000"; then - AC_MSG_ERROR([ICU version 4.0 or later is required]) + dnl If pkg-config fails for some reason, revert to the old method + if test "$found_icu" = "no"; then + if test "$PHP_ICU_DIR" = "DEFAULT"; then + dnl Try to find icu-config + AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin]) + else + ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config" fi - ICU_VERSION=$icu_version - ICU_INCS=$ICU_CONFIG --cppflags-searchpath - ICU_LIBS=$ICU_CONFIG --ldflags --ldflags-icuio - PHP_EVAL_INCLINE($ICU_INCS) - PHP_EVAL_LIBLINE($ICU_LIBS, $1) + dnl Trust icu-config to know better what the install prefix is.. + icu_install_prefix=$ICU_CONFIG --prefix 2> /dev/null + if test "$?" != "0" || test -z "$icu_install_prefix"; then + AC_MSG_RESULT([not found]) + AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.]) + else + AC_MSG_RESULT([$icu_install_prefix]) + + dnl Check ICU version + AC_MSG_CHECKING([for ICU 4.0 or greater]) + icu_version_full=$ICU_CONFIG --version + ac_IFS=$IFS + IFS="." + set $icu_version_full + IFS=$ac_IFS + icu_version=expr [$]1 \* 1000 + [$]2 + AC_MSG_RESULT([found $icu_version_full]) + + if test "$icu_version" -lt "4000"; then + AC_MSG_ERROR([ICU version 4.0 or later is required]) + fi - ICU_CXXFLAGS=$ICU_CONFIG --cxxflags - if test "$icu_version" -ge "49000"; then - ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit" - ICU_CFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" - fi - if test "$icu_version" -ge "60000"; then - ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" + ICU_VERSION=$icu_version + ICU_INCS=$ICU_CONFIG --cppflags-searchpath + ICU_LIBS=$ICU_CONFIG --ldflags --ldflags-icuio + PHP_EVAL_INCLINE($ICU_INCS) + PHP_EVAL_LIBLINE($ICU_LIBS, $1) + + ICU_CXXFLAGS=$ICU_CONFIG --cxxflags - ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1" ++ if test "$icu_version" -ge "49000"; then ++ ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit" ++ ICU_CFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" ++ fi ++ if test "$icu_version" -ge "60000"; then ++ ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" ++ fi fi fi ])

« previous php.cvs (#104462) next »