From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28684 invoked by alias); 30 Oct 2009 21:22:05 -0000 Received: (qmail 28664 invoked by uid 22791); 30 Oct 2009 21:22:04 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Oct 2009 21:22:00 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9ULLH3s023158; Fri, 30 Oct 2009 17:21:17 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9ULLFO5025233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Oct 2009 17:21:17 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n9ULLFML008790; Fri, 30 Oct 2009 22:21:15 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n9ULLEZt008789; Fri, 30 Oct 2009 22:21:14 +0100 Date: Fri, 30 Oct 2009 21:22:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [RFA] Add support for --without-zlib (was --disable-zlib) Message-ID: <20091030212114.GA8158@host0.dyn.jankratochvil.net> References: <20091030182157.GS24532@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091030182157.GS24532@adacore.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00701.txt.bz2 On Fri, 30 Oct 2009 19:21:57 +0100, Joel Brobecker wrote: > We'd like to be able to distribute binutils and GDB without an extra > dependency on zlib, so we're introducing a new configure switch > --disable-zlib. The current behavior remains the default. It should be more systematic to use AC_ARG_WITH than AC_ARG_ENABLE as it is about a dependency on external software as described in the autoconf manual. And I would prefer to be also able to force the requirement - it makes the vendor packaging sanity checking of prerequisited packages easier. Tested only separately, outside of the sourceware tree (there should be no change I hope as externally is visible only the AC_CHECK_HEADERS result). Thanks, Jan config/ * zlib.m4: New file. --- /dev/null +++ b/config/zlib.m4 @@ -0,0 +1,17 @@ +dnl A function to check for zlib availability. zlib is used by default +dnl unless the user configured using --without-nls. + +AC_DEFUN([AM_ZLIB], +[ + # See if the user asked for zlib support to be disabled. + AC_ARG_WITH(zlib, + [ --with-zlib include zlib support (auto/yes/no)], + [], [with_zlib=auto]) + + if test "$with_zlib" != "no"; then + AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)]) + if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then + AC_MSG_ERROR([zlib (libz) library was explicitly requested but not found]) + fi + fi +])