php-src/ext/opcache/config.w32
Arnaud Le Blanc 7b4c14dc10
Make OPcache non-optional
This removes the --enable-opcache/--disable-opcache configure switch. OPcache
is now always builtin. The default value of opcache.enable and
opcache.enable_cli is unchanged.

RFC: https://wiki.php.net/rfc/make_opcache_required

Closes GH-18961.

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
2025-07-27 09:40:22 +02:00

70 lines
2.5 KiB
Text

ARG_ENABLE("opcache-jit", "whether to enable JIT (not supported for ARM64)", "yes");
PHP_OPCACHE="yes";
ZEND_EXTENSION('opcache', "\
ZendAccelerator.c \
zend_accelerator_blacklist.c \
zend_accelerator_debug.c \
zend_accelerator_hash.c \
zend_accelerator_module.c \
zend_accelerator_util_funcs.c \
zend_persist.c \
zend_persist_calc.c \
zend_file_cache.c \
zend_shared_alloc.c \
shared_alloc_win32.c", false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_EXTENSION_DEP('opcache', 'date');
ADD_EXTENSION_DEP('opcache', 'hash');
ADD_EXTENSION_DEP('opcache', 'pcre');
if (PHP_OPCACHE_JIT == "yes") {
if (TARGET_ARCH == 'arm64') {
WARNING("JIT not enabled; not yet supported for ARM64");
} else if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
var dasm_flags = (X64 ? "-D X64=1" : "") + (X64 ? " -D X64WIN=1" : "") + " -D WIN=1";
var ir_target = (X64 ? "IR_TARGET_X64" : "IR_TARGET_X86");
var ir_src = "ir_strtab.c ir_cfg.c ir_sccp.c ir_gcm.c ir_ra.c ir_save.c \
ir_dump.c ir_check.c ir_patch.c";
DEFINE("IR_TARGET", ir_target);
DEFINE("DASM_FLAGS", dasm_flags);
DEFINE("DASM_ARCH", "x86");
DEFINE("TLS_TARGET", "win");
AC_DEFINE('HAVE_JIT', 1, 'Define to 1 to enable JIT.');
ADD_FLAG("CFLAGS_OPCACHE", "/I \"ext\\opcache\\jit\\ir\" /D "+ir_target+" /D IR_PHP");
if (PHP_DEBUG == "yes") {
ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG");
}
if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") &&
CHECK_LIB("capstone.lib", "opcache", PHP_OPCACHE)) {
AC_DEFINE('HAVE_CAPSTONE', 1, 'Define to 1 if Capstone is available.');
ir_src += " ir_disasm.c";
}
ADD_MAKEFILE_FRAGMENT(configure_module_dirname + "\\jit\\Makefile.frag.w32");
ADD_SOURCES(configure_module_dirname + "\\jit",
"zend_jit.c zend_jit_vm_helpers.c",
"opcache", "ext\\opcache\\jit");
if (PHP_ZTS == "yes") {
ADD_SOURCES(configure_module_dirname + "\\jit\\tls",
"zend_jit_tls_win.c",
"opcache", "ext\\opcache\\jit\\tls");
}
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
"ir.c", "opcache", "ext\\opcache\\jit\\ir");
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
"ir_emit.c", "opcache", "ext\\opcache\\jit\\ir");
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
ir_src, "opcache", "ext\\opcache\\jit\\ir");
} else {
WARNING("JIT not enabled, headers not found");
}
}
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);