mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-13 03:45:37 +08:00
handle case where libphp.so is built instead of libphp-release.so
This commit is contained in:
@@ -105,7 +105,7 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
$disable_jit = $this->getOption('disable-opcache-jit', false) ? '--disable-opcache-jit ' : '';
|
$disable_jit = $this->getOption('disable-opcache-jit', false) ? '--disable-opcache-jit ' : '';
|
||||||
$cc = trim(getenv('CC'));
|
$cc = trim(getenv('CC'));
|
||||||
if (!$disable_jit && $this->getExt('opcache') && str_contains($cc, 'zig')) {
|
if (!$disable_jit && $this->getExt('opcache') && str_contains($cc, 'zig')) {
|
||||||
f_putenv("CC=$cc -fno-sanitize=undefined");
|
f_putenv("CC={$cc} -fno-sanitize=undefined");
|
||||||
}
|
}
|
||||||
|
|
||||||
$config_file_path = $this->getOption('with-config-file-path', false) ?
|
$config_file_path = $this->getOption('with-config-file-path', false) ?
|
||||||
@@ -180,7 +180,7 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
$this->buildEmbed();
|
$this->buildEmbed();
|
||||||
}
|
}
|
||||||
if (!$disable_jit && $this->getExt('opcache') && str_contains($cc, 'zig')) {
|
if (!$disable_jit && $this->getExt('opcache') && str_contains($cc, 'zig')) {
|
||||||
f_putenv("CC=$cc");
|
f_putenv("CC={$cc}");
|
||||||
}
|
}
|
||||||
if ($enableFrankenphp) {
|
if ($enableFrankenphp) {
|
||||||
logger()->info('building frankenphp');
|
logger()->info('building frankenphp');
|
||||||
@@ -300,9 +300,13 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
$release = $matches[1];
|
$release = $matches[1];
|
||||||
$realLibName = 'libphp-' . $release . '.so';
|
$realLibName = 'libphp-' . $release . '.so';
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
if (file_exists($realLibName)) {
|
$libphpPath = BUILD_LIB_PATH . '/libphp.so';
|
||||||
$realLib = BUILD_LIB_PATH . '/' . $realLibName;
|
$libphpRelease = BUILD_LIB_PATH . '/' . $realLibName;
|
||||||
rename(BUILD_LIB_PATH . '/libphp.so', $realLib);
|
if (!file_exists($libphpRelease) && file_exists($libphpPath)) {
|
||||||
|
rename($libphpPath, $libphpRelease);
|
||||||
|
}
|
||||||
|
if (file_exists($libphpRelease)) {
|
||||||
|
rename(BUILD_LIB_PATH . '/libphp.so', $libphpRelease);
|
||||||
chdir(BUILD_LIB_PATH);
|
chdir(BUILD_LIB_PATH);
|
||||||
symlink($realLibName, 'libphp.so');
|
symlink($realLibName, 'libphp.so');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user