31 lines
802 B
PHP
Raw Normal View History

2025-10-08 08:16:54 +02:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
2025-10-08 08:16:54 +02:00
use SPC\util\executor\UnixAutoconfExecutor;
trait libedit
{
protected function build(): void
{
$make = UnixAutoconfExecutor::create($this)
2025-10-08 09:26:20 +02:00
->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();
2025-10-08 08:16:54 +02:00
$this->patchPkgconfPrefix(['libedit.pc']);
}
}