mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
add extra runtime objects for shared libraries built directly by php make too
This commit is contained in:
@@ -12,6 +12,7 @@ use SPC\store\FileSystem;
|
||||
use SPC\toolchain\ToolchainManager;
|
||||
use SPC\toolchain\ZigToolchain;
|
||||
use SPC\util\SPCConfigUtil;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
class Extension
|
||||
{
|
||||
@@ -187,6 +188,19 @@ class Extension
|
||||
*/
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
if (
|
||||
PHP_OS_FAMILY === 'Linux' &&
|
||||
$this->isBuildShared() &&
|
||||
ToolchainManager::getToolchainClass() === ZigToolchain::class &&
|
||||
($extra = (new ZigToolchain())->getExtraRuntimeObjects())
|
||||
) {
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
"/^(shared_objects_{$this->getName()}\\s*=.*)$/m",
|
||||
"$1 {$extra}",
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user