mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
fix imagick problem, for some reason it must be in the --start-group --end-group
This commit is contained in:
parent
7eb5fb4520
commit
00e78dd84f
@ -529,7 +529,7 @@ class Extension
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getStaticAndSharedLibs(string $allLibs): array
|
||||
protected function getStaticAndSharedLibs(string $allLibs): array
|
||||
{
|
||||
$staticLibString = '';
|
||||
$sharedLibString = '';
|
||||
|
||||
@ -15,4 +15,14 @@ class imagick extends Extension
|
||||
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
||||
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
|
||||
}
|
||||
|
||||
protected function getStaticAndSharedLibs(string $allLibs): array
|
||||
{
|
||||
[$static, $shared] = parent::getStaticAndSharedLibs($allLibs);
|
||||
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
||||
$static .= ' -l:libstdc++.a';
|
||||
$shared = str_replace('-lstdc++', '', $shared);
|
||||
}
|
||||
return [deduplicate_spaces($static), deduplicate_spaces($shared)];
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$config = (new SPCConfigUtil($this, ['libs_only_deps' => true, 'absolute_libs' => true]))->config($this->ext_list, $this->lib_list, $this->getOption('with-suggested-exts'), $this->getOption('with-suggested-libs'));
|
||||
return [
|
||||
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
|
||||
'EXTRA_LIBS' => $config['libs'] . ' ' . SPCTarget::getRuntimeLibs(),
|
||||
'EXTRA_LIBS' => $config['libs'],
|
||||
'EXTRA_LDFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
|
||||
'EXTRA_LDFLAGS_PROGRAM' => SPCTarget::isStatic() ? '-all-static -pie' : '-pie',
|
||||
];
|
||||
|
||||
@ -90,9 +90,6 @@ class SPCConfigUtil
|
||||
if (!str_contains($libs, $libcpp)) {
|
||||
$libs .= " {$libcpp}";
|
||||
}
|
||||
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
||||
str_replace('-lstdc++', '-l:libstdc++.a', $libs);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->libs_only_deps) {
|
||||
@ -101,9 +98,9 @@ class SPCConfigUtil
|
||||
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
|
||||
}
|
||||
return [
|
||||
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
|
||||
'ldflags' => trim(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||
'libs' => trim(getenv('LIBS') . ' ' . $libs),
|
||||
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||
'libs' => deduplicate_spaces(getenv('LIBS') . ' ' . $libs),
|
||||
];
|
||||
}
|
||||
|
||||
@ -120,9 +117,9 @@ class SPCConfigUtil
|
||||
}
|
||||
|
||||
return [
|
||||
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
|
||||
'ldflags' => trim(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||
'libs' => trim($allLibs),
|
||||
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||
'libs' => deduplicate_spaces($allLibs),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -242,3 +242,12 @@ function get_pack_replace(): array
|
||||
BUILD_ROOT_PATH => '@build_root_path@',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $string
|
||||
* @return string without double spaces
|
||||
*/
|
||||
function deduplicate_spaces($string): string
|
||||
{
|
||||
return trim(preg_replace('/\s+/', ' ', $string));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user