Skip to content

Commit 710284c

Browse files
committed
Fixed bug #76153 Intl compilation fails with icu4c 61.1
Additionally, ICU >= 59.1 requires C++11, so add the flags. Some refactoring is needed to comply with the latest recommended build options, such as automatic icu namespace addition.
1 parent ac4d9fd commit 710284c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

acinclude.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,9 @@ AC_DEFUN([PHP_SETUP_ICU],[
22482248
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
22492249
PHP_EVAL_INCLINE($ICU_INCS)
22502250
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
2251+
2252+
ICU_EXTRA_FLAGS=`$ICU_CONFIG --cxxflags`
2253+
ICU_EXTRA_FLAGS="$ICU_EXTRA_FLAGS -DU_USING_ICU_NAMESPACE=1"
22512254
fi
22522255
])
22532256

ext/intl/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if test "$PHP_INTL" != "no"; then
8686
breakiterator/codepointiterator_methods.cpp \
8787
uchar/uchar.c \
8888
idn/idn.c \
89-
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
89+
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $ICU_EXTRA_FLAGS,cxx)
9090
PHP_ADD_BUILD_DIR($ext_builddir/collator)
9191
PHP_ADD_BUILD_DIR($ext_builddir/converter)
9292
PHP_ADD_BUILD_DIR($ext_builddir/common)

ext/intl/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if (PHP_INTL != "no") {
130130
ADD_FLAG("LIBS_INTL", "iculx.lib");
131131
}
132132

133-
ADD_FLAG("CFLAGS_INTL", "/EHsc");
133+
ADD_FLAG("CFLAGS_INTL", "/EHsc /D U_USING_ICU_NAMESPACE=1");
134134
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
135135
} else {
136136
WARNING("intl not enabled; libraries and/or headers not found");

0 commit comments

Comments
 (0)