This commit is contained in:
DubbleClick
2025-05-21 17:57:53 +07:00
parent fd5bc54cd0
commit 11c116480f
7 changed files with 67 additions and 17 deletions

View File

@@ -26,7 +26,8 @@ class mbregex extends Extension
*/
public function runCliCheckUnix(): void
{
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "mbstring" | grep regex', false);
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=' . BUILD_MODULES_PATH . '/mbstring.so"' : '';
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false);
if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
}

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('spx')]
@@ -18,4 +19,11 @@ class spx extends Extension
}
return $arg;
}
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;
}
}