File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,19 @@ public function testPHP(int $build_target = BUILD_TARGET_NONE)
169169 */
170170 protected function buildCli (): void
171171 {
172+ if ($ this ->getExt ('readline ' )) {
173+ SourcePatcher::patchFile ('musl_static_readline.patch ' , SOURCE_PATH . '/php-src ' );
174+ }
172175 $ vars = SystemUtil::makeEnvVarString ($ this ->getMakeExtraVars ());
173176 $ SPC_CMD_PREFIX_PHP_MAKE = getenv ('SPC_CMD_PREFIX_PHP_MAKE ' ) ?: 'make ' ;
174177 shell ()->cd (SOURCE_PATH . '/php-src ' )
175178 ->exec ('sed -i "s|//lib|/lib|g" Makefile ' )
176179 ->exec ("{$ SPC_CMD_PREFIX_PHP_MAKE } {$ vars } cli " );
177180
181+ if ($ this ->getExt ('readline ' )) {
182+ SourcePatcher::patchFile ('musl_static_readline.patch ' , SOURCE_PATH . '/php-src ' , true );
183+ }
184+
178185 if (!$ this ->getOption ('no-strip ' , false )) {
179186 shell ()->cd (SOURCE_PATH . '/php-src/sapi/cli ' )->exec ('strip --strip-unneeded php ' );
180187 }
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ protected function build(): void
3838 ->make ();
3939 $ final = FileSystem::scanDirFiles (BUILD_BIN_PATH , relative: true );
4040 // Remove the new files
41- $ new_files = array_diff ($ final , $ filelist );
41+ $ new_files = array_diff ($ final , $ filelist ?: [] );
4242 foreach ($ new_files as $ file ) {
4343 @unlink (BUILD_BIN_PATH . '/ ' . $ file );
4444 }
Original file line number Diff line number Diff line change 1+ diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
2+ index 31212999..d80a21c3 100644
3+ --- a/ext/readline/readline_cli.c
4+ +++ b/ext/readline/readline_cli.c
5+ @@ -739,8 +739,8 @@ typedef cli_shell_callbacks_t *(__cdecl *get_cli_shell_callbacks)(void);
6+ } while(0)
7+
8+ #else
9+ - /*
10+ #ifdef COMPILE_DL_READLINE
11+ + /*
12+ This dlsym() is always used as even the CGI SAPI is linked against "CLI"-only
13+ extensions. If that is being changed dlsym() should only be used when building
14+ this extension sharedto offer compatibility.
15+ @@ -754,9 +754,9 @@ this extension sharedto offer compatibility.
16+ (cb) = get_callbacks(); \
17+ } \
18+ } while(0)
19+ - /*#else
20+ + #else
21+ #define GET_SHELL_CB(cb) (cb) = php_cli_get_shell_callbacks()
22+ - #endif*/
23+ + #endif
24+ #endif
25+
26+ PHP_MINIT_FUNCTION(cli_readline)
You can’t perform that action at this time.
0 commit comments