mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
switch readline to libedit (#919)
This commit is contained in:
commit
487c6da4ac
@ -105,8 +105,6 @@ SPC_MICRO_PATCHES=cli_checks,disable_huge_page
|
|||||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||||
; configure command
|
; configure command
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --with-pic"
|
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --with-pic"
|
||||||
; make command
|
|
||||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
; *** default build vars for building php ***
|
||||||
; embed type for php, static (libphp.a) or shared (libphp.so)
|
; embed type for php, static (libphp.a) or shared (libphp.so)
|
||||||
@ -139,8 +137,6 @@ SPC_MICRO_PATCHES=cli_checks,macos_iconv
|
|||||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||||
; configure command
|
; configure command
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-phpdbg"
|
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-phpdbg"
|
||||||
; make command
|
|
||||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
; *** default build vars for building php ***
|
||||||
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
@ -345,6 +345,15 @@
|
|||||||
],
|
],
|
||||||
"cpp-library": true
|
"cpp-library": true
|
||||||
},
|
},
|
||||||
|
"libedit": {
|
||||||
|
"source": "libedit",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libedit.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"ncurses"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libevent": {
|
"libevent": {
|
||||||
"source": "libevent",
|
"source": "libevent",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@ -498,6 +498,16 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libedit": {
|
||||||
|
"type": "filelist",
|
||||||
|
"url": "https://thrysoee.dk/editline/",
|
||||||
|
"regex": "/href=\"(?<file>libedit-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libevent": {
|
"libevent": {
|
||||||
"type": "ghrel",
|
"type": "ghrel",
|
||||||
"repo": "libevent/libevent",
|
"repo": "libevent/libevent",
|
||||||
@ -546,7 +556,7 @@
|
|||||||
"provide-pre-built": true,
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "COPYING.LIB"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libiconv-win": {
|
"libiconv-win": {
|
||||||
|
|||||||
@ -305,7 +305,7 @@ class Extension
|
|||||||
// Run compile check if build target is cli
|
// Run compile check if build target is cli
|
||||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new ValidationException(
|
throw new ValidationException(
|
||||||
"extension {$this->getName()} failed compile check: php-cli returned {$ret}",
|
"extension {$this->getName()} failed compile check: php-cli returned {$ret}",
|
||||||
@ -335,7 +335,7 @@ class Extension
|
|||||||
{
|
{
|
||||||
// Run compile check if build target is cli
|
// Run compile check if build target is cli
|
||||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||||
[$ret] = cmd()->execWithResult(BUILD_ROOT_PATH . '/bin/php.exe -n --ri "' . $this->getDistName() . '"', false);
|
[$ret] = cmd()->execWithResult(BUILD_BIN_PATH . '/php.exe -n --ri "' . $this->getDistName() . '"', false);
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
|
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\ValidationException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
@ -23,12 +24,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 --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
|
||||||
@ -39,4 +35,13 @@ class readline extends Extension
|
|||||||
}
|
}
|
||||||
parent::buildUnixShared();
|
parent::buildUnixShared();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function runCliCheckUnix(): void
|
||||||
|
{
|
||||||
|
parent::runCliCheckUnix();
|
||||||
|
[$ret, $out] = shell()->execWithResult('printf "exit\n" | ' . BUILD_BIN_PATH . '/php -a');
|
||||||
|
if ($ret !== 0 || !str_contains(implode("\n", $out), 'Interactive shell')) {
|
||||||
|
throw new ValidationException("readline extension failed sanity check. Code: {$ret}, output: " . implode("\n", $out));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,19 +107,19 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
|
|
||||||
$this->seekPhpSrcLogFileOnException(fn () => shell()->cd(SOURCE_PATH . '/php-src')->exec(
|
$this->seekPhpSrcLogFileOnException(fn () => shell()->cd(SOURCE_PATH . '/php-src')->exec(
|
||||||
$php_configure_env . ' ' .
|
$php_configure_env . ' ' .
|
||||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||||
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||||
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
||||||
($enableCgi ? '--enable-cgi ' : '--disable-cgi ') .
|
($enableCgi ? '--enable-cgi ' : '--disable-cgi ') .
|
||||||
$config_file_path .
|
$config_file_path .
|
||||||
$config_file_scan_dir .
|
$config_file_scan_dir .
|
||||||
$json_74 .
|
$json_74 .
|
||||||
$zts .
|
$zts .
|
||||||
$maxExecutionTimers .
|
$maxExecutionTimers .
|
||||||
"{$phpvars} " .
|
$phpvars . ' ' .
|
||||||
$this->makeStaticExtensionArgs() . ' '
|
$this->makeStaticExtensionArgs() . ' '
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->emitPatchPoint('before-php-make');
|
$this->emitPatchPoint('before-php-make');
|
||||||
@ -179,16 +179,17 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
*/
|
*/
|
||||||
protected function buildCli(): void
|
protected function buildCli(): void
|
||||||
{
|
{
|
||||||
if ($this->getExt('readline')) {
|
if ($this->getExt('readline') && SPCTarget::isStatic()) {
|
||||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
->exec("make {$concurrency} {$vars} cli");
|
||||||
|
|
||||||
if ($this->getExt('readline')) {
|
if ($this->getExt('readline') && SPCTarget::isStatic()) {
|
||||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src', true);
|
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,10 +207,10 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
protected function buildCgi(): void
|
protected function buildCgi(): void
|
||||||
{
|
{
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cgi");
|
->exec("make {$concurrency} {$vars} cgi");
|
||||||
|
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/cgi')->exec('strip --strip-unneeded php-cgi');
|
shell()->cd(SOURCE_PATH . '/php-src/sapi/cgi')->exec('strip --strip-unneeded php-cgi');
|
||||||
@ -241,11 +242,11 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
// patch fake cli for micro
|
// patch fake cli for micro
|
||||||
$vars['EXTRA_CFLAGS'] .= $enable_fake_cli;
|
$vars['EXTRA_CFLAGS'] .= $enable_fake_cli;
|
||||||
$vars = SystemUtil::makeEnvVarString($vars);
|
$vars = SystemUtil::makeEnvVarString($vars);
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
|
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} micro");
|
->exec("make {$concurrency} {$vars} micro");
|
||||||
|
|
||||||
$this->processMicroUPX();
|
$this->processMicroUPX();
|
||||||
|
|
||||||
@ -262,10 +263,10 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
protected function buildFpm(): void
|
protected function buildFpm(): void
|
||||||
{
|
{
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} fpm");
|
->exec("make {$concurrency} {$vars} fpm");
|
||||||
|
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/fpm')->exec('strip --strip-unneeded php-fpm');
|
shell()->cd(SOURCE_PATH . '/php-src/sapi/fpm')->exec('strip --strip-unneeded php-fpm');
|
||||||
@ -283,11 +284,11 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
protected function buildEmbed(): void
|
protected function buildEmbed(): void
|
||||||
{
|
{
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||||
->exec('sed -i "s|^EXTENSION_DIR = .*|EXTENSION_DIR = /' . basename(BUILD_MODULES_PATH) . '|" Makefile')
|
->exec('sed -i "s|^EXTENSION_DIR = .*|EXTENSION_DIR = /' . basename(BUILD_MODULES_PATH) . '|" Makefile')
|
||||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install");
|
||||||
|
|
||||||
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS') ?: '';
|
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS') ?: '';
|
||||||
$libDir = BUILD_LIB_PATH;
|
$libDir = BUILD_LIB_PATH;
|
||||||
|
|||||||
12
src/SPC/builder/linux/library/libedit.php
Normal file
12
src/SPC/builder/linux/library/libedit.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class libedit extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libedit;
|
||||||
|
|
||||||
|
public const NAME = 'libedit';
|
||||||
|
}
|
||||||
@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\linux\library;
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
/**
|
|
||||||
* gmp is a template library class for unix
|
|
||||||
*/
|
|
||||||
class readline extends LinuxLibraryBase
|
class readline extends LinuxLibraryBase
|
||||||
{
|
{
|
||||||
use \SPC\builder\unix\library\readline;
|
use \SPC\builder\unix\library\readline;
|
||||||
|
|||||||
@ -186,8 +186,8 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
|
|
||||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
$shell->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
$shell->exec("make {$concurrency} {$vars} cli");
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip -S sapi/cli/php');
|
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip -S sapi/cli/php');
|
||||||
}
|
}
|
||||||
@ -199,8 +199,8 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
|
|
||||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
$shell->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cgi");
|
$shell->exec("make {$concurrency} {$vars} cgi");
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
$shell->exec('dsymutil -f sapi/cgi/php-cgi')->exec('strip -S sapi/cgi/php-cgi');
|
$shell->exec('dsymutil -f sapi/cgi/php-cgi')->exec('strip -S sapi/cgi/php-cgi');
|
||||||
}
|
}
|
||||||
@ -229,7 +229,8 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
|
|
||||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||||
// build
|
// build
|
||||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} micro");
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
|
$shell->exec("make {$concurrency} {$vars} micro");
|
||||||
// strip
|
// strip
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
$shell->exec('dsymutil -f sapi/micro/micro.sfx')->exec('strip -S sapi/micro/micro.sfx');
|
$shell->exec('dsymutil -f sapi/micro/micro.sfx')->exec('strip -S sapi/micro/micro.sfx');
|
||||||
@ -250,7 +251,8 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
|
|
||||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} fpm");
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
|
$shell->exec("make {$concurrency} {$vars} fpm");
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip -S sapi/fpm/php-fpm');
|
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip -S sapi/fpm/php-fpm');
|
||||||
}
|
}
|
||||||
@ -263,9 +265,9 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
protected function buildEmbed(): void
|
protected function buildEmbed(): void
|
||||||
{
|
{
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
|
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install");
|
||||||
|
|
||||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
|
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
|
||||||
$AR = getenv('AR') ?: 'ar';
|
$AR = getenv('AR') ?: 'ar';
|
||||||
|
|||||||
12
src/SPC/builder/macos/library/libedit.php
Normal file
12
src/SPC/builder/macos/library/libedit.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class libedit extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libedit;
|
||||||
|
|
||||||
|
public const NAME = 'libedit';
|
||||||
|
}
|
||||||
@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\macos\library;
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
/**
|
|
||||||
* gmp is a template library class for unix
|
|
||||||
*/
|
|
||||||
class readline extends MacOSLibraryBase
|
class readline extends MacOSLibraryBase
|
||||||
{
|
{
|
||||||
use \SPC\builder\unix\library\readline;
|
use \SPC\builder\unix\library\readline;
|
||||||
|
|||||||
19
src/SPC/builder/unix/library/libedit.php
Normal file
19
src/SPC/builder/unix/library/libedit.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\util\executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
|
trait libedit
|
||||||
|
{
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
UnixAutoconfExecutor::create($this)
|
||||||
|
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
||||||
|
->configure()
|
||||||
|
->make();
|
||||||
|
$this->patchPkgconfPrefix(['libedit.pc']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -26,10 +26,10 @@ $test_os = [
|
|||||||
'macos-15-intel', // bin/spc for x86_64
|
'macos-15-intel', // bin/spc for x86_64
|
||||||
'macos-15', // bin/spc for arm64
|
'macos-15', // bin/spc for arm64
|
||||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||||
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
'ubuntu-24.04', // bin/spc for x86_64
|
||||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||||
// 'windows-latest', // .\bin\spc.ps1
|
// 'windows-latest', // .\bin\spc.ps1
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user