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
This commit is contained in:
Guy Harris 2001-08-18 20:09:44 +00:00
parent c290d9c859
commit 4533ae7c55
2 changed files with 62 additions and 20 deletions

View File

@ -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
])
#

View File

@ -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.9 2001/07/27 07:10:13 guy Exp $
dnl $Id: acinclude.m4,v 1.10 2001/08/18 20:09:44 guy Exp $
dnl
# Configure paths for GLIB
@ -261,14 +261,19 @@ AC_DEFUN(AC_WIRETAP_PCAP_CHECK,
#
AC_DEFUN(AC_WIRETAP_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
])