This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Add support for --without-zlib (was --disable-zlib)

On Fri, 30 Oct 2009 19:21:57 +0100, Joel Brobecker wrote:
> We'd like to be able to distribute binutils and GDB without an extra
> dependency on zlib, so we're introducing a new configure switch
> --disable-zlib.  The current behavior remains the default.

It should be more systematic to use AC_ARG_WITH than AC_ARG_ENABLE as it is
about a dependency on external software as described in the autoconf manual.

And I would prefer to be also able to force the requirement - it makes the
vendor packaging sanity checking of prerequisited packages easier.

Tested only separately, outside of the sourceware tree (there should be no
change I hope as externally is visible only the AC_CHECK_HEADERS result).


	* zlib.m4: New file.

--- /dev/null
+++ b/config/zlib.m4
@@ -0,0 +1,17 @@
+dnl A function to check for zlib availability.  zlib is used by default
+dnl unless the user configured using --without-nls.
+  # See if the user asked for zlib support to be disabled.
+  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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]