rework configure args

This commit is contained in:
DubbleClick
2025-05-21 13:19:51 +07:00
parent 95a2f4600b
commit 495e868a71
14 changed files with 24 additions and 33 deletions

View File

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

View File

@@ -53,6 +53,7 @@ class curl extends Extension
{
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lcurl/', $this->getLibFilesString() . $frameworks);
$this->patchBeforeSharedConfigure();
return true;
}
@@ -99,12 +100,6 @@ class curl extends Extension
return true;
}
public function getUnixConfigureArg(bool $shared = false): string
{
return '--with-curl';
}
public function buildUnixShared(): void
{
if (!$this->builder instanceof LinuxBuilder) {

View File

@@ -12,7 +12,7 @@ class dba extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . BUILD_ROOT_PATH) : '';
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH) : '';
return '--enable-dba' . $qdbm;
}

View File

@@ -17,7 +17,7 @@ class dom extends Extension
*/
public function getUnixConfigureArg(bool $shared = false): string
{
$arg = '--enable-dom';
$arg = '--enable-dom' . ($shared ? '=shared' : '');
if (!$shared) {
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
}

View File

@@ -12,7 +12,7 @@ class ffi extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
return '--with-ffi --enable-zend-signals';
return '--with-ffi' . ($shared ? '=shared' : '') . ' --enable-zend-signals';
}
public function getWindowsConfigureArg(bool $shared = false): string

View File

@@ -12,7 +12,7 @@ class gd extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
$arg = '--enable-gd';
$arg = '--enable-gd' . ($shared ? '=shared' : '');
$arg .= $this->builder->getLib('freetype') ? ' --with-freetype' : '';
$arg .= $this->builder->getLib('libjpeg') ? ' --with-jpeg' : '';
$arg .= $this->builder->getLib('libwebp') ? ' --with-webp' : '';

View File

@@ -20,9 +20,4 @@ class ldap extends Extension
}
return true;
}
public function getUnixConfigureArg(bool $shared = false): string
{
return '--with-ldap=' . BUILD_ROOT_PATH;
}
}

View File

@@ -23,7 +23,7 @@ class mbstring extends Extension
public function getUnixConfigureArg(bool $shared = false): string
{
$arg = '--enable-mbstring';
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
if ($this->builder->getExt('mbregex') === null) {
$arg .= ' --disable-mbregex';
} else {

View File

@@ -29,9 +29,7 @@ class xml extends Extension
'simplexml' => '--enable-simplexml',
default => throw new RuntimeException('Not accept non-xml extension'),
};
if (!$shared) {
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
}
$arg .= ($shared ? '=shared' : '' ) . ' --with-libxml="' . BUILD_ROOT_PATH . '"';
return $arg;
}