mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-14 04:15:35 +08:00
Chore
This commit is contained in:
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\builder\linux\SystemUtil;
|
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
#[CustomExt('imagick')]
|
#[CustomExt('imagick')]
|
||||||
class imagick extends Extension
|
class imagick extends Extension
|
||||||
@@ -20,7 +20,7 @@ class imagick extends Extension
|
|||||||
protected function getStaticAndSharedLibs(): array
|
protected function getStaticAndSharedLibs(): array
|
||||||
{
|
{
|
||||||
[$static, $shared] = parent::getStaticAndSharedLibs();
|
[$static, $shared] = parent::getStaticAndSharedLibs();
|
||||||
if (SystemUtil::getLibcVersionIfExists('glibc') && SystemUtil::getLibcVersionIfExists('glibc') <= '2.17') {
|
if (SPCTarget::getLibc() === 'glibc' && version_compare(SPCTarget::getLibcVersion(), '2.17', '<=')) {
|
||||||
$static .= ' -lstdc++';
|
$static .= ' -lstdc++';
|
||||||
$shared = str_replace('-lstdc++', '', $shared);
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,13 +37,6 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||||
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
||||||
|
|
||||||
// cross-compiling is not supported yet
|
|
||||||
/*if (php_uname('m') !== $this->arch) {
|
|
||||||
$this->cross_compile_prefix = SystemUtil::getCrossCompilePrefix($this->cc, $this->arch);
|
|
||||||
logger()->info('using cross compile prefix: ' . $this->cross_compile_prefix);
|
|
||||||
$this->configure_env .= " CROSS_COMPILE='{$this->cross_compile_prefix}'";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// create pkgconfig and include dir (some libs cannot create them automatically)
|
// create pkgconfig and include dir (some libs cannot create them automatically)
|
||||||
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
|
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
|
||||||
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
||||||
|
|||||||
@@ -43,16 +43,6 @@ class SystemUtilTest extends TestCase
|
|||||||
$this->assertIsArray(SystemUtil::findHeader('elf.h'));
|
$this->assertIsArray(SystemUtil::findHeader('elf.h'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetCrossCompilePrefix()
|
|
||||||
{
|
|
||||||
$this->assertIsString(SystemUtil::getCrossCompilePrefix('gcc', 'x86_64'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetCCType()
|
|
||||||
{
|
|
||||||
$this->assertEquals('gcc', SystemUtil::getCCType('xjfoiewjfoewof-gcc'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetSupportedDistros()
|
public function testGetSupportedDistros()
|
||||||
{
|
{
|
||||||
$this->assertIsArray(SystemUtil::getSupportedDistros());
|
$this->assertIsArray(SystemUtil::getSupportedDistros());
|
||||||
|
|||||||
Reference in New Issue
Block a user