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