mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
This commit is contained in:
@@ -8,6 +8,7 @@ use StaticPHP\Attribute\Package\BuildFor;
|
||||
use StaticPHP\Attribute\Package\Library;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
|
||||
#[Library('gmp')]
|
||||
class gmp
|
||||
@@ -16,10 +17,12 @@ class gmp
|
||||
#[BuildFor('Darwin')]
|
||||
public function build(LibraryPackage $lib): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($lib)
|
||||
->appendEnv(['CFLAGS' => '-std=c17'])
|
||||
->configure('--enable-fat')
|
||||
->make();
|
||||
$make = UnixAutoconfExecutor::create($lib)->appendEnv(['CFLAGS' => '-std=c17']);
|
||||
if (SystemTarget::getTargetArch() === 'x86_64' && SystemTarget::getTargetOS() === 'Linux') {
|
||||
$libc = SystemTarget::getLibc() === 'glibc' ? 'gnu' : 'musl';
|
||||
$make->addConfigureArgs(["--host=x86_64-pc-linux-{$libc}"]);
|
||||
}
|
||||
$make->configure('--enable-fat')->make();
|
||||
$lib->patchPkgconfPrefix(['gmp.pc']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user