2023-03-18 17:32:21 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\macos\library;
|
|
|
|
|
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2023-08-20 19:51:45 +08:00
|
|
|
|
2023-03-18 17:32:21 +08:00
|
|
|
class libffi extends MacOSLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'libffi';
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
protected function build(): void
|
2023-03-18 17:32:21 +08:00
|
|
|
{
|
2025-03-14 18:22:50 +08:00
|
|
|
$arch = getenv('SPC_ARCH');
|
2025-06-09 19:32:31 +08:00
|
|
|
UnixAutoconfExecutor::create($this)
|
|
|
|
|
->configure(
|
|
|
|
|
"--host={$arch}-apple-darwin",
|
|
|
|
|
"--target={$arch}-apple-darwin",
|
2023-04-03 20:47:24 +08:00
|
|
|
)
|
2025-06-09 19:32:31 +08:00
|
|
|
->make();
|
2023-05-10 21:59:33 +08:00
|
|
|
$this->patchPkgconfPrefix(['libffi.pc']);
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
|
|
|
|
}
|