m4: fix readline macro

The macro always overwrites LIBS and the result is that every binary
links against libreadline.

Instead, save the library to READLINE_LIBS.

See also: 94274c6fcd ('build: fix wrongly linking against libreadline in all applications')

Fixes: af360238be ('m4/ax_lib_readline.m4: Update after running aclocal')
This commit is contained in:
Beniamino Galvani 2021-04-23 13:56:12 +02:00
parent 43a0c6c111
commit b9929b647b

View file

@ -89,7 +89,8 @@ AC_DEFUN([AX_LIB_READLINE], [
])
if test "$ax_cv_lib_readline" != "no"; then
LIBS="$LIBS $ax_cv_lib_readline"
READLINE_LIBS="$ax_cv_lib_readline"
AC_SUBST(READLINE_LIBS)
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
AC_CHECK_HEADERS(readline.h readline/readline.h)