xref: /PHP-7.0/ext/intl/config.w32 (revision 0f9a4af9)
1// $Id$
2// vim:ft=javascript
3
4ARG_ENABLE("intl", "Enable internationalization support", "no");
5
6if (PHP_INTL != "no") {
7	if (CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
8					CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
9		// always build as shared - zend_strtod.c/ICU type conflict
10		EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
11								"/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
12		ADD_SOURCES(configure_module_dirname + "/collator", "\
13				collator.c \
14				collator_attr.c \
15				collator_class.c \
16				collator_compare.c \
17				collator_convert.c \
18				collator_create.c \
19				collator_error.c \
20				collator_is_numeric.c \
21				collator_locale.c \
22				collator_sort.c \
23				", "intl");
24		ADD_SOURCES(configure_module_dirname + "/common", "\
25				common_error.c \
26				common_enum.cpp \
27				common_date.cpp \
28				", "intl");
29		ADD_SOURCES(configure_module_dirname + "/converter", "\
30				converter.c \
31				", "intl");
32		ADD_SOURCES(configure_module_dirname + "/formatter", "\
33				formatter.c \
34				formatter_attr.c \
35				formatter_class.c \
36				formatter_data.c \
37				formatter_format.c \
38				formatter_main.c \
39				formatter_parse.c \
40				", "intl");
41		ADD_SOURCES(configure_module_dirname + "/locale", "\
42				locale.c \
43				locale_class.c \
44				locale_methods.c \
45				", "intl");
46		ADD_SOURCES(configure_module_dirname + "/msgformat", "\
47				msgformat.c \
48				msgformat_attr.c \
49				msgformat_class.c \
50				msgformat_data.c \
51				msgformat_format.c \
52				msgformat_helpers.cpp \
53				msgformat_parse.c \
54				", "intl");
55		ADD_SOURCES(configure_module_dirname + "/grapheme", "\
56                                grapheme_string.c grapheme_util.c  \
57                                ", "intl");
58		ADD_SOURCES(configure_module_dirname + "/normalizer", "\
59				normalizer.c \
60				normalizer_class.c \
61				normalizer_normalize.c \
62				", "intl");
63		ADD_SOURCES(configure_module_dirname + "/dateformat", "\
64				dateformat.c \
65				dateformat_class.c \
66				dateformat_attr.c \
67				dateformat_format.c \
68				dateformat_format_object.cpp \
69				dateformat_parse.c \
70				dateformat_data.c \
71				dateformat_attrcpp.cpp \
72				dateformat_helpers.cpp \
73				dateformat_create.cpp \
74				", "intl");
75		ADD_SOURCES(configure_module_dirname + "/uchar", "\
76				uchar.c",
77				"intl");
78		ADD_SOURCES(configure_module_dirname + "/idn", "\
79				idn.c",
80				"intl");
81		ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\
82				resourcebundle.c \
83				resourcebundle_class.c \
84				resourcebundle_iterator.c",
85				"intl");
86
87		if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) {
88			ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\
89					spoofchecker.c \
90					spoofchecker_class.c \
91					spoofchecker_create.c \
92					spoofchecker_main.c",
93					"intl");
94					AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
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");
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