Skip to content

Commit

Permalink
Fix FreeBSD pkg-config linking issue (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywhalecc authored Apr 26, 2024
1 parent aaa4510 commit d98d6ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SPC/builder/unix/library/pkgconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()])
Expand Down

0 comments on commit d98d6ae

Please sign in to comment.