From dot@dotat.at Wed Oct 5 14:50:00 2016 CC: dot@dotat.at MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Cam-Antivirus: no malware found content-type: TEXT/PLAIN; charset="utf-8" Message-ID: Received: from mx.pao1.isc.org (mx.pao1.isc.org [IPv6:2001:4f8:0:2::2b]) by bugs.isc.org (Postfix) with ESMTP id 3D3F571B5A8 for ; Wed, 5 Oct 2016 14:50:00 +0000 (UTC) Received: from ppsw-31.csi.cam.ac.uk (ppsw-31.csi.cam.ac.uk [131.111.8.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.pao1.isc.org (Postfix) with ESMTPS id 1C4533493BC for ; Wed, 5 Oct 2016 14:49:53 +0000 (UTC) Received: from grey.csi.cam.ac.uk ([131.111.57.57]:45635) by ppsw-31.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.137]:25) with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1brnW2-000xHx-Lr (Exim 4.86_36-e07b163) (return-path ); Wed, 05 Oct 2016 15:49:50 +0100 Delivered-To: bind9-bugs@bugs.isc.org Subject: [PATCH] configure: fail if readline was asked for but not found User-Agent: Alpine 2.11 (DEB 23 2013-08-11) Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Date: Wed, 5 Oct 2016 15:49:50 +0100 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org To: bind9-bugs@isc.org X-Cam-Scannerinfo: http://www.cam.ac.uk/cs/email/scanner/ From: "Tony Finch" X-RT-Original-Encoding: ascii X-RT-Interface: Email Content-Length: 1944 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