xref: /PHP-8.3/ext/mbstring/config.w32 (revision c717c79a)
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 -Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
14			/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
15
16		FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
17			"ext\\mbstring\\libmbfl\\config.h", true);
18
19		ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
20			mbfilter_7bit.c mbfilter_base64.c \
21			mbfilter_cjk.c mbfilter_htmlent.c \
22			mbfilter_qprint.c mbfilter_ucs2.c \
23			mbfilter_ucs4.c mbfilter_utf16.c mbfilter_utf32.c \
24			mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c \
25			mbfilter_utf8_mobile.c mbfilter_uuencode.c \
26			mbfilter_singlebyte.c", "mbstring");
27
28		ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
29			mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
30			mbfl_filter_output.c mbfl_language.c mbfl_memory_device.c \
31			mbfl_string.c", "mbstring");
32
33		ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
34			nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
35			nls_ua.c nls_tr.c", "mbstring");
36
37		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_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_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
38
39		AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
40
41		if (PHP_MBREGEX != "no") {
42			if (CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_MBSTRING", PHP_MBREGEX) &&
43				CHECK_LIB("onig_a.lib;libonig_a.lib", "mbstring", PHP_MBSTRING)) {
44				AC_DEFINE('HAVE_MBREGEX', 1);
45
46				/* XXX libonig is only usable as a static library ATM, code change required to link with a DLL. */
47				ADD_FLAG("CFLAGS_MBSTRING", "/DONIG_EXTERN=extern /DPHP_ONIG_BAD_KOI8_ENTRY=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
48
49				ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
50				PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h php_onig_compat.h");
51			} else {
52				WARNING("mbregex not enabled; libraries and headers not found");
53			}
54		}
55
56	} else {
57		WARNING("mbstring not enabled; libraries and headers not found");
58	}
59}
60