Add autoconf executor

This commit is contained in:
crazywhalecc
2025-06-09 19:32:31 +08:00
committed by Jerry Ma
parent 684b5d4534
commit 720251458f
34 changed files with 437 additions and 454 deletions

View File

@@ -6,6 +6,7 @@ namespace SPC\builder\macos\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\util\executor\UnixAutoconfExecutor;
class libffi extends MacOSLibraryBase
{
@@ -17,20 +18,13 @@ class libffi extends MacOSLibraryBase
*/
protected function build(): void
{
[, , $destdir] = SEPARATED_PATH;
$arch = getenv('SPC_ARCH');
shell()->cd($this->source_dir)
->exec(
'./configure ' .
'--enable-static ' .
'--disable-shared ' .
"--host={$arch}-apple-darwin " .
"--target={$arch}-apple-darwin " .
'--prefix= ' // use prefix=/
UnixAutoconfExecutor::create($this)
->configure(
"--host={$arch}-apple-darwin",
"--target={$arch}-apple-darwin",
)
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec("make install DESTDIR={$destdir}");
->make();
$this->patchPkgconfPrefix(['libffi.pc']);
}
}