2000-08-25 06:25:21 +00:00
|
|
|
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
|
2001-08-20 15:23:34 +00:00
|
|
|
dnl $Id: acinclude.m4,v 1.11 2001/08/20 15:23:34 gram Exp $
|
2000-08-25 06:25:21 +00:00
|
|
|
dnl
|
|
|
|
|
|
|
|
#
|
|
|
|
# AC_WIRETAP_PCAP_CHECK
|
|
|
|
#
|
|
|
|
AC_DEFUN(AC_WIRETAP_PCAP_CHECK,
|
|
|
|
[
|
2001-06-27 07:47:50 +00:00
|
|
|
if test -z "$pcap_dir"
|
|
|
|
then
|
|
|
|
#
|
|
|
|
# The user didn't specify a directory in which libpcap resides;
|
|
|
|
# we assume that the current library search path will work,
|
|
|
|
# but we may have to look for the header in a "pcap"
|
|
|
|
# subdirectory of "/usr/include" or "/usr/local/include",
|
|
|
|
# as some systems apparently put "pcap.h" in a "pcap"
|
|
|
|
# subdirectory, and we also check "$prefix/include".
|
|
|
|
#
|
|
|
|
# XXX - should we just add "$prefix/include" to the include
|
|
|
|
# search path?
|
|
|
|
#
|
|
|
|
AC_MSG_CHECKING(for extraneous pcap header directories)
|
|
|
|
found_pcap_dir=""
|
|
|
|
for pcap_dir in /usr/include/pcap /usr/local/include/pcap $prefix/include
|
|
|
|
do
|
|
|
|
if test -d $pcap_dir ; then
|
|
|
|
CFLAGS="$CFLAGS -I$pcap_dir"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$pcap_dir"
|
|
|
|
found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
|
|
|
|
fi
|
|
|
|
done
|
2000-08-25 06:25:21 +00:00
|
|
|
|
2001-06-27 07:47:50 +00:00
|
|
|
if test "$found_pcap_dir" != "" ; then
|
|
|
|
AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
fi
|
2000-08-25 06:25:21 +00:00
|
|
|
else
|
2001-06-27 07:47:50 +00:00
|
|
|
#
|
|
|
|
# The user specified a directory in which libpcap resides,
|
2001-07-27 07:10:13 +00:00
|
|
|
# so add the "include" subdirectory of that directory to
|
|
|
|
# the include file search path.
|
2001-06-27 07:47:50 +00:00
|
|
|
#
|
|
|
|
# XXX - if there's also a libpcap in a directory that's
|
|
|
|
# already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
|
|
|
|
# make us find the version in the specified directory,
|
|
|
|
# as the compiler and/or linker will search that other
|
|
|
|
# directory before it searches the specified directory.
|
|
|
|
#
|
2001-07-27 07:10:13 +00:00
|
|
|
CFLAGS="$CFLAGS -I$pcap_dir/include"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
|
2000-08-25 06:25:21 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Pcap header check
|
2001-01-27 23:47:16 +00:00
|
|
|
AC_CHECK_HEADERS(pcap.h)
|
2000-08-25 06:25:21 +00:00
|
|
|
])
|
|
|
|
|
1999-09-22 01:26:50 +00:00
|
|
|
#
|
|
|
|
# AC_WIRETAP_ZLIB_CHECK
|
|
|
|
#
|
|
|
|
AC_DEFUN(AC_WIRETAP_ZLIB_CHECK,
|
|
|
|
[
|
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
2001-08-18 20:09:44 +00:00
|
|
|
AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
|
1999-11-29 05:10:18 +00:00
|
|
|
|
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
2001-08-18 20:09:44 +00:00
|
|
|
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
|
1999-09-22 01:26:50 +00:00
|
|
|
])
|