mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
update libraries to honour user flags
This commit is contained in:
@@ -72,6 +72,10 @@ class opcache extends PhpExtensionPackage
|
||||
) {
|
||||
$opcache_jit = ' --disable-opcache-jit';
|
||||
}
|
||||
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
|
||||
// PHP 8.5+ has opcache built-in
|
||||
if ($phpVersionID < 80500) {
|
||||
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
|
||||
}
|
||||
return trim($opcache_jit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,27 @@ namespace Package\Extension;
|
||||
|
||||
use Package\Target\php;
|
||||
use StaticPHP\Attribute\Package\BeforeStage;
|
||||
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||
use StaticPHP\Attribute\Package\Extension;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Package\PackageInstaller;
|
||||
use StaticPHP\Package\PhpExtensionPackage;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Extension('spx')]
|
||||
class spx extends PhpExtensionPackage
|
||||
{
|
||||
#[CustomPhpConfigureArg('Linux')]
|
||||
#[CustomPhpConfigureArg('Darwin')]
|
||||
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||
{
|
||||
$arg = '--enable-SPX' . ($shared ? '=shared' : '');
|
||||
if ($installer->getLibraryPackage('zlib') !== null) {
|
||||
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-spx')]
|
||||
#[PatchDescription('Fix spx extension compile error when building as static')]
|
||||
public function patchBeforeBuildconf(): bool
|
||||
|
||||
Reference in New Issue
Block a user