apply suggestions

This commit is contained in:
DubbleClick
2025-06-06 23:49:58 +07:00
parent b6a1182876
commit a68212672b
8 changed files with 17 additions and 64 deletions

View File

@@ -22,7 +22,7 @@ class curl extends Extension
{
logger()->info('patching before-configure for curl checks');
$file1 = "AC_DEFUN([PHP_CHECK_LIBRARY], [\n $3\n])";
$files = FileSystem::readFile(SOURCE_PATH . '/php-src/ext/curl/config.m4');
$files = FileSystem::readFile($this->source_dir . '/config.m4');
$file2 = 'AC_DEFUN([PHP_CHECK_LIBRARY], [
save_old_LDFLAGS=$LDFLAGS
ac_stuff="$5"
@@ -41,7 +41,7 @@ class curl extends Extension
$4
])dnl
])';
file_put_contents(SOURCE_PATH . '/php-src/ext/curl/config.m4', $file1 . "\n" . $files . "\n" . $file2);
file_put_contents($this->source_dir . '/config.m4', $file1 . "\n" . $files . "\n" . $file2);
return true;
}
@@ -59,7 +59,7 @@ class curl extends Extension
public function patchBeforeSharedConfigure(): bool
{
$file = SOURCE_PATH . '/php-src/ext/curl/config.m4';
$file = $this->source_dir . '/config.m4';
$content = FileSystem::readFile($file);
// Inject patch before it

View File

@@ -30,6 +30,6 @@ class dom extends Extension
public function getWindowsConfigureArg($shared = false): string
{
return '--with-dom --with-libxml';
return '--with-dom';
}
}

View File

@@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
use SPC\util\SPCConfigUtil;
#[CustomExt('pdo_sqlsrv')]
class pdo_sqlsrv extends Extension
{
public function buildUnixShared(): void
{
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()]);
$env = [
'CFLAGS' => $config['cflags'],
'CXXFLAGS' => $config['cflags'],
'LDFLAGS' => $config['ldflags'],
'LIBS' => $config['libs'],
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
];
// prepare configure args
shell()->cd($this->source_dir)
->setEnv($env)
->execWithEnv(BUILD_BIN_PATH . '/phpize')
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static --with-pic')
->execWithEnv('make clean')
->execWithEnv('make -j' . $this->builder->concurrency)
->execWithEnv('make install');
}
}

View File

@@ -39,12 +39,9 @@ class pgsql extends Extension
$libfiles = $this->getLibFilesString();
$libfiles = str_replace(BUILD_LIB_PATH . '/lib', '-l', $libfiles);
$libfiles = str_replace('.a', '', $libfiles);
$libfiles = str_replace(' -lpq', '', $libfiles);
$libfiles = str_replace(' -lpgport', '', $libfiles);
$libfiles = str_replace(' -lpgcommon', '', $libfiles);
return '--with-pgsql' . ($shared ? '=shared' : '') .
' PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH .
' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' -lpq -lpgport -lpgcommon ' . $libfiles . '"';
' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' ' . $libfiles . '"';
}
return '--with-pgsql=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH;
}