xref: /php-src/ext/opcache/config.w32 (revision be275433)
1ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
2
3
4if (PHP_OPCACHE != "no") {
5
6	ARG_ENABLE("opcache-jit", "whether to enable JIT", "yes");
7
8	ZEND_EXTENSION('opcache', "\
9		ZendAccelerator.c \
10		zend_accelerator_blacklist.c \
11		zend_accelerator_debug.c \
12		zend_accelerator_hash.c \
13		zend_accelerator_module.c \
14		zend_accelerator_util_funcs.c \
15		zend_persist.c \
16		zend_persist_calc.c \
17		zend_file_cache.c \
18		zend_shared_alloc.c \
19		shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
20
21	if (PHP_OPCACHE_JIT == "yes") {
22		if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
23			var dasm_flags = (X64 ? "-D X64=1" : "") + (X64 ? " -D X64WIN=1" : "") + " -D WIN=1";
24			var ir_target = (X64 ? "IR_TARGET_X64" : "IR_TARGET_X86");
25			var ir_src = "ir_strtab.c ir_cfg.c ir_sccp.c ir_gcm.c ir_ra.c ir_save.c \
26				 ir_dump.c ir_check.c ir_patch.c";
27
28			DEFINE("IR_TARGET", ir_target);
29			DEFINE("DASM_FLAGS", dasm_flags);
30			DEFINE("DASM_ARCH", "x86");
31
32			AC_DEFINE('HAVE_JIT', 1, 'Define to enable JIT');
33			AC_DEFINE('ZEND_JIT_IR', 1, 'Use JIT IR framework');
34
35			ADD_FLAG("CFLAGS_OPCACHE", "/I \"ext\\opcache\\jit\\ir\" /D "+ir_target+" /D IR_PHP");
36			if (PHP_DEBUG == "yes") {
37				ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG");
38			}
39
40			if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") &&
41				CHECK_LIB("capstone.lib", "opcache", PHP_OPCACHE)) {
42				AC_DEFINE('HAVE_CAPSTONE', 1, 'capstone support enabled');
43				ir_src += " ir_disasm.c";
44			}
45
46			ADD_MAKEFILE_FRAGMENT(configure_module_dirname + "\\jit\\Makefile.frag.w32");
47
48			ADD_SOURCES(configure_module_dirname + "\\jit",
49				"zend_jit.c zend_jit_vm_helpers.c",
50				"opcache", "ext\\opcache\\jit");
51			ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
52				"ir.c", "opcache", "ext\\opcache\\jit\\ir");
53			ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
54				"ir_emit.c", "opcache", "ext\\opcache\\jit\\ir");
55			ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
56				ir_src, "opcache", "ext\\opcache\\jit\\ir");
57		} else {
58			WARNING("JIT not enabled, headers not found");
59		}
60	}
61
62	ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
63
64}
65
66