aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wiretap/configure.in45
1 files changed, 43 insertions, 2 deletions
diff --git a/wiretap/configure.in b/wiretap/configure.in
index daabfd3842..2c315ce7bf 100644
--- a/wiretap/configure.in
+++ b/wiretap/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.14 1999/09/22 01:26:46 ashokn Exp $
+# $Id: configure.in,v 1.15 1999/09/24 06:38:22 guy Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(wtap.c)
AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
@@ -33,8 +33,49 @@ if test "x$GLIB_CFLAGS" = x ; then
fi
dnl Checks for header files
+dnl WARNING: do *NOT* check for "unistd.h" unless you work around the
+dnl following problem:
+dnl
+dnl At least on FreeBSD 3.2, "/usr/include/zlib.h" includes
+dnl "/usr/include/zconf.h", which, if HAVE_UNISTD_H is defined,
+dnl #defines "z_off_t" to be "off_t", and if HAVE_UNISTD_H is
+dnl not defines, #defines "z_off_t" to be "long" if it's not
+dnl already #defined.
+dnl
+dnl In 4.4-Lite-derived systems such as FreeBSD, "off_t" is
+dnl "long long int", not "long int", so the definition of "z_off_t" -
+dnl and therefore the types of the arguments to routines such as
+dnl "gzseek()", as declared, with prototypes, in "zlib.h" - depends
+dnl on whether HAVE_UNISTD_H is defined prior to including "zlib.h"!
+dnl
+dnl It's not defined in the FreeBSD 3.2 "zlib", so if we include "zlib.h"
+dnl after defining HAVE_UNISTD_H, we get a misdeclaration of "gzseek()",
+dnl and, if we're building with "zlib" support, anything that seeks
+dnl on a file may not work.
+dnl
+dnl Other BSDs may have the same problem, if they haven't done something
+dnl such as defining HAVE_UNISTD_H in "zconf.h".
+dnl
+dnl If "config.h" defines HAVE_UNISTD_H - which it will, on all systems
+dnl that have it, if we test for it here, and all 4.4-Lite-derived
+dnl BSDs have it - then, given that "zlib.h" is included by "file.h",
+dnl that means that unless we include "zlib.h" before we include
+dnl "config.h", we get a misdeclaration of "gzseek()".
+dnl
+dnl Unfortunately, it's "config.h" that tells us whether we have "zlib"
+dnl in the first place, so we don't know whether to include "zlib.h"
+dnl until we include "config.h"....
+dnl
+dnl Fortunately, we don't use "unistd.h", so we don't need to check
+dnl for it.
+dnl
+dnl If we ever *do* end up requiring HAVE_UNISTD_H, a fix might be to
+dnl turn "file_seek()" into a subroutine, at least if HAVE_ZLIB is
+dnl defined, have it take an "off_t" as its second argument, and
+dnl put it into a file that doesn't require HAVE_UNISTD_H.
+dnl
AC_HEADER_STDC
-AC_CHECK_HEADERS(unistd.h sys/time.h netinet/in.h)
+AC_CHECK_HEADERS(sys/time.h netinet/in.h)
dnl zlib check
AC_ARG_ENABLE(zlib,