* [RFA] Add support for --without-zlib (take 2)
@ 2009-11-02 23:23 Joel Brobecker
2009-11-09 23:29 ` Joel Brobecker
2009-11-24 23:01 ` Joel Brobecker
0 siblings, 2 replies; 5+ messages in thread
From: Joel Brobecker @ 2009-11-02 23:23 UTC (permalink / raw)
To: binutils, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]
Here is a new set of patches for both binutils and GDB that introduce
--with-zlib/--without-lib, whose intent it allow someone to a user
the dependency on zlib.
There is no documentation for now, as I just want to make sure that
the option is accepted as is before writing it. Jan Kratochvil has
rewritten most of AM_ZLIB in the new config/zlib.m4 file, so I'll
make sure to put him on the blame list (aka ChangeLog).
Tom: I tried to think about how to integrate ourselves better with
GCC's configure option (--with-system-zlib), but I couldn't think
of anything nice. I think GCC should have implemented optional
in-tree support the way you did for iconv. For now, I'm still proposing
--with-zlib unless someone offers a better suggestion, which I am
of course willing to implement.
Tested on x86_64-linux (--with-zlib, --without-zlib, default).
I'd like approval on the binutils side. On the GDB side, I am planning
on checking everything in if there are no objections and the binutils
part is approved.
Thanks,
--
Joel
[-- Attachment #2: 0001-config.patch --]
[-- Type: text/x-diff, Size: 941 bytes --]
config/
* zlib.m4: New file.
---
config/zlib.m4 | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 config/zlib.m4
diff --git a/config/zlib.m4 b/config/zlib.m4
new file mode 100644
index 0000000..b58228a
--- /dev/null
+++ b/config/zlib.m4
@@ -0,0 +1,18 @@
+dnl A function to check for zlib availability. zlib is used by default
+dnl unless the user configured with --disable-nls.
+
+AC_DEFUN([AM_ZLIB],
+[
+ # See if the user specified whether he wants zlib support or not.
+ 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
+])
+
--
1.6.0.4
[-- Attachment #3: 0002-bfd.patch --]
[-- Type: text/x-diff, Size: 1091 bytes --]
bfd/
* acinclude.m4: Add include of ../config/zlib.m4.
* configure.in: AM_ZLIB to check for zlib support.
* configure: Regenerate.
---
bfd/acinclude.m4 | 2 ++
bfd/configure | 49 ++++++++++++++++++++++++++++++++++---------------
bfd/configure.in | 2 +-
3 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
index aaa147e..d9813bd 100644
--- a/bfd/acinclude.m4
+++ b/bfd/acinclude.m4
@@ -1,3 +1,5 @@
+sinclude([../config/zlib.m4])
+
dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
AC_DEFUN([BFD_BINARY_FOPEN],
[AC_REQUIRE([AC_CANONICAL_TARGET])
diff --git a/bfd/configure.in b/bfd/configure.in
index 7ca59b0..804a4d5 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -225,7 +225,7 @@ AC_CHECK_DECLS(vsnprintf)
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+AM_ZLIB
# If we are configured native, pick a core file support file.
COREFILE=
--
1.6.0.4
[-- Attachment #4: 0003-sim.patch --]
[-- Type: text/x-diff, Size: 2768 bytes --]
sim/
* common/aclocal.m4: Add include of ../../config/zlib.m4.
* common/common.m4: Use AM_ZLIB to check for zlib support.
* ppc/configure.ac: Likewise.
* arm/configure, avr/configure, common/configure, cr16/configure,
cris/configure, d10v/configure, erc32/configure, frv/configure,
h8300/configure, iq2000/configure, lm32/configure, m32c/configure,
m32r/configure, m68hc11/configure, mcore/configure, microblaze/configure,
mips/configure, mn10300/configure, moxie/configure, ppc/configure,
sh/configure, sh64/configure, v850/configure: Regenerate.
---
sim/arm/configure | 26 +-
sim/avr/configure | 26 +-
sim/common/aclocal.m4 | 1 +
sim/common/common.m4 | 2 +-
sim/common/configure | 21 +-
sim/cr16/configure | 26 +-
sim/cris/configure | 26 +-
sim/d10v/configure | 26 +-
sim/erc32/configure | 26 +-
sim/frv/configure | 26 +-
sim/h8300/configure | 26 +-
sim/iq2000/configure | 26 +-
sim/lm32/configure | 26 +-
sim/m32c/configure | 26 +-
sim/m32r/configure | 26 +-
sim/m68hc11/configure | 26 +-
sim/mcore/configure | 26 +-
sim/microblaze/configure | 3748 ++++++++++++++++------------------------------
sim/mips/configure | 26 +-
sim/mn10300/configure | 26 +-
sim/moxie/configure | 36 +-
sim/ppc/configure | 21 +-
sim/ppc/configure.ac | 2 +-
sim/sh/configure | 26 +-
sim/sh64/configure | 26 +-
sim/v850/configure | 26 +-
26 files changed, 1841 insertions(+), 2484 deletions(-)
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index 7beaebd..9a6a4c8 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -20,6 +20,7 @@
# Include global overrides and fixes for Autoconf.
m4_include(../../config/override.m4)
+sinclude([../../config/zlib.m4])
AC_DEFUN([SIM_AC_COMMON],
[
diff --git a/sim/common/common.m4 b/sim/common/common.m4
index 215208d..97a2c61 100644
--- a/sim/common/common.m4
+++ b/sim/common/common.m4
@@ -56,7 +56,7 @@ AC_CHECK_LIB(nsl, gethostbyname)
# BFD conditionally uses zlib, so we must link it in if libbfd does, by
# using the same condition.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+AM_ZLIB
. ${srcdir}/../../bfd/configure.host
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index e8ccfe9..ae26d54 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -668,7 +668,7 @@ AC_ARG_PROGRAM
# BFD conditionally uses zlib, so we must link it in if libbfd does, by
# using the same condition.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+AM_ZLIB
. ${srcdir}/../../bfd/configure.host
--
1.6.0.4
[-- Attachment #5: 0004-gdb.patch --]
[-- Type: text/x-diff, Size: 1403 bytes --]
From 4b1b9db70ab42f5589940c8eca85659cd66c96e8 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Fri, 30 Oct 2009 10:22:55 -0700
Subject: [PATCH] gdb/
* acinclude.m4: Include ../config/zlib.m4.
* configure.ac: Use AM_ZLIB to check for zlib support.
* configure: Regenerate.
---
gdb/acinclude.m4 | 2 ++
gdb/configure | 21 ++++++++++++++++++++-
gdb/configure.ac | 2 +-
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index c32e1ea..af4639b 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -32,6 +32,8 @@ sinclude([../config/lcmessage.m4])
dnl For AM_LANGINFO_CODESET.
sinclude([../config/codeset.m4])
+sinclude([../config/zlib.m4])
+
#
# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
# makes configure think it's cross compiling. If --target wasn't used, then
diff --git a/gdb/configure.ac b/gdb/configure.ac
index b96caef..d3d4f1f 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -422,7 +422,7 @@ AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(socketpair, socket)
# Link in zlib if we can. This allows us to read compressed debug sections.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+AM_ZLIB
# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
--
1.6.0.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Add support for --without-zlib (take 2)
2009-11-02 23:23 [RFA] Add support for --without-zlib (take 2) Joel Brobecker
@ 2009-11-09 23:29 ` Joel Brobecker
2009-11-10 8:00 ` Nick Clifton
2009-11-24 23:01 ` Joel Brobecker
1 sibling, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2009-11-09 23:29 UTC (permalink / raw)
To: binutils, gdb-patches
Binutils Maintainers, ping?
Thank you,
--
Joel
On Mon, Nov 02, 2009 at 03:23:19PM -0800, Joel Brobecker wrote:
> Here is a new set of patches for both binutils and GDB that introduce
> --with-zlib/--without-lib, whose intent it allow someone to a user
> the dependency on zlib.
>
> There is no documentation for now, as I just want to make sure that
> the option is accepted as is before writing it. Jan Kratochvil has
> rewritten most of AM_ZLIB in the new config/zlib.m4 file, so I'll
> make sure to put him on the blame list (aka ChangeLog).
>
> Tom: I tried to think about how to integrate ourselves better with
> GCC's configure option (--with-system-zlib), but I couldn't think
> of anything nice. I think GCC should have implemented optional
> in-tree support the way you did for iconv. For now, I'm still proposing
> --with-zlib unless someone offers a better suggestion, which I am
> of course willing to implement.
>
> Tested on x86_64-linux (--with-zlib, --without-zlib, default).
>
> I'd like approval on the binutils side. On the GDB side, I am planning
> on checking everything in if there are no objections and the binutils
> part is approved.
>
> Thanks,
> --
> Joel
> config/
>
> * zlib.m4: New file.
>
> ---
> config/zlib.m4 | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
> create mode 100644 config/zlib.m4
>
> diff --git a/config/zlib.m4 b/config/zlib.m4
> new file mode 100644
> index 0000000..b58228a
> --- /dev/null
> +++ b/config/zlib.m4
> @@ -0,0 +1,18 @@
> +dnl A function to check for zlib availability. zlib is used by default
> +dnl unless the user configured with --disable-nls.
> +
> +AC_DEFUN([AM_ZLIB],
> +[
> + # See if the user specified whether he wants zlib support or not.
> + 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
> +])
> +
> --
> 1.6.0.4
>
> bfd/
>
> * acinclude.m4: Add include of ../config/zlib.m4.
> * configure.in: AM_ZLIB to check for zlib support.
> * configure: Regenerate.
>
> ---
> bfd/acinclude.m4 | 2 ++
> bfd/configure | 49 ++++++++++++++++++++++++++++++++++---------------
> bfd/configure.in | 2 +-
> 3 files changed, 37 insertions(+), 16 deletions(-)
>
> diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
> index aaa147e..d9813bd 100644
> --- a/bfd/acinclude.m4
> +++ b/bfd/acinclude.m4
> @@ -1,3 +1,5 @@
> +sinclude([../config/zlib.m4])
> +
> dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
> AC_DEFUN([BFD_BINARY_FOPEN],
> [AC_REQUIRE([AC_CANONICAL_TARGET])
> diff --git a/bfd/configure.in b/bfd/configure.in
> index 7ca59b0..804a4d5 100644
> --- a/bfd/configure.in
> +++ b/bfd/configure.in
> @@ -225,7 +225,7 @@ AC_CHECK_DECLS(vsnprintf)
>
> # Link in zlib if we can. This allows us to read compressed debug sections.
> # This is used only by compress.c.
> -AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
> +AM_ZLIB
>
> # If we are configured native, pick a core file support file.
> COREFILE=
> --
> 1.6.0.4
>
> sim/
>
> * common/aclocal.m4: Add include of ../../config/zlib.m4.
> * common/common.m4: Use AM_ZLIB to check for zlib support.
> * ppc/configure.ac: Likewise.
> * arm/configure, avr/configure, common/configure, cr16/configure,
> cris/configure, d10v/configure, erc32/configure, frv/configure,
> h8300/configure, iq2000/configure, lm32/configure, m32c/configure,
> m32r/configure, m68hc11/configure, mcore/configure, microblaze/configure,
> mips/configure, mn10300/configure, moxie/configure, ppc/configure,
> sh/configure, sh64/configure, v850/configure: Regenerate.
>
> ---
> sim/arm/configure | 26 +-
> sim/avr/configure | 26 +-
> sim/common/aclocal.m4 | 1 +
> sim/common/common.m4 | 2 +-
> sim/common/configure | 21 +-
> sim/cr16/configure | 26 +-
> sim/cris/configure | 26 +-
> sim/d10v/configure | 26 +-
> sim/erc32/configure | 26 +-
> sim/frv/configure | 26 +-
> sim/h8300/configure | 26 +-
> sim/iq2000/configure | 26 +-
> sim/lm32/configure | 26 +-
> sim/m32c/configure | 26 +-
> sim/m32r/configure | 26 +-
> sim/m68hc11/configure | 26 +-
> sim/mcore/configure | 26 +-
> sim/microblaze/configure | 3748 ++++++++++++++++------------------------------
> sim/mips/configure | 26 +-
> sim/mn10300/configure | 26 +-
> sim/moxie/configure | 36 +-
> sim/ppc/configure | 21 +-
> sim/ppc/configure.ac | 2 +-
> sim/sh/configure | 26 +-
> sim/sh64/configure | 26 +-
> sim/v850/configure | 26 +-
> 26 files changed, 1841 insertions(+), 2484 deletions(-)
>
> diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
> index 7beaebd..9a6a4c8 100644
> --- a/sim/common/aclocal.m4
> +++ b/sim/common/aclocal.m4
> @@ -20,6 +20,7 @@
>
> # Include global overrides and fixes for Autoconf.
> m4_include(../../config/override.m4)
> +sinclude([../../config/zlib.m4])
>
> AC_DEFUN([SIM_AC_COMMON],
> [
> diff --git a/sim/common/common.m4 b/sim/common/common.m4
> index 215208d..97a2c61 100644
> --- a/sim/common/common.m4
> +++ b/sim/common/common.m4
> @@ -56,7 +56,7 @@ AC_CHECK_LIB(nsl, gethostbyname)
>
> # BFD conditionally uses zlib, so we must link it in if libbfd does, by
> # using the same condition.
> -AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
> +AM_ZLIB
>
> . ${srcdir}/../../bfd/configure.host
>
> diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
> index e8ccfe9..ae26d54 100644
> --- a/sim/ppc/configure.ac
> +++ b/sim/ppc/configure.ac
> @@ -668,7 +668,7 @@ AC_ARG_PROGRAM
>
> # BFD conditionally uses zlib, so we must link it in if libbfd does, by
> # using the same condition.
> -AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
> +AM_ZLIB
>
> . ${srcdir}/../../bfd/configure.host
>
> --
> 1.6.0.4
>
> >From 4b1b9db70ab42f5589940c8eca85659cd66c96e8 Mon Sep 17 00:00:00 2001
> From: Joel Brobecker <brobecker@adacore.com>
> Date: Fri, 30 Oct 2009 10:22:55 -0700
> Subject: [PATCH] gdb/
> * acinclude.m4: Include ../config/zlib.m4.
> * configure.ac: Use AM_ZLIB to check for zlib support.
> * configure: Regenerate.
>
> ---
> gdb/acinclude.m4 | 2 ++
> gdb/configure | 21 ++++++++++++++++++++-
> gdb/configure.ac | 2 +-
> 3 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
> index c32e1ea..af4639b 100644
> --- a/gdb/acinclude.m4
> +++ b/gdb/acinclude.m4
> @@ -32,6 +32,8 @@ sinclude([../config/lcmessage.m4])
> dnl For AM_LANGINFO_CODESET.
> sinclude([../config/codeset.m4])
>
> +sinclude([../config/zlib.m4])
> +
> #
> # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
> # makes configure think it's cross compiling. If --target wasn't used, then
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index b96caef..d3d4f1f 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -422,7 +422,7 @@ AC_SEARCH_LIBS(gethostbyname, nsl)
> AC_SEARCH_LIBS(socketpair, socket)
>
> # Link in zlib if we can. This allows us to read compressed debug sections.
> -AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
> +AM_ZLIB
>
> # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
> AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
> --
> 1.6.0.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Add support for --without-zlib (take 2)
2009-11-09 23:29 ` Joel Brobecker
@ 2009-11-10 8:00 ` Nick Clifton
0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2009-11-10 8:00 UTC (permalink / raw)
To: Joel Brobecker; +Cc: binutils, gdb-patches
Hi Joel,
> Binutils Maintainers, ping?
oops, sorry.
Yes please go ahead with this patch.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Add support for --without-zlib (take 2)
2009-11-02 23:23 [RFA] Add support for --without-zlib (take 2) Joel Brobecker
2009-11-09 23:29 ` Joel Brobecker
@ 2009-11-24 23:01 ` Joel Brobecker
1 sibling, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2009-11-24 23:01 UTC (permalink / raw)
To: binutils, gdb-patches
> Here is a new set of patches for both binutils and GDB that introduce
> --with-zlib/--without-lib, whose intent it allow someone to a user
> the dependency on zlib.
OK - all the patches have now been checked in.
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Add support for --without-zlib (take 2)
[not found] <20091102232319.GJ4531__1176.19579327783$1257204230$gmane$org@adacore.com>
@ 2009-11-09 17:38 ` Tom Tromey
0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2009-11-09 17:38 UTC (permalink / raw)
To: Joel Brobecker; +Cc: binutils, gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> Tom: I tried to think about how to integrate ourselves better with
Joel> GCC's configure option (--with-system-zlib), but I couldn't think
Joel> of anything nice.
Thanks for looking.
Joel> I think GCC should have implemented optional in-tree support the
Joel> way you did for iconv.
The situations aren't totally analogous. zlib is always in the gcc
tree, and for gcj (and now I think, LTO), it is not an optional
dependency.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-24 23:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 23:23 [RFA] Add support for --without-zlib (take 2) Joel Brobecker
2009-11-09 23:29 ` Joel Brobecker
2009-11-10 8:00 ` Nick Clifton
2009-11-24 23:01 ` Joel Brobecker
[not found] <20091102232319.GJ4531__1176.19579327783$1257204230$gmane$org@adacore.com>
2009-11-09 17:38 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox