From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81876 invoked by alias); 31 Mar 2015 12:01:19 -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 81721 invoked by uid 89); 31 Mar 2015 12:01:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 31 Mar 2015 12:01:09 +0000 Received: by obbgh1 with SMTP id gh1so22586664obb.1; Tue, 31 Mar 2015 05:01:07 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.103.234 with SMTP id fz10mr32667822oeb.11.1427803266476; Tue, 31 Mar 2015 05:01:06 -0700 (PDT) Received: by 10.76.134.102 with HTTP; Tue, 31 Mar 2015 05:01:06 -0700 (PDT) In-Reply-To: <551A8907.6070309@redhat.com> References: <20150326155711.GA10088@gmail.com> <20150331061337.GA30996@vapier> <551A78D4.7050804@redhat.com> <551A7CB1.4060101@redhat.com> <551A8907.6070309@redhat.com> Date: Tue, 31 Mar 2015 12:01:00 -0000 Message-ID: Subject: Re: [PATCH 1/8] Add --with-system-zlib in bfd From: "H.J. Lu" To: Pedro Alves Cc: Binutils , GDB Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01034.txt.bz2 On Tue, Mar 31, 2015 at 4:46 AM, Pedro Alves wrote: > 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. If zlib.m4 is changed, I will use it and GCC can also use it. But I don't know if other packages use zlib.m4. -- H.J.