This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/8] Add --with-system-zlib in bfd
- From: Pedro Alves <palves at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, GDB <gdb-patches at sourceware dot org>
- Date: Tue, 31 Mar 2015 12:46:15 +0100
- Subject: Re: [PATCH 1/8] Add --with-system-zlib in bfd
- Authentication-results: sourceware.org; auth=none
- References: <20150326155711 dot GA10088 at gmail dot com> <20150331061337 dot GA30996 at vapier> <CAMe9rOpRauO-5fxuV5bZkUC0tMbbi0tCTCmGQ0GEe1NXEa1dYw at mail dot gmail dot com> <551A78D4 dot 7050804 at redhat dot com> <CAMe9rOomwTtSiSS1K1zQpGvpArqZLDfOyapDVvC=Yfy5m3zBEg at mail dot gmail dot com> <551A7CB1 dot 4060101 at redhat dot com> <CAMe9rOoBdTqGa-k9nX9ktW23h-jfA34Jx5D4wqnqO+eb4c8buA at mail dot gmail dot com>
On 03/31/2015 12:33 PM, H.J. Lu wrote:
> On Tue, Mar 31, 2015 at 3:53 AM, Pedro Alves <palves@redhat.com> 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