mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 07:45:39 +08:00
Forward-port #1110
This commit is contained in:
@@ -443,7 +443,7 @@ trait unix
|
||||
|
||||
#[BuildFor('Darwin')]
|
||||
#[BuildFor('Linux')]
|
||||
public function build(TargetPackage $package): void
|
||||
public function build(TargetPackage $package, PackageInstaller $installer): void
|
||||
{
|
||||
// frankenphp is not a php sapi, it's a standalone Go binary that depends on libphp.a (embed)
|
||||
if ($package->getName() === 'frankenphp') {
|
||||
@@ -457,9 +457,21 @@ trait unix
|
||||
return;
|
||||
}
|
||||
|
||||
$package->runStage([$this, 'buildconfForUnix']);
|
||||
$package->runStage([$this, 'configureForUnix']);
|
||||
$package->runStage([$this, 'makeForUnix']);
|
||||
// maintainer can skip build though ...
|
||||
$skip_build = false;
|
||||
if ($installer->isPackageResolved('php-embed')
|
||||
&& $installer->getTargetPackage('php-embed')->getBuildOption('maintainer-skip-build')
|
||||
) {
|
||||
$suffix = SystemTarget::getTargetOS() === 'Darwin' ? 'dylib' : 'so';
|
||||
$skip_build = file_exists(BUILD_LIB_PATH . '/libphp.a')
|
||||
|| file_exists(BUILD_LIB_PATH . "/libphp.{$suffix}");
|
||||
}
|
||||
|
||||
if (!$skip_build) {
|
||||
$package->runStage([$this, 'buildconfForUnix']);
|
||||
$package->runStage([$this, 'configureForUnix']);
|
||||
$package->runStage([$this, 'makeForUnix']);
|
||||
}
|
||||
|
||||
$package->runStage([$this, 'unixBuildSharedExt']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user