mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
add libedit
This commit is contained in:
@@ -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
|
||||
|
||||
15
src/SPC/builder/linux/library/libedit.php
Normal file
15
src/SPC/builder/linux/library/libedit.php
Normal 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';
|
||||
}
|
||||
15
src/SPC/builder/macos/library/libedit.php
Normal file
15
src/SPC/builder/macos/library/libedit.php
Normal 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';
|
||||
}
|
||||
20
src/SPC/builder/unix/library/libedit.php
Normal file
20
src/SPC/builder/unix/library/libedit.php
Normal 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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user