build: fix wrongly linking against libreadline in all applications
authorThomas Haller <thaller@redhat.com>
Wed, 26 Nov 2014 10:40:40 +0000 (11:40 +0100)
committerThomas Haller <thaller@redhat.com>
Wed, 26 Nov 2014 10:43:23 +0000 (11:43 +0100)
Every Makefile in the subtrees would include -lreadline
as part of LIBS, hence every application would link against
the library.

This was broken since we added 'm4/ax_lib_readline.m4'.

Fixes: 29297f8531e24d4df616c5c3acace9e23a695a02

m4/ax_lib_readline.m4

index 8a05574..fe56c5b 100644 (file)
@@ -90,6 +90,7 @@ AC_DEFUN([AX_LIB_READLINE], [
     AC_MSG_ERROR([readline library with terminfo support is required (one of ncurses, curses, or termcap)])
   fi
 
+  ORIG_LIBS="$LIBS"
   LIBS="$LIBS $ax_cv_lib_readline"
   AC_CHECK_HEADERS(readline.h readline/readline.h)
 
@@ -114,6 +115,7 @@ AC_DEFUN([AX_LIB_READLINE], [
     AC_MSG_ERROR(rl_echo_signal_char() is required (install readline6?))
   fi
 
+  LIBS="$ORIG_LIBS"
   READLINE_LIBS="$ax_cv_lib_readline"
   AC_SUBST(READLINE_LIBS)
 ])dnl