try something with static

This commit is contained in:
Marc Henderkes 2025-03-10 11:42:44 +01:00
parent be3d68cebe
commit 40ea306008
2 changed files with 8 additions and 4 deletions

View File

@ -13,9 +13,14 @@ trait attr
*/
protected function build(): void
{
$cflags = PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '';
$ldflags = PHP_OS_FAMILY !== 'Linux' ? '' : '--static';
shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv('./autogen.sh')
->setEnv([
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags() . ' ' . $cflags),
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags() . ' ' . $ldflags),
'LIBS' => $this->getLibExtraLibs(),
])->execWithEnv('./autogen.sh')
->execWithEnv('./configure --prefix= --enable-static --disable-shared')
->execWithEnv("make -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
@ -31,7 +30,7 @@ trait libacl
protected function build(): void
{
$cflags = PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '';
$ldflags = !($this instanceof LinuxLibraryBase) ? '' : '--static';
$ldflags = '--static';
shell()->cd($this->source_dir)
->setEnv([
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags() . ' ' . $cflags),