2024-07-06 21:56:42 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
|
|
|
|
use SPC\exception\WrongUsageException;
|
|
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('spx')]
|
|
|
|
|
class spx extends Extension
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws WrongUsageException
|
|
|
|
|
*/
|
|
|
|
|
public function validate(): void
|
|
|
|
|
{
|
|
|
|
|
if ($this->builder->getOption('enable-zts')) {
|
|
|
|
|
throw new WrongUsageException('ext-spx is not thread safe, do not build it with ZTS builds');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-27 11:12:19 +07:00
|
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
2024-07-06 21:56:42 +08:00
|
|
|
{
|
|
|
|
|
$arg = '--enable-spx';
|
|
|
|
|
if ($this->builder->getExt('zlib') === null) {
|
|
|
|
|
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
|
|
|
|
}
|
|
|
|
|
return $arg;
|
|
|
|
|
}
|
|
|
|
|
}
|