Skip to content

Commit b68286c

Browse files
cmb69charmitro
authored andcommitted
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 phpGH-17010.
1 parent 4d904d2 commit b68286c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

ext/intl/config.w32

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
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,
1013
"/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
11-
ADD_EXTENSION_DEP('intl', 'date');
1214
ADD_SOURCES(configure_module_dirname + "/collator", "\
1315
collator_attr.c \
1416
collator_class.c \
@@ -116,17 +118,11 @@ if (PHP_INTL != "no") {
116118
codepointiterator_methods.cpp ",
117119
"intl");
118120

119-
ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib");
120-
121121
/* Compat for ICU before 58.1.*/
122-
if (CHECK_LIB("icule.lib", "intl", PHP_INTL)) {
123-
ADD_FLAG("LIBS_INTL", "icule.lib");
124-
}
125-
if (CHECK_LIB("iculx.lib", "intl", PHP_INTL)) {
126-
ADD_FLAG("LIBS_INTL", "iculx.lib");
127-
}
128-
129-
ADD_FLAG("CFLAGS_INTL", "/std:c++17 /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");
122+
CHECK_LIB("icule.lib", "intl", PHP_INTL);
123+
CHECK_LIB("iculx.lib", "intl", PHP_INTL);
124+
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");
125+
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
130126
} else {
131127
WARNING("intl not enabled; libraries and/or headers not found");
132128
}

0 commit comments

Comments
 (0)