mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
rename getStaticAndSharedLibs
This commit is contained in:
parent
821411cfd6
commit
a9fab86269
@ -229,7 +229,7 @@ class Extension
|
|||||||
public function patchBeforeSharedMake(): bool
|
public function patchBeforeSharedMake(): bool
|
||||||
{
|
{
|
||||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], array_map(fn ($l) => $l->getName(), $this->builder->getLibs()));
|
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], array_map(fn ($l) => $l->getName(), $this->builder->getLibs()));
|
||||||
[$staticLibs] = $this->getStaticAndSharedLibs($config['libs']);
|
[$staticLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
|
||||||
FileSystem::replaceFileRegex(
|
FileSystem::replaceFileRegex(
|
||||||
$this->source_dir . '/Makefile',
|
$this->source_dir . '/Makefile',
|
||||||
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
||||||
@ -408,7 +408,7 @@ class Extension
|
|||||||
public function buildUnixShared(): void
|
public function buildUnixShared(): void
|
||||||
{
|
{
|
||||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], array_map(fn ($l) => $l->getName(), $this->builder->getLibs()));
|
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], array_map(fn ($l) => $l->getName(), $this->builder->getLibs()));
|
||||||
[$staticLibs, $sharedLibs] = $this->getStaticAndSharedLibs($config['libs']);
|
[$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
|
||||||
$env = [
|
$env = [
|
||||||
'CFLAGS' => $config['cflags'],
|
'CFLAGS' => $config['cflags'],
|
||||||
'CXXFLAGS' => $config['cflags'],
|
'CXXFLAGS' => $config['cflags'],
|
||||||
@ -528,7 +528,7 @@ class Extension
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getStaticAndSharedLibs(string $allLibs): array
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
||||||
{
|
{
|
||||||
$staticLibString = '';
|
$staticLibString = '';
|
||||||
$sharedLibString = '';
|
$sharedLibString = '';
|
||||||
|
|||||||
@ -16,9 +16,9 @@ class imagick extends Extension
|
|||||||
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
|
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getStaticAndSharedLibs(string $allLibs): array
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
||||||
{
|
{
|
||||||
[$static, $shared] = parent::getStaticAndSharedLibs($allLibs);
|
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
|
||||||
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
||||||
$static .= ' -l:libstdc++.a';
|
$static .= ' -l:libstdc++.a';
|
||||||
$shared = str_replace('-lstdc++', '', $shared);
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user