mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
add libedit
This commit is contained in:
parent
384ba54c79
commit
911bc74bf4
@ -687,7 +687,7 @@
|
|||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-path",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"readline"
|
"libedit"
|
||||||
],
|
],
|
||||||
"target": [
|
"target": [
|
||||||
"static"
|
"static"
|
||||||
|
|||||||
@ -946,6 +946,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libedit": {
|
||||||
|
"type": "filelist",
|
||||||
|
"url": "https://thrysoee.dk/editline/",
|
||||||
|
"regex": "/href=\"(?<file>editline-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"readline": {
|
"readline": {
|
||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
||||||
|
|||||||
@ -23,12 +23,7 @@ class readline extends Extension
|
|||||||
|
|
||||||
public function getUnixConfigureArg(bool $shared = false): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$enable = '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
return '--with-libedit=' . BUILD_ROOT_PATH . ' --without-readline';
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildUnixShared(): void
|
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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user