1 dnl Macros that test for specific features.
2 dnl This file is part of Autoconf.
3 dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2, or (at your option)
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 dnl As a special exception, the Free Software Foundation gives unlimited
21 dnl permission to copy, distribute and modify the configure scripts that
22 dnl are the output of Autoconf. You need not follow the terms of the GNU
23 dnl General Public License when using or distributing such scripts, even
24 dnl though portions of the text of Autoconf appear in them. The GNU
25 dnl General Public License (GPL) does govern all other use of the material
26 dnl that constitutes the Autoconf program.
28 dnl Certain portions of the Autoconf source text are designed to be copied
29 dnl (in certain cases, depending on the input) into the output of
30 dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
31 dnl source text consists of comments plus executable code that decides which
32 dnl of the data portions to output in any given case. We call these
33 dnl comments and executable code the "non-data" portions. Autoconf never
34 dnl copies any of the non-data portions into its output.
36 dnl This special exception to the GPL applies to versions of Autoconf
37 dnl released by the Free Software Foundation. When you make and
38 dnl distribute a modified version of Autoconf, you may extend this special
39 dnl exception to the GPL to apply to your modified version as well, *unless*
40 dnl your modified version has the potential to copy into its output some
41 dnl of the text that was the non-data portion of the version that you started
42 dnl with. (In other words, unless your change moves or copies text from
43 dnl the non-data portions to the data portions.) If your modification has
44 dnl such potential, you must delete any notice of this special exception
45 dnl to the GPL from your modified version.
47 dnl Written by David MacKenzie, with help from
48 dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
49 dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
52 # AC_ETHEREAL_STRUCT_SA_LEN
54 dnl AC_STRUCT_ST_BLKSIZE extracted from the file in qustion,
55 dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
56 dnl AC_ETHEREAL_STRUCT_SA_LEN, which checks if "struct sockaddr"
57 dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
58 dnl what's in this file.
59 dnl Done by Guy Harris <guy@alum.mit.edu> on 1998-11-14.
61 dnl ### Checks for structure members
63 AC_DEFUN(AC_ETHEREAL_STRUCT_SA_LEN,
64 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_ethereal_struct_sa_len,
65 [AC_TRY_COMPILE([#include <sys/types.h>
66 #include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
67 ac_cv_ethereal_struct_sa_len=yes, ac_cv_ethereal_struct_sa_len=no)])
68 if test $ac_cv_ethereal_struct_sa_len = yes; then
69 AC_DEFINE(HAVE_SA_LEN)
75 # AC_ETHEREAL_IPV6_STACK
77 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
79 AC_DEFUN(AC_ETHEREAL_IPV6_STACK,
84 AC_MSG_CHECKING([ipv6 stack type])
85 for i in v6d toshiba kame inria zeta linux; do
88 AC_EGREP_CPP(yes, [dnl
89 #include </usr/local/v6/include/sys/types.h>
94 v6libdir=/usr/local/v6/lib;
95 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
98 AC_EGREP_CPP(yes, [dnl
99 #include <sys/param.h>
100 #ifdef _TOSHIBA_INET6
103 [v6type=$i; v6lib=inet6;
104 v6libdir=/usr/local/v6/lib;
105 CFLAGS="-DINET6 $CFLAGS"])
108 AC_EGREP_CPP(yes, [dnl
109 #include <netinet/in.h>
113 [v6type=$i; v6lib=inet6;
114 v6libdir=/usr/local/v6/lib;
115 CFLAGS="-DINET6 $CFLAGS"])
118 AC_EGREP_CPP(yes, [dnl
119 #include <netinet/in.h>
120 #ifdef IPV6_INRIA_VERSION
123 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
126 AC_EGREP_CPP(yes, [dnl
127 #include <sys/param.h>
128 #ifdef _ZETA_MINAMI_INET6
131 [v6type=$i; v6lib=inet6;
132 v6libdir=/usr/local/v6/lib;
133 CFLAGS="-DINET6 $CFLAGS"])
136 if test -d /usr/inet6; then
140 CFLAGS="-DINET6 $CFLAGS"
144 if test "$v6type" != "unknown"; then
149 if test "$v6lib" != "none"; then
150 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
151 if test -d $dir -a -f $dir/lib$v6lib.a; then
152 LIBS="-L$dir $LIBS -l$v6lib"
160 AC_MSG_RESULT(["$v6type, $v6lib"])
164 # AC_ETHEREAL_PCAP_CHECK
166 AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
168 # Evidently, some systems have pcap.h, etc. in */include/pcap
169 AC_MSG_CHECKING(for extraneous pcap header directories)
171 for pcap_dir in /usr/include/pcap /usr/local/include/pcap $prefix/include
173 if test -d $pcap_dir ; then
174 LIBS="$LIBS -L$pcap_dir"
175 CFLAGS="$CFLAGS -I$pcap_dir"
176 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
177 found_pcap_dir=" $found_pcap_dir -L$pcap_dir"
181 if test "$found_pcap_dir" != "" ; then
182 AC_MSG_RESULT(found --$found_pcap_dir added to LIBS and CFLAGS)
184 AC_MSG_RESULT(not found)
188 AC_CHECK_HEADER(net/bpf.h,,
189 AC_MSG_ERROR([[Header file net/bpf.h not found; if you installed libpcap from source, did you also do \"make install-incl\"?]]))
190 AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
191 AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
195 # AC_ETHEREAL_ZLIB_CHECK
197 AC_DEFUN(AC_ETHEREAL_ZLIB_CHECK,
199 AC_CHECK_HEADER(zlib.h,,enable_zlib=no)
200 AC_CHECK_LIB(z, gzopen,,enable_zlib=no)
201 AC_CHECK_LIB(z, gzseek,,enable_zlib=no)
202 AC_CHECK_LIB(z, gztell,,enable_zlib=no)
203 AC_CHECK_LIB(z, gzgets,,enable_zlib=no)
204 AC_CHECK_LIB(z, zError,,enable_zlib=no)
208 # AC_ETHEREAL_UCDSNMP_CHECK
210 AC_DEFUN(AC_ETHEREAL_UCDSNMP_CHECK,
215 [ --with-ucdsnmp=DIR use UCD SNMP client library, located in directory DIR.], [
216 if test $withval = no
221 ucdsnmp_user_dir=$withval
225 if test $want_ucdsnmp = yes
229 for d in $ucdsnmp_user_dir $prefix
233 if test x$d != x/usr/local && test -f $d/include/ucd-snmp/snmp.h
235 AC_MSG_RESULT(found ucd-snmp in $d)
241 if test x$ucdsnmpdir != x
243 AC_MSG_RESULT(added $d to paths)
244 CFLAGS="$CFLAGS -I${ucdsnmpdir}/include"
245 CPPFLAGS="$CPPFLAGS -I${ucdsnmpdir}/include"
246 LIBS="$LIBS -L${ucdsnmpdir}/lib"