xref: /php-src/ext/intl/config.w32 (revision 0f8259e8)
1// vim:ft=javascript
2
3ARG_ENABLE("intl", "Enable internationalization support", "no");
4
5if (PHP_INTL != "no") {
6	if (CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
7					CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
8		// always build as shared - zend_strtod.c/ICU type conflict
9		EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
10								"/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
11		ADD_EXTENSION_DEP('intl', 'date');
12		ADD_SOURCES(configure_module_dirname + "/collator", "\
13				collator_attr.c \
14				collator_class.c \
15				collator_compare.c \
16				collator_convert.c \
17				collator_create.c \
18				collator_error.c \
19				collator_is_numeric.c \
20				collator_locale.c \
21				collator_sort.c \
22				", "intl");
23		ADD_SOURCES(configure_module_dirname + "/common", "\
24				common_error.c \
25				common_enum.cpp \
26				common_date.cpp \
27				", "intl");
28		ADD_SOURCES(configure_module_dirname + "/converter", "\
29				converter.c \
30				", "intl");
31		ADD_SOURCES(configure_module_dirname + "/formatter", "\
32				formatter_attr.c \
33				formatter_class.c \
34				formatter_data.c \
35				formatter_format.c \
36				formatter_main.c \
37				formatter_parse.c \
38				", "intl");
39		ADD_SOURCES(configure_module_dirname + "/locale", "\
40				locale.c \
41				locale_class.c \
42				locale_methods.c \
43				", "intl");
44		ADD_SOURCES(configure_module_dirname + "/msgformat", "\
45				msgformat.c \
46				msgformat_attr.c \
47				msgformat_class.c \
48				msgformat_data.c \
49				msgformat_format.c \
50				msgformat_helpers.cpp \
51				msgformat_parse.c \
52				", "intl");
53		ADD_SOURCES(configure_module_dirname + "/grapheme", "\
54                                grapheme_string.c grapheme_util.c  \
55                                ", "intl");
56		ADD_SOURCES(configure_module_dirname + "/normalizer", "\
57				normalizer_class.c \
58				normalizer_normalize.c \
59				", "intl");
60		ADD_SOURCES(configure_module_dirname + "/dateformat", "\
61				dateformat.c \
62				dateformat_class.c \
63				dateformat_attr.c \
64				dateformat_format.c \
65				dateformat_format_object.cpp \
66				dateformat_parse.c \
67				dateformat_data.c \
68				dateformat_attrcpp.cpp \
69				dateformat_helpers.cpp \
70				dateformat_create.cpp \
71				datepatterngenerator_class.cpp \
72				datepatterngenerator_methods.cpp \
73				", "intl");
74		ADD_SOURCES(configure_module_dirname + "/uchar", "\
75				uchar.c",
76				"intl");
77		ADD_SOURCES(configure_module_dirname + "/idn", "\
78				idn.c",
79				"intl");
80		ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\
81				resourcebundle.c \
82				resourcebundle_class.c \
83				resourcebundle_iterator.c",
84				"intl");
85
86		if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) {
87			ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\
88					spoofchecker_class.c \
89					spoofchecker_create.c \
90					spoofchecker_main.c",
91					"intl");
92		}
93
94		ADD_SOURCES(configure_module_dirname + "/transliterator", "\
95				transliterator_class.c \
96				transliterator_methods.c",
97				"intl");
98
99		ADD_SOURCES(configure_module_dirname + "/timezone", "\
100				timezone_class.cpp \
101				timezone_methods.cpp",
102				"intl");
103
104		ADD_SOURCES(configure_module_dirname + "/calendar", "\
105				calendar_methods.cpp \
106				gregoriancalendar_methods.cpp \
107				calendar_class.cpp",
108				"intl");
109
110		ADD_SOURCES(configure_module_dirname + "/breakiterator", "\
111				breakiterator_class.cpp \
112				breakiterator_methods.cpp \
113				breakiterator_iterators.cpp \
114				rulebasedbreakiterator_methods.cpp \
115				codepointiterator_internal.cpp \
116				codepointiterator_methods.cpp ",
117				"intl");
118
119		ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib");
120
121		/* 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");
130	} else {
131		WARNING("intl not enabled; libraries and/or headers not found");
132	}
133}
134