From 40ea306008e0650647eb9cc9f32a4cd74082dfa0 Mon Sep 17 00:00:00 2001 From: Marc Henderkes Date: Mon, 10 Mar 2025 11:42:44 +0100 Subject: [PATCH] try something with static --- src/SPC/builder/unix/library/attr.php | 9 +++++++-- src/SPC/builder/unix/library/libacl.php | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/unix/library/attr.php b/src/SPC/builder/unix/library/attr.php index 542fd807..edfa89ab 100644 --- a/src/SPC/builder/unix/library/attr.php +++ b/src/SPC/builder/unix/library/attr.php @@ -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); diff --git a/src/SPC/builder/unix/library/libacl.php b/src/SPC/builder/unix/library/libacl.php index 9727e17c..2068d8e8 100644 --- a/src/SPC/builder/unix/library/libacl.php +++ b/src/SPC/builder/unix/library/libacl.php @@ -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),