aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-08-18 20:09:44 +0000
committerGuy Harris <guy@alum.mit.edu>2001-08-18 20:09:44 +0000
commit4533ae7c5556f1b3c2474426e543df300f615c55 (patch)
tree24157057103391dabea9c01b3b7b929e9dd601ff /acinclude.m4
parentc290d9c859af4d499fc21b8a529fb5840f03386e (diff)
If there's no "zlib.h" header, we won't be using zlib, so don't bother
checking for "gzgets()" in zlib. If there is a "zlib.h" header, and there is a "gzgets()" in zlib, check whether we find "gzgets()" in zlib when we link with the GTK+ link flags, and, if not, fail. People often grab XFree86 source and build and install it on their systems, and they appear sometimes to misconfigure XFree86 so that, even on systems with zlib, it assumes there is no zlib, so the XFree86 build process builds and installs its own "mini-zlib" in the X11 library directory. The "mini-zlib" lacks "gzgets()", and that's the zlib with which Ethereal gets linked, so the build of Ethereal fails. svn path=/trunk/; revision=3849
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m457
1 files changed, 47 insertions, 10 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 4c80b7414a..d3f3c3c675 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2,7 +2,7 @@ dnl Macros that test for specific features.
dnl This file is part of the Autoconf packaging for Ethereal.
dnl Copyright (C) 1998-2000 by Gerald Combs.
dnl
-dnl $Id: acinclude.m4,v 1.30 2001/07/27 19:14:59 guy Exp $
+dnl $Id: acinclude.m4,v 1.31 2001/08/18 20:09:43 guy Exp $
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -353,16 +353,53 @@ return_pcap_version(void)
#
AC_DEFUN(AC_ETHEREAL_ZLIB_CHECK,
[
- AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
+ AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
- dnl
- dnl Check for "gzgets()" in zlib, because we need it, but
- dnl some older versions of zlib don't have it. It appears
- dnl from the ChangeLog that any released version of zlib
- dnl with "gzgets()" should have the other routines we
- dnl depend on, such as "gzseek()", "gztell()", and "zError()".
- dnl
- AC_CHECK_LIB(z, gzgets,,enable_zlib=no)
+ if test x$enable_zlib != xno
+ then
+ #
+ # Well, we at least have the zlib header file.
+ #
+ # Check for "gzgets()" in zlib, because we need it, but
+ # some older versions of zlib don't have it. It appears
+ # from the ChangeLog that any released version of zlib
+ # with "gzgets()" should have the other routines we
+ # depend on, such as "gzseek()", "gztell()", and "zError()".
+ #
+ AC_CHECK_LIB(z, gzgets,,enable_zlib=no)
+ fi
+
+ if test x$enable_zlib != xno
+ then
+ #
+ # Well, we at least have the zlib header file and a zlib
+ # with "gzgets()".
+ #
+ # Now check for "gzgets()" in zlib when linking with the
+ # linker flags for GTK+ applications; people often grab
+ # XFree86 source and build and install it on their systems,
+ # and they appear sometimes to misconfigure XFree86 so that,
+ # even on systems with zlib, it assumes there is no zlib,
+ # so the XFree86 build process builds and installs its
+ # own "mini-zlib" in the X11 library directory.
+ #
+ # The "mini-zlib" lacks "gzgets()", and that's the zlib
+ # with which Ethereal gets linked, so the build of
+ # Ethereal fails.
+ #
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$GTK_LIBS -lz $LIBS"
+ AC_MSG_CHECKING([for gzgets missing when linking with X11])
+ AC_TRY_LINK_FUNC(gzgets, AC_MSG_RESULT(no),
+ [
+ AC_MSG_RESULT(yes)
+ AC_MSG_ERROR(XFree86 mini-zlib found - rebuild XFree86 without it or configure without compressed file support.)
+ ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
])
#