Skip to content

Commit 1800cad

Browse files
committed
Properly check for required icu4c libraries
Besides that just checking for icuuc.lib does not necessarily imply that the other libraries are available, doing it this way will not copy the PDBs to the build folder, so these are not available in the debug packages. Furthermore, `CHECK_LIB` already adds the library to the flags, so there is no need to do this manually. Closes GH-17010.
1 parent 3167c7b commit 1800cad

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

ext/intl/config.w32

+6-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
ARG_ENABLE("intl", "Enable internationalization support", "no");
44

55
if (PHP_INTL != "no") {
6-
if (CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
6+
if (CHECK_LIB("icudt.lib", "intl", PHP_INTL) &&
7+
CHECK_LIB("icuin.lib", "intl", PHP_INTL) &&
8+
CHECK_LIB("icuio.lib", "intl", PHP_INTL) &&
9+
CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
710
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
811
// always build as shared - zend_strtod.c/ICU type conflict
912
EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
@@ -115,16 +118,9 @@ if (PHP_INTL != "no") {
115118
codepointiterator_methods.cpp ",
116119
"intl");
117120

118-
ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib");
119-
120121
/* Compat for ICU before 58.1.*/
121-
if (CHECK_LIB("icule.lib", "intl", PHP_INTL)) {
122-
ADD_FLAG("LIBS_INTL", "icule.lib");
123-
}
124-
if (CHECK_LIB("iculx.lib", "intl", PHP_INTL)) {
125-
ADD_FLAG("LIBS_INTL", "iculx.lib");
126-
}
127-
122+
CHECK_LIB("icule.lib", "intl", PHP_INTL);
123+
CHECK_LIB("iculx.lib", "intl", PHP_INTL);
128124
ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit /DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 /DU_HIDE_OBSOLETE_UTF_OLD_H=1");
129125
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
130126
} else {

0 commit comments

Comments
 (0)