Skip to content

Commit

Permalink
Autotools: Add 4th argument for PHP_SETUP_EDIT macro
Browse files Browse the repository at this point in the history
  • Loading branch information
petk committed Sep 13, 2024
1 parent 829187c commit 6e5944a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 5 additions & 3 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 7 additions & 9 deletions ext/readline/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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 <editline/readline.h>])
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],
Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 6e5944a

Please sign in to comment.