Skip to content

Commit c9d33bf

Browse files
committed
Chore
1 parent 59f9143 commit c9d33bf

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/SPC/builder/extension/imagick.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace SPC\builder\extension;
66

77
use SPC\builder\Extension;
8-
use SPC\builder\linux\SystemUtil;
98
use SPC\util\CustomExt;
9+
use SPC\util\SPCTarget;
1010

1111
#[CustomExt('imagick')]
1212
class imagick extends Extension
@@ -20,7 +20,7 @@ public function getUnixConfigureArg(bool $shared = false): string
2020
protected function getStaticAndSharedLibs(): array
2121
{
2222
[$static, $shared] = parent::getStaticAndSharedLibs();
23-
if (SystemUtil::getLibcVersionIfExists('glibc') && SystemUtil::getLibcVersionIfExists('glibc') <= '2.17') {
23+
if (SPCTarget::getLibc() === 'glibc' && version_compare(SPCTarget::getLibcVersion(), '2.17', '<=')) {
2424
$static .= ' -lstdc++';
2525
$shared = str_replace('-lstdc++', '', $shared);
2626
}

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ public function __construct(array $options = [])
3737
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
3838
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
3939

40-
// cross-compiling is not supported yet
41-
/*if (php_uname('m') !== $this->arch) {
42-
$this->cross_compile_prefix = SystemUtil::getCrossCompilePrefix($this->cc, $this->arch);
43-
logger()->info('using cross compile prefix: ' . $this->cross_compile_prefix);
44-
$this->configure_env .= " CROSS_COMPILE='{$this->cross_compile_prefix}'";
45-
}*/
46-
4740
// create pkgconfig and include dir (some libs cannot create them automatically)
4841
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
4942
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);

tests/SPC/builder/linux/SystemUtilTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ public function testFindHeader()
4343
$this->assertIsArray(SystemUtil::findHeader('elf.h'));
4444
}
4545

46-
public function testGetCrossCompilePrefix()
47-
{
48-
$this->assertIsString(SystemUtil::getCrossCompilePrefix('gcc', 'x86_64'));
49-
}
50-
51-
public function testGetCCType()
52-
{
53-
$this->assertEquals('gcc', SystemUtil::getCCType('xjfoiewjfoewof-gcc'));
54-
}
55-
5646
public function testGetSupportedDistros()
5747
{
5848
$this->assertIsArray(SystemUtil::getSupportedDistros());

0 commit comments

Comments
 (0)