xref: /PHP-8.1/ext/intl/config.w32 (revision ae9f6e7a)
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_SOURCES(configure_module_dirname + "/collator", "\
12				collator.c \
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.c \
33				formatter_attr.c \
34				formatter_class.c \
35				formatter_data.c \
36				formatter_format.c \
37				formatter_main.c \
38				formatter_parse.c \
39				", "intl");
40		ADD_SOURCES(configure_module_dirname + "/locale", "\
41				locale.c \
42				locale_class.c \
43				locale_methods.c \
44				", "intl");
45		ADD_SOURCES(configure_module_dirname + "/msgformat", "\
46				msgformat.c \
47				msgformat_attr.c \
48				msgformat_class.c \
49				msgformat_data.c \
50				msgformat_format.c \
51				msgformat_helpers.cpp \
52				msgformat_parse.c \
53				", "intl");
54		ADD_SOURCES(configure_module_dirname + "/grapheme", "\
55                                grapheme_string.c grapheme_util.c  \
56                                ", "intl");
57		ADD_SOURCES(configure_module_dirname + "/normalizer", "\
58				normalizer.c \
59				normalizer_class.c \
60				normalizer_normalize.c \
61				", "intl");
62		ADD_SOURCES(configure_module_dirname + "/dateformat", "\
63				dateformat.c \
64				dateformat_class.c \
65				dateformat_attr.c \
66				dateformat_format.c \
67				dateformat_format_object.cpp \
68				dateformat_parse.c \
69				dateformat_data.c \
70				dateformat_attrcpp.cpp \
71				dateformat_helpers.cpp \
72				dateformat_create.cpp \
73				datepatterngenerator_class.cpp \
74				datepatterngenerator_methods.cpp \
75				", "intl");
76		ADD_SOURCES(configure_module_dirname + "/uchar", "\
77				uchar.c",
78				"intl");
79		ADD_SOURCES(configure_module_dirname + "/idn", "\
80				idn.c",
81				"intl");
82		ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\
83				resourcebundle.c \
84				resourcebundle_class.c \
85				resourcebundle_iterator.c",
86				"intl");
87
88		if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) {
89			ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\
90					spoofchecker.c \
91					spoofchecker_class.c \
92					spoofchecker_create.c \
93					spoofchecker_main.c",
94					"intl");
95		}
96
97		ADD_SOURCES(configure_module_dirname + "/transliterator", "\
98				transliterator.c \
99				transliterator_class.c \
100				transliterator_methods.c",
101				"intl");
102
103		ADD_SOURCES(configure_module_dirname + "/timezone", "\
104				timezone_class.cpp \
105				timezone_methods.cpp",
106				"intl");
107
108		ADD_SOURCES(configure_module_dirname + "/calendar", "\
109				calendar_methods.cpp \
110				gregoriancalendar_methods.cpp \
111				calendar_class.cpp",
112				"intl");
113
114		ADD_SOURCES(configure_module_dirname + "/breakiterator", "\
115				breakiterator_class.cpp \
116				breakiterator_methods.cpp \
117				breakiterator_iterators.cpp \
118				rulebasedbreakiterator_methods.cpp \
119				codepointiterator_internal.cpp \
120				codepointiterator_methods.cpp ",
121				"intl");
122
123		ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib");
124
125		/* Compat for ICU before 58.1.*/
126		if (CHECK_LIB("icule.lib", "intl", PHP_INTL)) {
127			ADD_FLAG("LIBS_INTL", "icule.lib");
128		}
129		if (CHECK_LIB("iculx.lib", "intl", PHP_INTL)) {
130			ADD_FLAG("LIBS_INTL", "iculx.lib");
131		}
132
133		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");
134		AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
135	} else {
136		WARNING("intl not enabled; libraries and/or headers not found");
137	}
138}
139