mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +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:
@@ -4,16 +4,27 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait libedit
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($this)
|
||||
$make = UnixAutoconfExecutor::create($this)
|
||||
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
||||
->configure()
|
||||
->make();
|
||||
->configure();
|
||||
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user