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_attr.c \ 13 collator_class.c \ 14 collator_compare.c \ 15 collator_convert.c \ 16 collator_create.c \ 17 collator_error.c \ 18 collator_is_numeric.c \ 19 collator_locale.c \ 20 collator_sort.c \ 21 ", "intl"); 22 ADD_SOURCES(configure_module_dirname + "/common", "\ 23 common_error.c \ 24 common_enum.cpp \ 25 common_date.cpp \ 26 ", "intl"); 27 ADD_SOURCES(configure_module_dirname + "/converter", "\ 28 converter.c \ 29 ", "intl"); 30 ADD_SOURCES(configure_module_dirname + "/formatter", "\ 31 formatter_attr.c \ 32 formatter_class.c \ 33 formatter_data.c \ 34 formatter_format.c \ 35 formatter_main.c \ 36 formatter_parse.c \ 37 ", "intl"); 38 ADD_SOURCES(configure_module_dirname + "/locale", "\ 39 locale.c \ 40 locale_class.c \ 41 locale_methods.c \ 42 ", "intl"); 43 ADD_SOURCES(configure_module_dirname + "/msgformat", "\ 44 msgformat.c \ 45 msgformat_attr.c \ 46 msgformat_class.c \ 47 msgformat_data.c \ 48 msgformat_format.c \ 49 msgformat_helpers.cpp \ 50 msgformat_parse.c \ 51 ", "intl"); 52 ADD_SOURCES(configure_module_dirname + "/grapheme", "\ 53 grapheme_string.c grapheme_util.c \ 54 ", "intl"); 55 ADD_SOURCES(configure_module_dirname + "/normalizer", "\ 56 normalizer_class.c \ 57 normalizer_normalize.c \ 58 ", "intl"); 59 ADD_SOURCES(configure_module_dirname + "/dateformat", "\ 60 dateformat.c \ 61 dateformat_class.c \ 62 dateformat_attr.c \ 63 dateformat_format.c \ 64 dateformat_format_object.cpp \ 65 dateformat_parse.c \ 66 dateformat_data.c \ 67 dateformat_attrcpp.cpp \ 68 dateformat_helpers.cpp \ 69 dateformat_create.cpp \ 70 datepatterngenerator_class.cpp \ 71 datepatterngenerator_methods.cpp \ 72 ", "intl"); 73 ADD_SOURCES(configure_module_dirname + "/uchar", "\ 74 uchar.c", 75 "intl"); 76 ADD_SOURCES(configure_module_dirname + "/idn", "\ 77 idn.c", 78 "intl"); 79 ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\ 80 resourcebundle.c \ 81 resourcebundle_class.c \ 82 resourcebundle_iterator.c", 83 "intl"); 84 85 if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) { 86 ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\ 87 spoofchecker_class.c \ 88 spoofchecker_create.c \ 89 spoofchecker_main.c", 90 "intl"); 91 } 92 93 ADD_SOURCES(configure_module_dirname + "/transliterator", "\ 94 transliterator_class.c \ 95 transliterator_methods.c", 96 "intl"); 97 98 ADD_SOURCES(configure_module_dirname + "/timezone", "\ 99 timezone_class.cpp \ 100 timezone_methods.cpp", 101 "intl"); 102 103 ADD_SOURCES(configure_module_dirname + "/calendar", "\ 104 calendar_methods.cpp \ 105 gregoriancalendar_methods.cpp \ 106 calendar_class.cpp", 107 "intl"); 108 109 ADD_SOURCES(configure_module_dirname + "/breakiterator", "\ 110 breakiterator_class.cpp \ 111 breakiterator_methods.cpp \ 112 breakiterator_iterators.cpp \ 113 rulebasedbreakiterator_methods.cpp \ 114 codepointiterator_internal.cpp \ 115 codepointiterator_methods.cpp ", 116 "intl"); 117 118 ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib"); 119 120 /* 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 128 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"); 129 AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled"); 130 } else { 131 WARNING("intl not enabled; libraries and/or headers not found"); 132 } 133} 134