mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
runtime object patch for shared extensions
This commit is contained in:
@@ -215,7 +215,16 @@ class Extension
|
||||
*/
|
||||
public function patchBeforeSharedMake(): bool
|
||||
{
|
||||
return false;
|
||||
if (!str_contains(getenv('CC'), 'zig')) {
|
||||
return false;
|
||||
}
|
||||
$extra = getenv('ZIG_SHARED_EXTENSION_EXTRA_OBJECTS');
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
"/^(shared_objects_{$this->getName()}\s*=.*)$/m",
|
||||
"$1 {$extra}",
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ class uv extends Extension
|
||||
|
||||
public function patchBeforeSharedMake(): bool
|
||||
{
|
||||
parent::patchBeforeSharedMake();
|
||||
if (PHP_OS_FAMILY !== 'Linux' || arch2gnu(php_uname('m')) !== 'aarch64') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -308,6 +308,9 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
}
|
||||
if (file_exists($libphpRelease)) {
|
||||
chdir(BUILD_LIB_PATH);
|
||||
if (file_exists($libphpPath)) {
|
||||
unlink($libphpPath);
|
||||
}
|
||||
symlink($realLibName, 'libphp.so');
|
||||
}
|
||||
if (is_dir(BUILD_MODULES_PATH)) {
|
||||
|
||||
Reference in New Issue
Block a user