add libedit

This commit is contained in:
DubbleClick
2025-10-08 08:16:54 +02:00
parent 384ba54c79
commit 911bc74bf4
6 changed files with 62 additions and 7 deletions

View File

@@ -23,12 +23,7 @@ class readline extends Extension
public function getUnixConfigureArg(bool $shared = false): string
{
$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;
return '--with-libedit=' . BUILD_ROOT_PATH . ' --without-readline';
}
public function buildUnixShared(): void

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
/**
* libedit library class for linux
*/
class libedit extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libedit;
public const NAME = 'libedit';
}

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
/**
* libedit library class for macOS
*/
class libedit extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libedit;
public const NAME = 'libedit';
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
trait libedit
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->configure(
'--with-curses'
)
->make();
$this->patchPkgconfPrefix(['libedit.pc']);
}
}