mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 03:15:35 +08:00
fix imagick problem, for some reason it must be in the --start-group --end-group
This commit is contained in:
@@ -529,7 +529,7 @@ class Extension
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getStaticAndSharedLibs(string $allLibs): array
|
protected function getStaticAndSharedLibs(string $allLibs): array
|
||||||
{
|
{
|
||||||
$staticLibString = '';
|
$staticLibString = '';
|
||||||
$sharedLibString = '';
|
$sharedLibString = '';
|
||||||
|
|||||||
@@ -15,4 +15,14 @@ class imagick extends Extension
|
|||||||
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
||||||
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
|
||||||
|
{
|
||||||
|
[$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'));
|
$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 [
|
return [
|
||||||
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
|
'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' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
|
||||||
'EXTRA_LDFLAGS_PROGRAM' => SPCTarget::isStatic() ? '-all-static -pie' : '-pie',
|
'EXTRA_LDFLAGS_PROGRAM' => SPCTarget::isStatic() ? '-all-static -pie' : '-pie',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -90,9 +90,6 @@ class SPCConfigUtil
|
|||||||
if (!str_contains($libs, $libcpp)) {
|
if (!str_contains($libs, $libcpp)) {
|
||||||
$libs .= " {$libcpp}";
|
$libs .= " {$libcpp}";
|
||||||
}
|
}
|
||||||
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
|
||||||
str_replace('-lstdc++', '-l:libstdc++.a', $libs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->libs_only_deps) {
|
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);
|
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
|
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||||
'ldflags' => trim(getenv('LDFLAGS') . ' ' . $ldflags),
|
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||||
'libs' => trim(getenv('LIBS') . ' ' . $libs),
|
'libs' => deduplicate_spaces(getenv('LIBS') . ' ' . $libs),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,9 +117,9 @@ class SPCConfigUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
|
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||||
'ldflags' => trim(getenv('LDFLAGS') . ' ' . $ldflags),
|
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||||
'libs' => trim($allLibs),
|
'libs' => deduplicate_spaces($allLibs),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -242,3 +242,12 @@ function get_pack_replace(): array
|
|||||||
BUILD_ROOT_PATH => '@build_root_path@',
|
BUILD_ROOT_PATH => '@build_root_path@',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $string
|
||||||
|
* @return string without double spaces
|
||||||
|
*/
|
||||||
|
function deduplicate_spaces($string): string
|
||||||
|
{
|
||||||
|
return trim(preg_replace('/\s+/', ' ', $string));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user