Move opcache JIT handling from Linux and MacOS builders to Extension

This commit is contained in:
crazywhalecc 2025-07-29 11:22:58 +08:00
parent e9dbeb1e34
commit ed67393d33
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
3 changed files with 4 additions and 17 deletions

View File

@ -52,10 +52,12 @@ class opcache extends Extension
public function getUnixConfigureArg(bool $shared = false): string public function getUnixConfigureArg(bool $shared = false): string
{ {
$version = $this->builder->getPHPVersion(); $version = $this->builder->getPHPVersion();
$opcache_jit = !$this->builder->getOption('disable-opcache-jit', false);
$opcache_jit = $opcache_jit ? '--enable-opcache-jit' : '--disable-opcache-jit';
if (version_compare($version, '8.5.0-dev', '<')) { if (version_compare($version, '8.5.0-dev', '<')) {
return '--enable-opcache'; return "--enable-opcache {$opcache_jit}";
} }
return ''; return $opcache_jit;
} }
public function getDistName(): string public function getDistName(): string

View File

@ -80,13 +80,6 @@ class LinuxBuilder extends UnixBuilderBase
$zts = ''; $zts = '';
} }
$opcache_jit = !$this->getOption('disable-opcache-jit', false);
if ($opcache_jit) {
$opcache_jit = $phpVersionID >= 80500 ? '--enable-opcache-jit ' : '';
} else {
$opcache_jit = '--disable-opcache-jit ';
}
$config_file_path = $this->getOption('with-config-file-path', false) ? $config_file_path = $this->getOption('with-config-file-path', false) ?
('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : '';
$config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ?

View File

@ -101,13 +101,6 @@ class MacOSBuilder extends UnixBuilderBase
$json_74 = $phpVersionID < 80000 ? '--enable-json ' : ''; $json_74 = $phpVersionID < 80000 ? '--enable-json ' : '';
$zts = $this->getOption('enable-zts', false) ? '--enable-zts --disable-zend-signals ' : ''; $zts = $this->getOption('enable-zts', false) ? '--enable-zts --disable-zend-signals ' : '';
$opcache_jit = !$this->getOption('disable-opcache-jit', false);
if ($opcache_jit) {
$opcache_jit = $phpVersionID >= 80500 ? '--enable-opcache-jit ' : '';
} else {
$opcache_jit = '--disable-opcache-jit ';
}
$config_file_path = $this->getOption('with-config-file-path', false) ? $config_file_path = $this->getOption('with-config-file-path', false) ?
('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : '';
$config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ?
@ -146,7 +139,6 @@ class MacOSBuilder extends UnixBuilderBase
($enableMicro ? '--enable-micro ' : '--disable-micro ') . ($enableMicro ? '--enable-micro ' : '--disable-micro ') .
$config_file_path . $config_file_path .
$config_file_scan_dir . $config_file_scan_dir .
$opcache_jit .
$json_74 . $json_74 .
$zts . $zts .
$this->makeStaticExtensionArgs() . ' ' . $this->makeStaticExtensionArgs() . ' ' .