Skip to content

Autotools: Fix rl_erase_empty_line check #15109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ext/readline/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,18 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
])

CFLAGS_SAVE=$CFLAGS
LDFLAGS_SAVE=$LDFLAGS
LIBS_SAVE=$LIBS
CFLAGS="$CFLAGS $INCLUDES"
LDFLAGS="$LDFLAGS -L$READLINE_DIR/$PHP_LIBDIR"
LIBS="$LIBS -lreadline"
AC_CHECK_DECL([rl_erase_empty_line],
[AC_DEFINE([HAVE_ERASE_EMPTY_LINE], [1])],,
[#include <readline/readline.h>])
CFLAGS=$CFLAGS_SAVE
LDFLAGS=$LDFLAGS_SAVE
LIBS=$LIBS_SAVE

AC_DEFINE(HAVE_HISTORY_LIST, 1, [ ])
AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
Expand Down Expand Up @@ -140,9 +149,15 @@ elif test "$PHP_LIBEDIT" != "no"; then
$READLINE_SHARED_LIBADD
])

CFLAGS_SAVE=$CFLAGS
LIBS_SAVE=$LIBS
CFLAGS="$CFLAGS $EDIT_CFLAGS"
LIBS="$LIBS $EDIT_LIBS"
AC_CHECK_DECL([rl_erase_empty_line],
[AC_DEFINE([HAVE_ERASE_EMPTY_LINE], [1])],,
[#include <editline/readline.h>])
CFLAGS=$CFLAGS_SAVE
LIBS=$LIBS_SAVE

AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
fi
Expand Down
Loading