Skip to content

Commit 815ba75

Browse files
committed
we can build musl with zig cc too, don't need musl toolchain
1 parent fff16b4 commit 815ba75

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(array $options = [])
3030

3131
GlobalEnvManager::init();
3232

33-
if (getenv('SPC_LIBC') === 'musl' && !SystemUtil::isMuslDist()) {
33+
if (getenv('SPC_LIBC') === 'musl' && !SystemUtil::isMuslDist() && !str_contains((string)getenv('CC'), 'zig')) {
3434
$this->setOptionIfNotExist('library_path', "LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
3535
$this->setOptionIfNotExist('ld_library_path', "LD_LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
3636
$configure = getenv('SPC_CMD_PREFIX_PHP_CONFIGURE');

src/SPC/builder/unix/library/attr.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ trait attr
1515
protected function build(): void
1616
{
1717
UnixAutoconfExecutor::create($this)
18+
->appendEnv([
19+
'CFLAGS' => '-Wno-int-conversion -Wno-implicit-function-declaration',
20+
])
1821
->exec('libtoolize --force --copy')
1922
->exec('./autogen.sh || autoreconf -if')
2023
->configure('--disable-nls')

0 commit comments

Comments
 (0)