mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
suggestions
This commit is contained in:
@@ -27,7 +27,12 @@ class readline extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||
$enable = '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||
if ($this->builder->getPHPVersionID() < 84000) {
|
||||
// the check uses `char rl_pending_input()` instead of `extern int rl_pending_input`, which makes LTO fail
|
||||
$enable .= ' ac_cv_lib_readline_rl_pending_input=yes';
|
||||
}
|
||||
return $enable;
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
|
||||
@@ -104,10 +104,6 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
);
|
||||
}
|
||||
|
||||
$extra = '';
|
||||
if ($this->getPHPVersionID() < 84000 && $this->getExt('readline') && $this->getLib('libreadline') !== null) {
|
||||
$extra = 'ac_cv_lib_readline_rl_pending_input=yes';
|
||||
}
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
$php_configure_env . ' ' .
|
||||
@@ -122,8 +118,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$json_74 .
|
||||
$zts .
|
||||
$maxExecutionTimers .
|
||||
$this->makeStaticExtensionArgs() . ' ' .
|
||||
$extra
|
||||
$this->makeStaticExtensionArgs() . ' '
|
||||
);
|
||||
|
||||
$this->emitPatchPoint('before-php-make');
|
||||
|
||||
@@ -11,11 +11,7 @@ use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait librdkafka
|
||||
{
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function build(): void
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/lds-gen.py',
|
||||
@@ -27,6 +23,15 @@ trait librdkafka
|
||||
'#error "IOV_MAX not defined"',
|
||||
"#define IOV_MAX 1024\n#define __GNU__"
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->appendEnv(['CFLAGS' => '-Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-variable'])
|
||||
->optionalLib(
|
||||
|
||||
Reference in New Issue
Block a user