1 dnl Macros that test for specific features.
2 dnl This file is part of the Autoconf packaging for Ethereal.
3 dnl Copyright (C) 1998-2000 by Gerald Combs.
5 dnl $Id: acinclude.m4,v 1.13 2002/02/06 09:58:30 guy Exp $
9 # AC_WIRETAP_PCAP_CHECK
11 AC_DEFUN(AC_WIRETAP_PCAP_CHECK,
13 if test -z "$pcap_dir"
16 # The user didn't specify a directory in which libpcap resides;
17 # we assume that the current library search path will work,
18 # but we may have to look for the header in a "pcap"
19 # subdirectory of "/usr/include" or "/usr/local/include",
20 # as some systems apparently put "pcap.h" in a "pcap"
21 # subdirectory, and we also check "$prefix/include".
23 # XXX - should we just add "$prefix/include" to the include
26 AC_MSG_CHECKING(for extraneous pcap header directories)
28 for pcap_dir in /usr/include/pcap /usr/local/include/pcap $prefix/include
30 if test -d $pcap_dir ; then
31 CFLAGS="$CFLAGS -I$pcap_dir"
32 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
33 found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
37 if test "$found_pcap_dir" != "" ; then
38 AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
40 AC_MSG_RESULT(not found)
44 # The user specified a directory in which libpcap resides,
45 # so add the "include" subdirectory of that directory to
46 # the include file search path.
48 # XXX - if there's also a libpcap in a directory that's
49 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
50 # make us find the version in the specified directory,
51 # as the compiler and/or linker will search that other
52 # directory before it searches the specified directory.
54 CFLAGS="$CFLAGS -I$pcap_dir/include"
55 CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
59 AC_CHECK_HEADERS(pcap.h)
63 # AC_WIRETAP_ZLIB_CHECK
65 AC_DEFUN(AC_WIRETAP_ZLIB_CHECK,
67 AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
69 if test x$enable_zlib != xno
72 # Well, we at least have the zlib header file.
74 # Check for "gzgets()" in zlib, because we need it, but
75 # some older versions of zlib don't have it. It appears
76 # from the zlib ChangeLog that any released version of zlib
77 # with "gzgets()" should have the other routines we
78 # depend on, such as "gzseek()", "gztell()", and "zError()".
80 # Another reason why we require "gzgets()" is that
81 # some versions of zlib that didn't have it, such
82 # as 1.0.8, had a bug in "gzseek()" that meant that it
83 # doesn't work correctly on uncompressed files; this
84 # means we cannot use version 1.0.8. (Unfortunately,
85 # that's the version that comes with recent X11 source,
86 # and many people who install XFree86 on their Slackware
87 # boxes don't realize that they should configure it to
88 # use the native zlib rather than building and installing
89 # the crappy old version that comes with XFree86.)
91 # I.e., we can't just avoid using "gzgets()", as
92 # versions of zlib without "gzgets()" are likely to have
93 # a broken "gzseek()".
95 AC_CHECK_LIB(z, gzgets,,enable_zlib=no)