mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
prevent libedit from building strlcat/strlcpy, no idea why their soure code doesn't prevent this correctly itself
This commit is contained in:
parent
41fb29eba4
commit
2e13be2a7a
@ -4,16 +4,27 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\unix\library;
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\executor\UnixAutoconfExecutor;
|
use SPC\util\executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
trait libedit
|
trait libedit
|
||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
UnixAutoconfExecutor::create($this)
|
$make = UnixAutoconfExecutor::create($this)
|
||||||
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
||||||
->configure()
|
->configure();
|
||||||
->make();
|
|
||||||
|
foreach (['strlcpy', 'strlcat', 'fgetln'] as $symbol) {
|
||||||
|
$usymbol = strtoupper($symbol);
|
||||||
|
FileSystem::replaceFileLineContainsString(
|
||||||
|
$this->source_dir . '/config.h',
|
||||||
|
"/* #undef HAVE_{$usymbol} */",
|
||||||
|
"/* #undef HAVE_{$usymbol} */\n#define {$symbol} libedit_{$symbol}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$make->make();
|
||||||
$this->patchPkgconfPrefix(['libedit.pc']);
|
$this->patchPkgconfPrefix(['libedit.pc']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class SourcePatcher
|
|||||||
}
|
}
|
||||||
foreach ($builder->getLibs() as $lib) {
|
foreach ($builder->getLibs() as $lib) {
|
||||||
if ($lib->patchBeforeBuildconf() === true) {
|
if ($lib->patchBeforeBuildconf() === true) {
|
||||||
logger()->info("Library [{$lib->getName()}]patched before buildconf");
|
logger()->info("Library [{$lib->getName()}] patched before buildconf");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// patch windows php 8.1 bug
|
// patch windows php 8.1 bug
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user