mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
Suggestions
This commit is contained in:
@@ -6,7 +6,6 @@ namespace SPC\builder\linux;
|
||||
|
||||
use SPC\builder\traits\UnixSystemUtilTrait;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
class SystemUtil
|
||||
{
|
||||
@@ -189,12 +188,12 @@ class SystemUtil
|
||||
/**
|
||||
* Get libc version string from ldd
|
||||
*/
|
||||
public static function getLibcVersionIfExists(): ?string
|
||||
public static function getLibcVersionIfExists(string $libc): ?string
|
||||
{
|
||||
if (self::$libc_version !== null) {
|
||||
return self::$libc_version;
|
||||
}
|
||||
if (SPCTarget::isTarget(SPCTarget::GLIBC)) {
|
||||
if ($libc === 'glibc') {
|
||||
$result = shell()->execWithResult('ldd --version', false);
|
||||
if ($result[0] !== 0) {
|
||||
return null;
|
||||
@@ -209,7 +208,7 @@ class SystemUtil
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (SPCTarget::isTarget(SPCTarget::MUSL_STATIC)) {
|
||||
if ($libc === 'musl') {
|
||||
if (self::isMuslDist()) {
|
||||
$result = shell()->execWithResult('ldd 2>&1', false);
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@ class icu extends LinuxLibraryBase
|
||||
{
|
||||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
|
||||
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
|
||||
$ldflags = SPCTarget::isTarget(SPCTarget::MUSL_STATIC) ? 'LDFLAGS="-static"' : '';
|
||||
$ldflags = SPCTarget::isStaticTarget() ? 'LDFLAGS="-static"' : '';
|
||||
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
|
||||
->exec(
|
||||
"{$cppflags} {$cxxflags} {$ldflags} " .
|
||||
|
||||
Reference in New Issue
Block a user