mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
suggestion and clean up frankenphp build
This commit is contained in:
parent
868f6d408b
commit
65ee7479ac
@ -52,7 +52,7 @@ class swoole extends Extension
|
|||||||
|
|
||||||
// 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'; // we depend on openssl so it's always enabled
|
$arg .= ' --enable-openssl';
|
||||||
|
|
||||||
// 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' : '';
|
||||||
|
|||||||
@ -282,16 +282,18 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
$config = (new SPCConfigUtil($this))->config($this->ext_list, $this->lib_list);
|
$config = (new SPCConfigUtil($this))->config($this->ext_list, $this->lib_list);
|
||||||
|
$cflags = "{$this->arch_c_flags} {$config['cflags']} " . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS');
|
||||||
$libs = $config['libs'];
|
$libs = $config['libs'];
|
||||||
|
|
||||||
if ((str_contains((string) getenv('SPC_DEFAULT_C_FLAGS'), '-fprofile') ||
|
if ((str_contains((string) getenv('SPC_DEFAULT_C_FLAGS'), '-fprofile') ||
|
||||||
str_contains((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'), '-fprofile')) &&
|
str_contains((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'), '-fprofile')) &&
|
||||||
ToolchainManager::getToolchainClass() === GccNativeToolchain::class) {
|
ToolchainManager::getToolchainClass() === GccNativeToolchain::class) {
|
||||||
|
$cflags .= ' -Wno-error=missing-profile';
|
||||||
$libs .= ' -lgcov';
|
$libs .= ' -lgcov';
|
||||||
}
|
}
|
||||||
$env = [
|
$env = [
|
||||||
'CGO_ENABLED' => '1',
|
'CGO_ENABLED' => '1',
|
||||||
'CGO_CFLAGS' => clean_spaces("{$this->arch_c_flags} {$config['cflags']} " . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS')),
|
'CGO_CFLAGS' => clean_spaces($cflags),
|
||||||
'CGO_LDFLAGS' => "{$this->arch_ld_flags} {$staticFlags} {$config['ldflags']} {$libs} {$lrt}",
|
'CGO_LDFLAGS' => "{$this->arch_ld_flags} {$staticFlags} {$config['ldflags']} {$libs} {$lrt}",
|
||||||
'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' .
|
'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' .
|
||||||
'-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . $debugFlags .
|
'-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . $debugFlags .
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user