From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45247 invoked by alias); 31 Mar 2015 10:53:45 -0000 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 Received: (qmail 45204 invoked by uid 89); 31 Mar 2015 10:53:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 31 Mar 2015 10:53:42 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2VAreIn023794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Mar 2015 06:53:40 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2VArb3L026457; Tue, 31 Mar 2015 06:53:39 -0400 Message-ID: <551A7CB1.4060101@redhat.com> Date: Tue, 31 Mar 2015 10:53:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "H.J. Lu" CC: Binutils , GDB Subject: Re: [PATCH 1/8] Add --with-system-zlib in bfd References: <20150326155711.GA10088@gmail.com> <20150331061337.GA30996@vapier> <551A78D4.7050804@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg01027.txt.bz2 On 03/31/2015 11:46 AM, H.J. Lu wrote: > On Tue, Mar 31, 2015 at 3:37 AM, Pedro Alves wrote: >> On 03/31/2015 11:10 AM, H.J. Lu wrote: >>> On Mon, Mar 30, 2015 at 11:13 PM, Mike Frysinger wrote: >>>> On 26 Mar 2015 08:57, H.J. Lu wrote: >>>>> --- a/bfd/configure.ac >>>>> +++ b/bfd/configure.ac >>>>> >>>>> -# Link in zlib if we can. This allows us to read compressed debug sections. >>>>> -# This is used only by compress.c. >>>>> -AM_ZLIB >>>>> +# Use the system's zlib library. >>>>> +zlibdir=-L../zlib >>>>> +zlibinc="-I\$(srcdir)/../zlib" >>>>> +AC_ARG_WITH(system-zlib, >>>>> +[AS_HELP_STRING([--with-system-zlib], [use installed libz])], >>>>> +zlibdir= >>>>> +zlibinc= >>>>> +) >>>> >>>> this is wrong. the 3rd arg is whether the option was specified, not that the >>>> option was disabled. you need to check $withval is equal to "no" (or not equal >>>> to "yes"). >>>> -mike >>> >>> That is what gcc/configure.ac has and it works for me. >>> >>> >> >> Why are we patching every tool's configury instead of tweaking >> config/zlib.m4 (where AM_ZLIB is from)? We go from a single >> place to edit, to the same configure bits spread around the >> tree. Seems like a step backwards. >> > > Replace AM_ZLIB in configure.ac isn't complete. I also needed to change Never said it was complete. > > * Makefile.am (ZLIB): New. > (ZLIBINC): Likewise. > (AM_CFLAGS): Add $(ZLIBINC). > (libbfd_la_LIBADD): Add $(ZLIB). > > It is better for Makefile.am to use what configure.ac defines That's orthogonal. How configure.ac defines what Makefile.am consumes is the issue. That can either be through a shared macro, which makes sure all tools have the exact same command line option (like AM_ZLIB), or you manually put the same configure.ac bits everywhere. Thanks, Pedro Alves