From 03b634b9614efa00bad51708e7ed6086f80c7f6d Mon Sep 17 00:00:00 2001 From: henderkes Date: Thu, 15 May 2025 15:29:12 +0700 Subject: [PATCH] fix libsodium with -fPIC too --- src/SPC/builder/unix/library/libsodium.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/unix/library/libsodium.php b/src/SPC/builder/unix/library/libsodium.php index b24d52b7..c6bc6168 100644 --- a/src/SPC/builder/unix/library/libsodium.php +++ b/src/SPC/builder/unix/library/libsodium.php @@ -9,10 +9,15 @@ trait libsodium protected function build(): void { shell()->cd($this->source_dir) - ->exec('./configure --enable-static --disable-shared --prefix=') - ->exec('make clean') - ->exec("make -j{$this->builder->concurrency}") - ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + ->setEnv([ + 'CFLAGS' => $this->getLibExtraCFlags(), + 'LDFLAGS' => $this->getLibExtraLdFlags(), + 'LIBS' => $this->getLibExtraLibs(), + ]) + ->execWithEnv('./configure --with-pic --enable-static --disable-shared --prefix=') + ->execWithEnv('make clean') + ->execWithEnv("make -j{$this->builder->concurrency}") + ->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH); $this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX); }