CC: | dot@dotat.at |
Subject: | [PATCH] configure: fail if readline was asked for but not found |
Date: | Wed, 5 Oct 2016 15:49:50 +0100 |
To: | bind9-bugs@isc.org |
From: | "Tony Finch" <dot@dotat.at> |
With most optional features (--with-libxml2 --with-libjson etc usw)
the build will fail if you ./configure --with-FEATURE and FEATURE is not
available. This does not work for readline - the failure is ignored.
The following patch fixes the bug and incidentally removes a little bit of
duplicated code.
---
configure.in | 37 +++++++++++--------------------------
1 file changed, 11 insertions(+), 26 deletions(-)
diff --git a/configure.in b/configure.in
index 18a08a5..0731005 100644
--- a/configure.in
+++ b/configure.in
@@ -3436,12 +3436,16 @@ 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 readline in -ledit -lreadline
+ case "$use_readline" in
+ yes|auto) readline_libs="-ledit -lreadline" ;;
+ *) readline_libs="$use_readline" ;;
+ esac
+ for readline in $readline_libs
do
LIBS="$readline"
AC_MSG_NOTICE(checking for readline with $readline)
@@ -3468,29 +3472,10 @@ yes|auto)
break
fi
done
- 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"
+ if test "$use_readline" != "auto" &&
+ test "X$READLINE_LIB" = "X"
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
+ AC_MSG_ERROR([The readline library was not found.])
fi
LIBS="$saved_LIBS"
;;
--
2.1.4