From d98d6aeffb347dceb8ed50a0ecec3ae4b530275a Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 26 Apr 2024 16:03:03 +0800 Subject: [PATCH] Fix FreeBSD pkg-config linking issue (#426) --- src/SPC/builder/unix/library/pkgconfig.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/unix/library/pkgconfig.php b/src/SPC/builder/unix/library/pkgconfig.php index 80510157..ca93fd25 100644 --- a/src/SPC/builder/unix/library/pkgconfig.php +++ b/src/SPC/builder/unix/library/pkgconfig.php @@ -8,8 +8,8 @@ trait pkgconfig { protected function build(): void { - $cflags = PHP_OS_FAMILY === 'Darwin' ? "{$this->builder->arch_c_flags} -Wimplicit-function-declaration -Wno-int-conversion" : ''; - $ldflags = PHP_OS_FAMILY === 'Darwin' ? '' : '--static'; + $cflags = PHP_OS_FAMILY !== 'Linux' ? "{$this->builder->arch_c_flags} -Wimplicit-function-declaration -Wno-int-conversion" : ''; + $ldflags = PHP_OS_FAMILY !== 'Linux' ? '' : '--static'; shell()->cd($this->source_dir) ->setEnv(['CFLAGS' => $this->getLibExtraCFlags() ?: $cflags, 'LDFLAGS' => $this->getLibExtraLdFlags() ?: $ldflags, 'LIBS' => $this->getLibExtraLibs()])