xref: /PHP-7.4/ext/mbstring/config.w32 (revision 737c1b49)
1// vim:ft=javascript
2
3ARG_ENABLE("mbstring", "multibyte string functions", "no");
4ARG_ENABLE("mbregex", "multibyte regex support", "no");
5
6if (PHP_MBSTRING != "no") {
7
8	if (CHECK_HEADER_ADD_INCLUDE("mbstring.h", "CFLAGS_MBSTRING", PHP_MBSTRING + ";" + PHP_PHP_BUILD + "\\include")) {
9		EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED);
10
11		STDOUT.WriteLine("Using bundled libmbfl...");
12
13		ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
14			/D HAVE_CONFIG_H \
15			/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
16
17		FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
18			"ext\\mbstring\\libmbfl\\config.h", true);
19
20		ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
21			mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
22			mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
23			mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_cp51932.c \
24			mbfilter_euc_cn.c mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
25			mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
26			mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
27			mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c \
28			mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \
29			mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \
30			mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \
31			mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c mbfilter_sjis_2004.c \
32			mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
33			mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
34			mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \
35			mbfilter_koi8u.c mbfilter_cp1254.c mbfilter_euc_jp_2004.c \
36			mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \
37			mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c \
38			mbfilter_sjis_mac.c \
39			mbfilter_iso2022jp_2004.c  mbfilter_iso2022jp_mobile.c \
40			mbfilter_tl_jisx0201_jisx0208.c", "mbstring");
41
42		ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
43			mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
44			mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
45			mbfl_string.c mbfl_allocators.c", "mbstring");
46
47		ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
48			nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
49			nls_ua.c nls_tr.c", "mbstring");
50
51		PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
52
53		AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
54
55		if (PHP_MBREGEX != "no") {
56			if (CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_MBSTRING", PHP_MBREGEX) &&
57				CHECK_LIB("onig_a.lib;libonig_a.lib", "mbstring", PHP_MBSTRING)) {
58				AC_DEFINE('HAVE_MBREGEX', 1);
59
60				/* XXX libonig is only usable as a static library ATM, code change required to link with a DLL. */
61				ADD_FLAG("CFLAGS_MBSTRING", "/DONIG_EXTERN=extern /DPHP_ONIG_BAD_KOI8_ENTRY=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
62
63				ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
64				PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h php_onig_compat.h");
65			} else {
66				WARNING("mbregex not enabled; libraries and headers not found");
67			}
68		}
69
70	} else {
71		WARNING("mbstring not enabled; libraries and headers not found");
72	}
73}
74