From: Mark Andrews Date: Wed, 12 Oct 2016 00:56:59 +0000 (+1100) Subject: further readline changes [RT #43139] X-Git-Tag: v9.12.0a1~724 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=09f914d2d4b693cb597d252b70e79c5e553c2e8a;p=thirdparty%2Fbind9.git further readline changes [RT #43139] --- diff --git a/configure b/configure index 49be448a498..6629a6bb15a 100755 --- a/configure +++ b/configure @@ -19073,20 +19073,24 @@ fi # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : - withval=$with_readline; readline="$withval" + withval=$with_readline; use_readline="$withval" else - readline="auto" + use_readline="auto" fi -case "$readline" in +case "$use_readline" in no) ;; -yes|auto) +*) saved_LIBS="$LIBS" - for xreadline in -ledit -lreadline + case "$use_readline" in + yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;; + *) try_readline="$use_readline" + esac + for readline in "$try_readline" $or_readline do - LIBS="$xreadline" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $xreadline" >&5 -$as_echo "$as_me: checking for readline with $xreadline" >&6;} + LIBS="$readline" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $readline" >&5 +$as_echo "$as_me: checking for readline with $readline" >&6;} for ac_func in readline do : ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline" @@ -19100,15 +19104,15 @@ done if test "$ac_cv_func_readline" = "yes" then - READLINE_LIB="$xreadline" + READLINE_LIB="$readline" break fi for lib in -lterminfo -ltermcap -lncurses -lcurses do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $xreadline $lib" >&5 -$as_echo "$as_me: checking for readline with $xreadline $lib" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $readline $lib" >&5 +$as_echo "$as_me: checking for readline with $readline $lib" >&6;} unset ac_cv_func_readline - LIBS="$xreadline $lib" + LIBS="$readline $lib" for ac_func in readline do : ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline" @@ -19122,7 +19126,7 @@ done if test "$ac_cv_func_readline" = "yes" then - READLINE_LIB="$xreadline $lib" + READLINE_LIB="$readline $lib" break fi done @@ -19131,57 +19135,8 @@ done break fi done - if test "X$xreadline" = Xyes -a "$ac_cv_func_readline" != yes - then - as_fn_error $? "The readline library was not found." "$LINENO" 5 - fi - LIBS="$saved_LIBS" - ;; -*) - saved_LIBS="$LIBS" - LIBS="$readline" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $readline" >&5 -$as_echo "$as_me: checking for readline with $readline" >&6;} - for ac_func in readline -do : - ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline" -if test "x$ac_cv_func_readline" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_READLINE 1 -_ACEOF - -fi -done - - if test "$ac_cv_func_readline" = "yes" - then - READLINE_LIB="$readline" - else - for lib in -lterminfo -ltermcap -lncurses -lcurses - do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline with $readline $lib" >&5 -$as_echo "$as_me: checking for readline with $readline $lib" >&6;} - unset ac_cv_func_readline - LIBS="$readline $lib" - for ac_func in readline -do : - ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline" -if test "x$ac_cv_func_readline" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_READLINE 1 -_ACEOF - -fi -done - - if test "$ac_cv_func_readline" = "yes" - then - READLINE_LIB="$readline $lib" - break - fi - done - fi - if test "$ac_cv_func_readline" != yes + if test "$use_readline" != "auto" && + test "X$READLINE_LIB" = "X" then as_fn_error $? "The readline library was not found." "$LINENO" 5 fi diff --git a/configure.in b/configure.in index 4b8a9fd7d8f..d43b56d9461 100644 --- a/configure.in +++ b/configure.in @@ -3436,30 +3436,34 @@ AC_SUBST(ISC_PLATFORM_NEEDSTRCASESTR) AC_SUBST(READLINE_LIB) AC_ARG_WITH(readline, [ --with-readline[=LIBSPEC] specify readline library [default auto]], - readline="$withval", readline="auto") -case "$readline" in + use_readline="$withval", use_readline="auto") +case "$use_readline" in no) ;; -yes|auto) +*) saved_LIBS="$LIBS" - for xreadline in -ledit -lreadline + case "$use_readline" in + yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;; + *) try_readline="$use_readline" + esac + for readline in "$try_readline" $or_readline do - LIBS="$xreadline" - AC_MSG_NOTICE(checking for readline with $xreadline) + LIBS="$readline" + AC_MSG_NOTICE(checking for readline with $readline) AC_CHECK_FUNCS(readline) if test "$ac_cv_func_readline" = "yes" then - READLINE_LIB="$xreadline" + READLINE_LIB="$readline" break fi for lib in -lterminfo -ltermcap -lncurses -lcurses do - AC_MSG_NOTICE(checking for readline with $xreadline $lib) + AC_MSG_NOTICE(checking for readline with $readline $lib) unset ac_cv_func_readline - LIBS="$xreadline $lib" + LIBS="$readline $lib" AC_CHECK_FUNCS(readline) if test "$ac_cv_func_readline" = "yes" then - READLINE_LIB="$xreadline $lib" + READLINE_LIB="$readline $lib" break fi done @@ -3468,35 +3472,8 @@ yes|auto) break fi done - if test "X$xreadline" = Xyes -a "$ac_cv_func_readline" != yes - then - AC_MSG_ERROR([The readline library was not found.]) - fi - LIBS="$saved_LIBS" - ;; -*) - saved_LIBS="$LIBS" - LIBS="$readline" - AC_MSG_NOTICE(checking for readline with $readline) - AC_CHECK_FUNCS(readline) - if test "$ac_cv_func_readline" = "yes" - then - READLINE_LIB="$readline" - else - for lib in -lterminfo -ltermcap -lncurses -lcurses - do - AC_MSG_NOTICE(checking for readline with $readline $lib) - unset ac_cv_func_readline - LIBS="$readline $lib" - AC_CHECK_FUNCS(readline) - if test "$ac_cv_func_readline" = "yes" - then - READLINE_LIB="$readline $lib" - break - fi - done - fi - if test "$ac_cv_func_readline" != yes + if test "$use_readline" != "auto" && + test "X$READLINE_LIB" = "X" then AC_MSG_ERROR([The readline library was not found.]) fi