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 ADD_EXTENSION_DEP('opcache', 'date'); 22 ADD_EXTENSION_DEP('opcache', 'hash'); 23 ADD_EXTENSION_DEP('opcache', 'pcre'); 24 25 if (PHP_OPCACHE_JIT == "yes") { 26 if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) { 27 var dasm_flags = (X64 ? "-D X64=1" : "") + (X64 ? " -D X64WIN=1" : "") + " -D WIN=1"; 28 var ir_target = (X64 ? "IR_TARGET_X64" : "IR_TARGET_X86"); 29 var ir_src = "ir_strtab.c ir_cfg.c ir_sccp.c ir_gcm.c ir_ra.c ir_save.c \ 30 ir_dump.c ir_check.c ir_patch.c"; 31 32 DEFINE("IR_TARGET", ir_target); 33 DEFINE("DASM_FLAGS", dasm_flags); 34 DEFINE("DASM_ARCH", "x86"); 35 36 AC_DEFINE('HAVE_JIT', 1, 'Define to 1 to enable JIT.'); 37 38 ADD_FLAG("CFLAGS_OPCACHE", "/I \"ext\\opcache\\jit\\ir\" /D "+ir_target+" /D IR_PHP"); 39 if (PHP_DEBUG == "yes") { 40 ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG"); 41 } 42 43 if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") && 44 CHECK_LIB("capstone.lib", "opcache", PHP_OPCACHE)) { 45 AC_DEFINE('HAVE_CAPSTONE', 1, 'Define to 1 if Capstone is available.'); 46 ir_src += " ir_disasm.c"; 47 } 48 49 ADD_MAKEFILE_FRAGMENT(configure_module_dirname + "\\jit\\Makefile.frag.w32"); 50 51 ADD_SOURCES(configure_module_dirname + "\\jit", 52 "zend_jit.c zend_jit_vm_helpers.c", 53 "opcache", "ext\\opcache\\jit"); 54 ADD_SOURCES(configure_module_dirname + "\\jit\\ir", 55 "ir.c", "opcache", "ext\\opcache\\jit\\ir"); 56 ADD_SOURCES(configure_module_dirname + "\\jit\\ir", 57 "ir_emit.c", "opcache", "ext\\opcache\\jit\\ir"); 58 ADD_SOURCES(configure_module_dirname + "\\jit\\ir", 59 ir_src, "opcache", "ext\\opcache\\jit\\ir"); 60 } else { 61 WARNING("JIT not enabled, headers not found"); 62 } 63 } 64 65 ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname); 66 67} 68 69