no idea why our source has that uncommented

This commit is contained in:
henderkes 2025-10-21 14:23:55 +02:00
parent 2e13be2a7a
commit 4e393886aa

View File

@ -9,22 +9,22 @@ use SPC\util\executor\UnixAutoconfExecutor;
trait libedit
{
public function patchBeforeBuild(): bool
{
FileSystem::replaceFileStr(
$this->source_dir . '/src/sys.h',
'//#define strl',
'#define strl'
);
return true;
}
protected function build(): void
{
$make = UnixAutoconfExecutor::create($this)
UnixAutoconfExecutor::create($this)
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
->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();
->configure()
->make();
$this->patchPkgconfPrefix(['libedit.pc']);
}
}