fix shared bz2 build

This commit is contained in:
henderkes
2025-05-17 19:00:57 +07:00
parent 872673655e
commit 76a9be2167
2 changed files with 9 additions and 0 deletions

View File

@@ -275,6 +275,10 @@ class Extension
*/ */
public function buildShared(): void public function buildShared(): void
{ {
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
logger()->info('extension ' . $this->getName() . ' already built, skipping');
return;
}
match (PHP_OS_FAMILY) { match (PHP_OS_FAMILY) {
'Darwin', 'Linux' => $this->buildUnixShared(), 'Darwin', 'Linux' => $this->buildUnixShared(),
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'), default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),

View File

@@ -24,4 +24,9 @@ class bz2 extends Extension
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lbz2/', $this->getLibFilesString() . $frameworks); FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lbz2/', $this->getLibFilesString() . $frameworks);
return true; return true;
} }
public function getUnixConfigureArg(bool $shared = false): string
{
return $shared ? '--with-bz2=' . BUILD_ROOT_PATH : '';
}
} }