Fix opcache jit option parsing in builder

This commit is contained in:
crazywhalecc
2025-08-02 01:29:20 +08:00
parent 17ff5f63bf
commit 22a8191b97
8 changed files with 51 additions and 19 deletions

View File

@@ -69,6 +69,23 @@ class SourcePatcher
);
}
// Fix PHP VS version
if ($builder instanceof WindowsBuilder) {
// get vs version
$vc = \SPC\builder\windows\SystemUtil::findVisualStudio();
$vc_matches = match ($vc['version']) {
'vs17' => ['VS17', 'Visual C++ 2022'],
'vs16' => ['VS16', 'Visual C++ 2019'],
default => ['unknown', 'unknown'],
};
// patch php-src/win32/build/confutils.js
FileSystem::replaceFileStr(
SOURCE_PATH . '\php-src\win32\build\confutils.js',
'var name = "unknown";',
"var name = short ? \"{$vc_matches[0]}\" : \"{$vc_matches[1]}\";return name;"
);
}
// patch php-src/build/php.m4 PKG_CHECK_MODULES -> PKG_CHECK_MODULES_STATIC
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/build/php.m4', 'PKG_CHECK_MODULES(', 'PKG_CHECK_MODULES_STATIC(');