From 448c8f8e8c1c1eeb88ae468c0c3ab25bed6f2ac8 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 13 Feb 2014 18:59:00 +0100 Subject: [PATCH] build: Don't link with -lreadline if readline was not found. Currently, if libreadline is not installed, linking fails with ld: cannot find -lreadline This patch makes the build succeed by linking para_client, para_audioc and para_play without readline support in this case. --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index b456b53d..75194ffc 100644 --- a/configure.ac +++ b/configure.ac @@ -732,15 +732,17 @@ AC_CHECK_HEADERS([readline/readline.h], [ ]) if test "$have_readline" = "yes"; then - readline_ldflags="$readline_libs -lreadline" - AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"]) + readline_ldflags="$readline_libs" + AC_SEARCH_LIBS([rl_free_keymap], [readline], [ + readline_ldflags="$readline_ldflags -lreadline" + ], [have_readline="no"]) if test "$have_readline" = "no"; then # try with -lcurses # clear cache AC_MSG_NOTICE([trying again with -lcurses]) unset ac_cv_search_rl_free_keymap 2> /dev/null AC_SEARCH_LIBS([rl_free_keymap], [readline], [ have_readline=yes - readline_ldflags="$readline_ldflags -lcurses" + readline_ldflags="$readline_ldflags -lreadline -lcurses" ], [], [-lcurses]) fi if test "$have_readline" = "no"; then # try with -ltermcap @@ -749,7 +751,7 @@ if test "$have_readline" = "yes"; then unset ac_cv_search_rl_free_keymap 2> /dev/null AC_SEARCH_LIBS([rl_free_keymap], [readline], [ have_readline=yes - readline_ldflags="$readline_ldflags -ltermcap" + readline_ldflags="$readline_ldflags -lreadline -ltermcap" ], [], [-ltermcap]) fi fi -- 2.39.5