Update src/SPC/builder/unix/library/jbig.php

Co-authored-by: Jerry Ma <jesse2061@outlook.com>
This commit is contained in:
Marc 2025-07-19 17:56:54 +07:00 committed by DubbleClick
parent 5675a1e2ad
commit 082b9a907b

View File

@ -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")