From 6e5944aa67509ba1eff8e1d65e2b85ce395a3a78 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 13 Sep 2024 23:20:47 +0200 Subject: [PATCH] Autotools: Add 4th argument for PHP_SETUP_EDIT macro --- build/php.m4 | 8 +++++--- ext/readline/config.m4 | 16 +++++++--------- sapi/phpdbg/config.m4 | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/php.m4 b/build/php.m4 index ef10cb28b793..f35d73ed754f 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -2004,14 +2004,16 @@ $2], dnl dnl -dnl PHP_SETUP_EDIT([shared-add], [action-if-found], [action-if-not-found]) +dnl PHP_SETUP_EDIT([shared-add], [action-if-found], [action-if-not-found], [not-extension]) dnl -dnl Common setup macro for linking libedit library. +dnl Common setup macro for linking libedit library. If "not-extension" argument +dnl is passed, the found library is appended to the "shared-add" variable +dnl unconditionally (for SAPIs). dnl AC_DEFUN([PHP_SETUP_EDIT], [ PKG_CHECK_MODULES([EDIT], [libedit], [ PHP_EVAL_INCLINE([$EDIT_CFLAGS]) - PHP_EVAL_LIBLINE([$EDIT_LIBS], [$1]) + PHP_EVAL_LIBLINE([$EDIT_LIBS], [$1], [$4]) AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if 'libedit' library is available.]) $2 diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 index 2e38fefcb87a..cf3475183bf8 100644 --- a/ext/readline/config.m4 +++ b/ext/readline/config.m4 @@ -25,28 +25,26 @@ if test "$PHP_READLINE" != "no"; then PHP_CHECK_LIBRARY([edit], [rl_callback_read_char], [AC_DEFINE([HAVE_RL_CALLBACK_READ_CHAR], [1], - [Define to 1 if edit/readline library has the 'rl_callback_read_char' - function.])], + [Define to 1 if edit library has the 'rl_callback_read_char' function.])], [], [$READLINE_SHARED_LIBADD]) PHP_CHECK_LIBRARY([edit], [rl_on_new_line], [AC_DEFINE([HAVE_RL_ON_NEW_LINE], [1], - [Define to 1 if edit/readline library has the 'rl_on_new_line' - function.])], + [Define to 1 if edit library has the 'rl_on_new_line' function.])], [], [$READLINE_SHARED_LIBADD]) PHP_CHECK_LIBRARY([edit], [rl_completion_matches], [AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], [1], - [Define to 1 if edit/readline library has the 'rl_completion_matches' + [Define to 1 if edit library has the 'rl_completion_matches' function.])], [], [$READLINE_SHARED_LIBADD]) PHP_CHECK_LIBRARY([edit], [history_list], [AC_DEFINE([HAVE_HISTORY_LIST], [1], - [Define to 1 if edit/readline library has the 'history_list' function.])], + [Define to 1 if edit library has the 'history_list' function.])], [], [$READLINE_SHARED_LIBADD]) @@ -56,13 +54,13 @@ if test "$PHP_READLINE" != "no"; then LIBS="$LIBS $EDIT_LIBS" AC_CHECK_DECL([rl_erase_empty_line], [AC_DEFINE([HAVE_ERASE_EMPTY_LINE], [1], - [Define to 1 if edit/readline library has the 'rl_erase_empty_line' - global variable.])],, + [Define to 1 if edit library has the 'rl_erase_empty_line' global + variable.])],, [#include ]) CFLAGS=$CFLAGS_SAVE LIBS=$LIBS_SAVE -dnl Add -Wno-strict-prototypes as depends on user libs + dnl Add -Wno-strict-prototypes as depends on user libs PHP_NEW_EXTENSION([readline], [readline.c readline_cli.c], [$ext_shared], diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4 index 79d3202a8d2a..528b927e67cf 100644 --- a/sapi/phpdbg/config.m4 +++ b/sapi/phpdbg/config.m4 @@ -30,7 +30,7 @@ if test "$PHP_PHPDBG" != "no"; then AS_VAR_IF([PHP_PHPDBG_READLINE], [yes], [ PHP_SETUP_EDIT([PHPDBG_EXTRA_LIBS],,, [yes]) AC_DEFINE([HAVE_PHPDBG_READLINE], [1], - [Define to 1 if the phpdbg SAPI has libedit/readline integration.]) + [Define to 1 if the phpdbg SAPI has libedit integration.]) ]) AH_TEMPLATE([HAVE_USERFAULTFD_WRITEFAULT],