30 lines
784 B
PHP
Raw Normal View History

2024-07-06 21:56:42 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
2025-05-21 17:57:53 +07:00
use SPC\store\FileSystem;
2024-07-06 21:56:42 +08:00
use SPC\util\CustomExt;
#[CustomExt('spx')]
class spx extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
2024-07-06 21:56:42 +08:00
{
2025-05-06 16:22:37 +07:00
$arg = '--enable-spx';
2024-07-06 21:56:42 +08:00
if ($this->builder->getExt('zlib') === null) {
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
}
return $arg;
}
2025-05-21 17:57:53 +07:00
public function patchBeforeSharedConfigure(): bool
{
FileSystem::replaceFileStr($this->source_dir . '/config.m4', 'PHP_ARG_ENABLE(SPX-DEV,', 'PHP_ARG_ENABLE(spx-dev,');
FileSystem::replaceFileStr($this->source_dir . '/config.m4', 'PHP_ARG_ENABLE(SPX,', 'PHP_ARG_ENABLE(spx,');
return true;
}
2024-07-06 21:56:42 +08:00
}