From: Andre Noll Date: Thu, 13 Feb 2014 17:59:00 +0000 (+0100) Subject: build: Don't link with -lreadline if readline was not found. X-Git-Tag: v0.5.2~6^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=448c8f8e8c1c1eeb88ae468c0c3ab25bed6f2ac8;p=paraslash.git 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. --- 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