From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48124 invoked by alias); 31 Mar 2015 11:46:20 -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 48105 invoked by uid 89); 31 Mar 2015 11:46:19 -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 11:46:18 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0526B8EFE0; Tue, 31 Mar 2015 11:46:17 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2VBkFE9007454; Tue, 31 Mar 2015 07:46:16 -0400 Message-ID: <551A8907.6070309@redhat.com> Date: Tue, 31 Mar 2015 11:46: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> <551A7CB1.4060101@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg01032.txt.bz2 On 03/31/2015 12:33 PM, H.J. Lu wrote: > On Tue, Mar 31, 2015 at 3:53 AM, Pedro Alves wrote: >> On 03/31/2015 11:46 AM, H.J. Lu wrote: >>> 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. > > They aren't the same. Some tools like ld, which use zlib implicitly > via libfd and libtool, don't need to reference zlib. Sure, that one just drops AM_ZLIB. > Some only need > to reference zlib library. Some only need to reference header. > And? If you replace AM_ZLIB's body with: # 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= ) AC_SUBST(zlibdir) AC_SUBST(zlibinc) then it'll work for those too. They just won't use zlibinc or zlibinc if they don't need it. Currently you have: bfd: > +# 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= > +) > +AC_SUBST(zlibdir) > +AC_SUBST(zlibinc) gold: +# 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= +) +AC_SUBST(zlibdir) +AC_SUBST(zlibinc) gas: +# Use the system's zlib library. +zlibinc="-I\$(srcdir)/../zlib" +AC_ARG_WITH(system-zlib, +[AS_HELP_STRING([--with-system-zlib], [use installed libz])], +zlibinc= +) +AC_SUBST(zlibinc) binutils: +# 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= +) +AC_SUBST(zlibdir) +AC_SUBST(zlibinc) gdb: +# Use the system's zlib library. +zlibdir=-L../zlib +AC_ARG_WITH(system-zlib, +[AS_HELP_STRING([--with-system-zlib], [use installed libz])], +zlibdir= +) +AC_SUBST(zlibdir) and gcc has: # 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= ) AC_SUBST(zlibdir) AC_SUBST(zlibinc) They're all the same. Just a couple doesn't define zlibdir or zlibinc. Thanks, Pedro Alves