mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
don't request configurearg if it's not used (ease debugging)
This commit is contained in:
parent
7e0e9091be
commit
448941f741
@ -842,11 +842,15 @@
|
|||||||
"nghttp2",
|
"nghttp2",
|
||||||
"zlib"
|
"zlib"
|
||||||
],
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"zstd"
|
||||||
|
],
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"openssl",
|
"openssl",
|
||||||
"curl"
|
"curl"
|
||||||
],
|
],
|
||||||
"ext-suggests": [
|
"ext-suggests": [
|
||||||
|
"sockets",
|
||||||
"swoole-hook-pgsql",
|
"swoole-hook-pgsql",
|
||||||
"swoole-hook-mysql",
|
"swoole-hook-mysql",
|
||||||
"swoole-hook-sqlite"
|
"swoole-hook-sqlite"
|
||||||
|
|||||||
@ -268,11 +268,11 @@ abstract class BuilderBase
|
|||||||
{
|
{
|
||||||
$ret = [];
|
$ret = [];
|
||||||
foreach ($this->getExts() as $ext) {
|
foreach ($this->getExts() as $ext) {
|
||||||
$arg = $ext->getConfigureArg();
|
$arg = null;
|
||||||
if ($ext->isBuildShared() && !$ext->isBuildStatic()) {
|
if ($ext->isBuildShared() && !$ext->isBuildStatic()) {
|
||||||
if (
|
if (
|
||||||
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
|
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
|
||||||
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
|
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
|
||||||
Config::getExt($ext->getName(), 'build-with-php') === true
|
Config::getExt($ext->getName(), 'build-with-php') === true
|
||||||
) {
|
) {
|
||||||
$arg = $ext->getConfigureArg(true);
|
$arg = $ext->getConfigureArg(true);
|
||||||
@ -280,6 +280,7 @@ abstract class BuilderBase
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$arg ??= $ext->getConfigureArg();
|
||||||
logger()->info($ext->getName() . ' is using ' . $arg);
|
logger()->info($ext->getName() . ' is using ' . $arg);
|
||||||
$ret[] = trim($arg);
|
$ret[] = trim($arg);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,14 +43,16 @@ class swoole extends Extension
|
|||||||
public function getUnixConfigureArg(bool $shared = false): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
// enable swoole
|
// enable swoole
|
||||||
$arg = '--enable-swoole';
|
$arg = '--enable-swoole' . ($shared ? '=shared' : '');
|
||||||
|
|
||||||
// commonly-used feature: coroutine-time, disable-thread-context
|
// commonly-used feature: coroutine-time
|
||||||
$arg .= ' --enable-swoole-coro-time --disable-thread-context';
|
$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)
|
// 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 .= $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)
|
// 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' : '';
|
$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('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
||||||
}
|
}
|
||||||
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-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.
|
// 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)
|
// 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';
|
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
||||||
|
|
||||||
// additional feature: swoole-mysql
|
// 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
|
// enable this feature , need remove pdo_sqlite
|
||||||
// more info : https://wenda.swoole.com/detail/109023
|
// more info : https://wenda.swoole.com/detail/109023
|
||||||
|
|||||||
@ -27,8 +27,7 @@ class swoole_hook_pgsql extends Extension
|
|||||||
|
|
||||||
public function getUnixConfigureArg(bool $shared = false): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
// enable swoole pgsql hook
|
return ''; // enabled in swoole.php
|
||||||
return '--enable-swoole-pgsql';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function runCliCheckUnix(): void
|
public function runCliCheckUnix(): void
|
||||||
|
|||||||
@ -27,8 +27,7 @@ class swoole_hook_sqlite extends Extension
|
|||||||
|
|
||||||
public function getUnixConfigureArg(bool $shared = false): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
// enable swoole pgsql hook
|
return ''; // enabled in swoole.php
|
||||||
return '--enable-swoole-sqlite';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function runCliCheckUnix(): void
|
public function runCliCheckUnix(): void
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user