mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
Merge branch 'main' into pkg-config-pkg
# Conflicts: # src/globals/test-extensions.php
This commit is contained in:
@@ -52,6 +52,15 @@ class SPCConfigUtil
|
||||
*/
|
||||
public function config(array $extensions = [], array $libraries = [], bool $include_suggest_ext = false, bool $include_suggest_lib = false): array
|
||||
{
|
||||
$extra_exts = [];
|
||||
foreach ($extensions as $ext) {
|
||||
$extra_exts = array_merge($extra_exts, Config::getExt($ext, 'ext-suggests', []));
|
||||
}
|
||||
foreach ($extra_exts as $ext) {
|
||||
if ($this->builder?->getExt($ext) && !in_array($ext, $extensions)) {
|
||||
$extensions[] = $ext;
|
||||
}
|
||||
}
|
||||
[$extensions, $libraries] = DependencyUtil::getExtsAndLibs($extensions, $libraries, $include_suggest_ext, $include_suggest_lib);
|
||||
|
||||
ob_start();
|
||||
|
||||
@@ -100,6 +100,10 @@ class SPCTarget
|
||||
public static function getLibcVersion(): ?string
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Linux') {
|
||||
$target = (string) getenv('SPC_TARGET');
|
||||
if (str_contains($target, '-gnu.2.')) {
|
||||
return preg_match('/-gnu\.(2\.\d+)/', $target, $matches) ? $matches[1] : null;
|
||||
}
|
||||
$libc = self::getLibc();
|
||||
return SystemUtil::getLibcVersionIfExists($libc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user