don't request configurearg if it's not used (ease debugging)

This commit is contained in:
DubbleClick
2025-08-25 12:36:10 +07:00
parent 7e0e9091be
commit 448941f741
5 changed files with 19 additions and 11 deletions

View File

@@ -43,14 +43,16 @@ class swoole extends Extension
public function getUnixConfigureArg(bool $shared = false): string
{
// enable swoole
$arg = '--enable-swoole';
$arg = '--enable-swoole' . ($shared ? '=shared' : '');
// commonly-used feature: coroutine-time, disable-thread-context
$arg .= ' --enable-swoole-coro-time --disable-thread-context';
// commonly-used feature: coroutine-time
$arg .= ' --enable-swoole-coro-time --with-pic';
$arg .= $this->builder->getOption('enable-zts') ? ' --enable-thread-context' : ' --disable-thread-context';
// required feature: curl, openssl (but curl hook is buggy for php 8.0)
$arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
$arg .= ' --enable-openssl';
$arg .= ' --enable-openssl'; // we depend on openssl so it's always enabled
// additional feature: c-ares, brotli, nghttp2 (can be disabled, but we enable it by default in config to support full network feature)
$arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : '';
@@ -58,13 +60,16 @@ class swoole extends Extension
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
}
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
$arg .= $this->builder->getLib('iouring') ? ' --enable-iouring' : '';
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
// additional feature: swoole-pgsql, it should depend on lib [postgresql], but it will lack of CFLAGS etc.
// so this is a tricky way (enable ext [pgsql,pdo] to add postgresql hook and pdo_pgsql support)
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
// additional feature: swoole-mysql
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-swoole-mysql' : ' --disable-swoole-mysql';
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
// enable this feature , need remove pdo_sqlite
// more info : https://wenda.swoole.com/detail/109023