mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
suggested are required too
This commit is contained in:
parent
27a4d5af54
commit
0acf238c74
@ -228,15 +228,21 @@ class Extension
|
||||
*/
|
||||
public function patchBeforeSharedMake(): bool
|
||||
{
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], $this->builder->getOption('with-suggested-exts'), $this->builder->getOption('with-suggested-libs'));
|
||||
[$staticLibs] = $this->getStaticAndSharedLibs($config['libs']);
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
||||
'$1 ' . trim($staticLibs)
|
||||
);
|
||||
if ($objs = getenv('SPC_EXTRA_RUNTIME_OBJECTS')) {
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
"/^(shared_objects_{$this->getName()}\\s*=.*)$/m",
|
||||
"$1 {$objs}",
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -401,7 +407,7 @@ class Extension
|
||||
*/
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()]);
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], $this->builder->getOption('with-suggested-exts'), $this->builder->getOption('with-suggested-libs'));
|
||||
[$staticLibs, $sharedLibs] = $this->getStaticAndSharedLibs($config['libs']);
|
||||
$env = [
|
||||
'CFLAGS' => $config['cflags'],
|
||||
@ -437,13 +443,6 @@ class Extension
|
||||
'--enable-shared --disable-static'
|
||||
);
|
||||
|
||||
// some extensions don't define their dependencies well, this patch is only needed for a few
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
||||
'$1 ' . trim($staticLibs)
|
||||
);
|
||||
|
||||
if ($this->patchBeforeSharedMake()) {
|
||||
logger()->info("Extension [{$this->getName()}] patched before shared make");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user