Skip to content

Commit da5362c

Browse files
authored
Autotools: Add ext/readline preprocessor macros help texts (#15241)
This adds the missing macros help texts for easier understanding. The AC_DEFINE can be called with only 2 arguments if there is another definition in the code where template (see AH_TEMPLATE Autoconf macro) is read by autoheader (the 2nd AC_DEFINE sets the template for all other definitions with the same name).
1 parent 62f75a7 commit da5362c

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

ext/readline/config.m4

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ else
1414
php_with_readline=no
1515
fi
1616

17-
AH_TEMPLATE([HAVE_ERASE_EMPTY_LINE],
18-
[Define to 1 if edit/readline library has 'rl_erase_empty_line' variable.])
19-
2017
if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
2118
for i in $PHP_READLINE /usr/local /usr; do
2219
test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
@@ -47,17 +44,17 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
4744
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])
4845

4946
PHP_CHECK_LIBRARY([readline], [rl_callback_read_char],
50-
[AC_DEFINE([HAVE_RL_CALLBACK_READ_CHAR], [1], [ ])],
47+
[AC_DEFINE([HAVE_RL_CALLBACK_READ_CHAR], [1])],
5148
[],
5249
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])
5350

5451
PHP_CHECK_LIBRARY([readline], [rl_on_new_line],
55-
[AC_DEFINE([HAVE_RL_ON_NEW_LINE], [1], [ ])],
52+
[AC_DEFINE([HAVE_RL_ON_NEW_LINE], [1])],
5653
[],
5754
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])
5855

5956
PHP_CHECK_LIBRARY([readline], [rl_completion_matches],
60-
[AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], [1], [ ])],
57+
[AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], [1])],
6158
[],
6259
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])
6360

@@ -86,7 +83,7 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
8683
LDFLAGS=$LDFLAGS_SAVE
8784
LIBS=$LIBS_SAVE
8885

89-
AC_DEFINE(HAVE_HISTORY_LIST, 1, [ ])
86+
AC_DEFINE([HAVE_HISTORY_LIST], [1])
9087
AC_DEFINE([HAVE_LIBREADLINE], [1],
9188
[Define to 1 if readline extension uses the 'readline' library.])
9289

@@ -110,22 +107,29 @@ elif test "$PHP_LIBEDIT" != "no"; then
110107
[$READLINE_SHARED_LIBADD])
111108

112109
PHP_CHECK_LIBRARY([edit], [rl_callback_read_char],
113-
[AC_DEFINE([HAVE_RL_CALLBACK_READ_CHAR], [1], [ ])],
110+
[AC_DEFINE([HAVE_RL_CALLBACK_READ_CHAR], [1],
111+
[Define to 1 if edit/readline library has the 'rl_callback_read_char'
112+
function.])],
114113
[],
115114
[$READLINE_SHARED_LIBADD])
116115

117116
PHP_CHECK_LIBRARY([edit], [rl_on_new_line],
118-
[AC_DEFINE([HAVE_RL_ON_NEW_LINE], [1], [ ])],
117+
[AC_DEFINE([HAVE_RL_ON_NEW_LINE], [1],
118+
[Define to 1 if edit/readline library has the 'rl_on_new_line'
119+
function.])],
119120
[],
120121
[$READLINE_SHARED_LIBADD])
121122

122123
PHP_CHECK_LIBRARY([edit], [rl_completion_matches],
123-
[AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], [1], [ ])],
124+
[AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], [1],
125+
[Define to 1 if edit/readline library has the 'rl_completion_matches'
126+
function.])],
124127
[],
125128
[$READLINE_SHARED_LIBADD])
126129

127130
PHP_CHECK_LIBRARY([edit], [history_list],
128-
[AC_DEFINE([HAVE_HISTORY_LIST], [1], [ ])],
131+
[AC_DEFINE([HAVE_HISTORY_LIST], [1],
132+
[Define to 1 if edit/readline library has the 'history_list' function.])],
129133
[],
130134
[$READLINE_SHARED_LIBADD])
131135

@@ -134,7 +138,9 @@ elif test "$PHP_LIBEDIT" != "no"; then
134138
CFLAGS="$CFLAGS $EDIT_CFLAGS"
135139
LIBS="$LIBS $EDIT_LIBS"
136140
AC_CHECK_DECL([rl_erase_empty_line],
137-
[AC_DEFINE([HAVE_ERASE_EMPTY_LINE], [1])],,
141+
[AC_DEFINE([HAVE_ERASE_EMPTY_LINE], [1],
142+
[Define to 1 if edit/readline library has the 'rl_erase_empty_line'
143+
global variable.])],,
138144
[#include <editline/readline.h>])
139145
CFLAGS=$CFLAGS_SAVE
140146
LIBS=$LIBS_SAVE

0 commit comments

Comments
 (0)