From 082b9a907b0d0f1de7967fc869b79333d03e8b73 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 19 Jul 2025 17:56:54 +0700 Subject: [PATCH] Update src/SPC/builder/unix/library/jbig.php Co-authored-by: Jerry Ma --- src/SPC/builder/unix/library/jbig.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/SPC/builder/unix/library/jbig.php b/src/SPC/builder/unix/library/jbig.php index d09943e2..515c72bd 100644 --- a/src/SPC/builder/unix/library/jbig.php +++ b/src/SPC/builder/unix/library/jbig.php @@ -12,13 +12,18 @@ trait jbig { /** * @throws FileSystemException + */ + public function patchBeforeBuild(): bool + { + // Patch Makefile to add -fPIC flag for position-independent code + FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'CFLAGS = -O2 -W -Wno-unused-result', 'CFLAGS = -O2 -W -Wno-unused-result -fPIC'); + } + + /** * @throws RuntimeException */ protected function build(): void { - // Patch Makefile to add -fPIC flag for position-independent code - FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'CFLAGS = -O2 -W -Wno-unused-result', 'CFLAGS = -O2 -W -Wno-unused-result -fPIC'); - // Build the library shell()->cd($this->source_dir)->initializeEnv($this) ->exec("make -j{$this->builder->concurrency} {$this->builder->getEnvString()} lib")