From b9929b647b708441ea823e961049d86e4562753d Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 23 Apr 2021 13:56:12 +0200 Subject: [PATCH] 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: 94274c6fcdc7 ('build: fix wrongly linking against libreadline in all applications') Fixes: af360238be19 ('m4/ax_lib_readline.m4: Update after running aclocal') --- m4/ax_lib_readline.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m4/ax_lib_readline.m4 b/m4/ax_lib_readline.m4 index 0d0822bce6..7efa947e47 100644 --- a/m4/ax_lib_readline.m4 +++ b/m4/ax_lib_readline.m4 @@ -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)