xref: /freebsd/contrib/tcpdump/configure.in (revision cac3dcd5f981d8843fb0acc27b4d28af1339af66)
127df3f5dSRui Paulodnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL)
24edb46e9SPaul Trainadnl
34644f044SBill Fennerdnl Copyright (c) 1994, 1995, 1996, 1997
44edb46e9SPaul Trainadnl	The Regents of the University of California.  All rights reserved.
54edb46e9SPaul Trainadnl
64edb46e9SPaul Trainadnl Process this file with autoconf to produce a configure script.
74edb46e9SPaul Trainadnl
84edb46e9SPaul Traina
927df3f5dSRui Paulo#
1027df3f5dSRui Paulo# See
1127df3f5dSRui Paulo#
1227df3f5dSRui Paulo#	http://ftp.gnu.org/gnu/config/README
1327df3f5dSRui Paulo#
1427df3f5dSRui Paulo# for the URLs to use to fetch new versions of config.guess and
1527df3f5dSRui Paulo# config.sub.
1627df3f5dSRui Paulo#
1727df3f5dSRui Paulo
1827df3f5dSRui PauloAC_REVISION($Revision: 1.204 $)
195b0fe478SBruce M SimpsonAC_PREREQ(2.50)
204edb46e9SPaul TrainaAC_INIT(tcpdump.c)
214edb46e9SPaul Traina
22a90e161bSBill FennerAC_CANONICAL_HOST
234edb46e9SPaul Traina
2427df3f5dSRui PauloAC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
2527df3f5dSRui PauloAC_PROG_CC
264edb46e9SPaul TrainaAC_LBL_C_INIT(V_CCOPT, V_INCLS)
279afd0c29SBill FennerAC_LBL_C_INLINE
28685295f4SBill FennerAC_C___ATTRIBUTE__
2927df3f5dSRui Pauloif test "$ac_cv___attribute__" = "yes"; then
3027df3f5dSRui Paulo	AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
3127df3f5dSRui Paulofi
32*cac3dcd5SXin LIAC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
33b5bfcb5dSMax LaierAC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
34b5bfcb5dSMax Laier#include <sys/socket.h>
35b5bfcb5dSMax Laier#include <net/if.h>])
36a5779b6eSRui Pauloif test "$ac_cv_header_net_pfvar_h" = yes; then
37b5bfcb5dSMax Laier	LOCALSRC="print-pflog.c $LOCALSRC"
38b5bfcb5dSMax Laierfi
395b0fe478SBruce M SimpsonAC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
405b0fe478SBruce M Simpson#include <sys/socket.h>])
411de50e9fSSam Lefflerif test "$ac_cv_header_netinet_if_ether_h" != yes; then
421de50e9fSSam Leffler	#
431de50e9fSSam Leffler	# The simple test didn't work.
441de50e9fSSam Leffler	# Do we need to include <net/if.h> first?
451de50e9fSSam Leffler	# Unset ac_cv_header_netinet_if_ether_h so we don't
461de50e9fSSam Leffler	# treat the previous failure as a cached value and
471de50e9fSSam Leffler	# suppress the next test.
481de50e9fSSam Leffler	#
491de50e9fSSam Leffler	AC_MSG_NOTICE([Rechecking with some additional includes])
501de50e9fSSam Leffler	unset ac_cv_header_netinet_if_ether_h
511de50e9fSSam Leffler	AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
521de50e9fSSam Leffler#include <sys/socket.h>
531de50e9fSSam Leffler#include <netinet/in.h>
541de50e9fSSam Lefflerstruct mbuf;
551de50e9fSSam Lefflerstruct rtentry;
561de50e9fSSam Leffler#include <net/if.h>])
571de50e9fSSam Lefflerfi
581de50e9fSSam Leffler
594edb46e9SPaul TrainaAC_HEADER_TIME
604edb46e9SPaul Traina
61a90e161bSBill Fennercase "$host_os" in
624644f044SBill Fenner
63*cac3dcd5SXin LIdarwin*)
64*cac3dcd5SXin LI	AC_ARG_ENABLE(universal,
65*cac3dcd5SXin LI	AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
66*cac3dcd5SXin LI	if test "$enable_universal" != "no"; then
67*cac3dcd5SXin LI		case "$host_os" in
68*cac3dcd5SXin LI
69*cac3dcd5SXin LI		darwin9.*)
70*cac3dcd5SXin LI			#
71*cac3dcd5SXin LI			# Leopard.  Build for x86 and 32-bit PowerPC, with
72*cac3dcd5SXin LI			# x86 first.  (That's what Apple does.)
73*cac3dcd5SXin LI			#
74*cac3dcd5SXin LI			V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
75*cac3dcd5SXin LI			LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
76*cac3dcd5SXin LI			;;
77*cac3dcd5SXin LI
78*cac3dcd5SXin LI		darwin10.*)
79*cac3dcd5SXin LI			#
80*cac3dcd5SXin LI			# Snow Leopard.  Build for x86-64 and x86, with
81*cac3dcd5SXin LI			# x86-64 first.  (That's what Apple does.)
82*cac3dcd5SXin LI			#
83*cac3dcd5SXin LI			V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
84*cac3dcd5SXin LI			LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
85*cac3dcd5SXin LI			;;
86*cac3dcd5SXin LI		esac
87*cac3dcd5SXin LI	fi
88*cac3dcd5SXin LI	;;
89*cac3dcd5SXin LI
904644f044SBill Fennerlinux*)
914644f044SBill Fenner	AC_MSG_CHECKING(Linux kernel version)
92685295f4SBill Fenner 	if test "$cross_compiling" = yes; then
93685295f4SBill Fenner 		AC_CACHE_VAL(ac_cv_linux_vers,
94685295f4SBill Fenner 		    ac_cv_linux_vers=unknown)
95685295f4SBill Fenner 	else
964644f044SBill Fenner 		AC_CACHE_VAL(ac_cv_linux_vers,
974644f044SBill Fenner 		    ac_cv_linux_vers=`uname -r 2>&1 | \
984644f044SBill Fenner 			sed -n -e '$s/.* //' -e '$s/\..*//p'`)
99685295f4SBill Fenner 	fi
1004644f044SBill Fenner	AC_MSG_RESULT($ac_cv_linux_vers)
101685295f4SBill Fenner 	if test $ac_cv_linux_vers = unknown ; then
102685295f4SBill Fenner 		AC_MSG_ERROR(cannot determine linux version when cross-compiling)
103685295f4SBill Fenner 	fi
1044644f044SBill Fenner	if test $ac_cv_linux_vers -lt 2 ; then
1054644f044SBill Fenner		AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
1064644f044SBill Fenner	fi
1074644f044SBill Fenner	;;
1084644f044SBill Fenner
1094644f044SBill Fenner*)
1104644f044SBill Fenner	;;
1114644f044SBill Fenneresac
1124644f044SBill Fenner
113b0453382SBill Fenner
11427df3f5dSRui PauloAC_ARG_WITH(smi,
11527df3f5dSRui Paulo[  --with-smi              link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
11627df3f5dSRui Paulo  --without-smi           don't link with libsmi],,
11727df3f5dSRui Paulo   with_smi=yes)
11827df3f5dSRui Paulo
11927df3f5dSRui Pauloif test "x$with_smi" != "xno" ; then
120b0453382SBill FennerAC_CHECK_HEADERS(smi.h)
121685295f4SBill FennerAC_CHECK_LIB(smi, smiInit)
122a90e161bSBill Fennerif test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
123a90e161bSBill Fennerthen
124b0453382SBill FennerAC_MSG_CHECKING([whether to enable libsmi])
125b0453382SBill Fenner        AC_TRY_RUN([ /* libsmi available check */
126b0453382SBill Fenner#include <smi.h>
127b0453382SBill Fennermain()
128b0453382SBill Fenner{
129685295f4SBill Fenner  int current, revision, age, n;
130685295f4SBill Fenner  const int required = 2;
131b0453382SBill Fenner  if (smiInit(""))
132b0453382SBill Fenner    exit(1);
133685295f4SBill Fenner  if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
134685295f4SBill Fenner    exit(2);
135685295f4SBill Fenner  n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
136685295f4SBill Fenner  if (n != 3)
137685295f4SBill Fenner    exit(3);
138685295f4SBill Fenner  if (required < current - age || required > current)
139685295f4SBill Fenner    exit(4);
140b0453382SBill Fenner  exit(0);
141b0453382SBill Fenner}
142b0453382SBill Fenner],
143b0453382SBill Fenner[ AC_MSG_RESULT(yes)
144b0453382SBill Fenner  AC_DEFINE(LIBSMI)
145b0453382SBill Fenner  libsmi=yes],
146a90e161bSBill Fennerdnl autoconf documentation says that $? contains the exit value.
147a90e161bSBill Fennerdnl reality is that it does not.  We leave this in just in case
148a90e161bSBill Fennerdnl autoconf ever comes back to match the documentation.
149a90e161bSBill Fenner[ case $? in
150a90e161bSBill Fenner  1) AC_MSG_RESULT(no - smiInit failed) ;;
151a90e161bSBill Fenner  2) AC_MSG_RESULT(no - header/library version mismatch) ;;
152a90e161bSBill Fenner  3) AC_MSG_RESULT(no - can't determine library version) ;;
153a90e161bSBill Fenner  4) AC_MSG_RESULT(no - too old) ;;
154a90e161bSBill Fenner  *) AC_MSG_RESULT(no) ;;
155a90e161bSBill Fenner  esac
156685295f4SBill Fenner  libsmi=no],
157685295f4SBill Fenner[ AC_MSG_RESULT(not when cross-compiling)
158b0453382SBill Fenner  libsmi=no]
159b0453382SBill Fenner)
160a90e161bSBill Fennerfi
16127df3f5dSRui Paulofi
162b0453382SBill Fenner
163a90e161bSBill FennerAC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
164a90e161bSBill FennerAC_ARG_ENABLE(smb,
165a90e161bSBill Fenner[  --enable-smb            enable possibly-buggy SMB printer [default=yes]
166a90e161bSBill Fenner  --disable-smb           disable possibly-buggy SMB printer],,
167a90e161bSBill Fenner   enableval=yes)
168a90e161bSBill Fennercase "$enableval" in
169a90e161bSBill Fenneryes)	AC_MSG_RESULT(yes)
170a90e161bSBill Fenner	AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
171a90e161bSBill Fenner	AC_DEFINE(TCPDUMP_DO_SMB)
172a90e161bSBill Fenner	LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
173a90e161bSBill Fenner	;;
174a90e161bSBill Fenner*)	AC_MSG_RESULT(no)
175a90e161bSBill Fenner	;;
176a90e161bSBill Fenneresac
177b0453382SBill Fenner
1781de50e9fSSam LefflerAC_ARG_WITH(user, [  --with-user=USERNAME    drop privileges by default to USERNAME])
1791de50e9fSSam LefflerAC_MSG_CHECKING([whether to drop root privileges by default])
1801de50e9fSSam Lefflerif test ! -z "$with_user" ; then
1811de50e9fSSam Leffler        AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
1821de50e9fSSam Leffler       AC_MSG_RESULT(to \"$withval\")
1831de50e9fSSam Lefflerelse
1841de50e9fSSam Leffler       AC_MSG_RESULT(no)
1851de50e9fSSam Lefflerfi
1861de50e9fSSam Leffler
1871de50e9fSSam LefflerAC_ARG_WITH(chroot, [  --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
1881de50e9fSSam LefflerAC_MSG_CHECKING([whether to chroot])
18927df3f5dSRui Pauloif test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
1901de50e9fSSam Leffler        AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
1911de50e9fSSam Leffler       AC_MSG_RESULT(to \"$withval\")
1921de50e9fSSam Lefflerelse
1931de50e9fSSam Leffler       AC_MSG_RESULT(no)
1941de50e9fSSam Lefflerfi
1951de50e9fSSam Leffler
196b0453382SBill FennerAC_MSG_CHECKING([whether to enable ipv6])
197b0453382SBill FennerAC_ARG_ENABLE(ipv6,
198b0453382SBill Fenner[  --enable-ipv6           enable ipv6 (with ipv4) support
199b0453382SBill Fenner  --disable-ipv6          disable ipv6 support],
200b0453382SBill Fenner[ case "$enableval" in
201b0453382SBill Fenneryes)   AC_MSG_RESULT(yes)
202*cac3dcd5SXin LI       LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
203b0453382SBill Fenner       AC_DEFINE(INET6)
204b0453382SBill Fenner       ipv6=yes
205b0453382SBill Fenner       ;;
206b0453382SBill Fenner*)
207b0453382SBill Fenner       AC_MSG_RESULT(no)
208b0453382SBill Fenner       ipv6=no
209b0453382SBill Fenner       ;;
210b0453382SBill Fenner  esac ],
211b0453382SBill Fenner
212b0453382SBill Fenner  AC_TRY_RUN([ /* AF_INET6 available check */
213b0453382SBill Fenner#include <sys/types.h>
214b0453382SBill Fenner#include <sys/socket.h>
215b0453382SBill Fennermain()
216b0453382SBill Fenner{
217b0453382SBill Fenner if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
218b0453382SBill Fenner   exit(1);
219b0453382SBill Fenner else
220b0453382SBill Fenner   exit(0);
221b0453382SBill Fenner}
222b0453382SBill Fenner],
223b0453382SBill Fenner[ AC_MSG_RESULT(yes)
224*cac3dcd5SXin LI  LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
225b0453382SBill Fenner  AC_DEFINE(INET6)
226b0453382SBill Fenner  ipv6=yes],
227b0453382SBill Fenner[ AC_MSG_RESULT(no)
228b0453382SBill Fenner  ipv6=no],
229b0453382SBill Fenner[ AC_MSG_RESULT(no)
230b0453382SBill Fenner  ipv6=no]
231b0453382SBill Fenner))
232b0453382SBill Fenner
233b0453382SBill Fenneripv6type=unknown
234b0453382SBill Fenneripv6lib=none
235b0453382SBill Fenneripv6trylibc=no
236b0453382SBill Fenner
237b0453382SBill Fennerif test "$ipv6" = "yes"; then
238b0453382SBill Fenner	AC_MSG_CHECKING([ipv6 stack type])
239b0453382SBill Fenner	for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
240b0453382SBill Fenner		case $i in
241b0453382SBill Fenner		inria)
242b0453382SBill Fenner			dnl http://www.kame.net/
2435b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
2445b0fe478SBruce M Simpson[#include <netinet/in.h>
245b0453382SBill Fenner#ifdef IPV6_INRIA_VERSION
246b0453382SBill Fenneryes
247b0453382SBill Fenner#endif],
248b0453382SBill Fenner				[ipv6type=$i;
249b0453382SBill Fenner				CFLAGS="-DINET6 $CFLAGS"])
250b0453382SBill Fenner			;;
251b0453382SBill Fenner		kame)
252b0453382SBill Fenner			dnl http://www.kame.net/
2535b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
2545b0fe478SBruce M Simpson[#include <netinet/in.h>
255b0453382SBill Fenner#ifdef __KAME__
256b0453382SBill Fenneryes
257b0453382SBill Fenner#endif],
258b0453382SBill Fenner				[ipv6type=$i;
259b0453382SBill Fenner				ipv6lib=inet6;
260b0453382SBill Fenner				ipv6libdir=/usr/local/v6/lib;
261b0453382SBill Fenner				ipv6trylibc=yes;
262b0453382SBill Fenner				CFLAGS="-DINET6 $CFLAGS"])
263b0453382SBill Fenner			;;
264b0453382SBill Fenner		linux-glibc)
265b0453382SBill Fenner			dnl http://www.v6.linux.or.jp/
2665b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
2675b0fe478SBruce M Simpson[#include <features.h>
268b0453382SBill Fenner#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
269b0453382SBill Fenneryes
270b0453382SBill Fenner#endif],
271b0453382SBill Fenner				[ipv6type=$i;
272b0453382SBill Fenner				CFLAGS="-DINET6 $CFLAGS"])
273b0453382SBill Fenner			;;
274b0453382SBill Fenner		linux-libinet6)
275b0453382SBill Fenner			dnl http://www.v6.linux.or.jp/
2765b0fe478SBruce M Simpson			dnl
2775b0fe478SBruce M Simpson			dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
2785b0fe478SBruce M Simpson			dnl and possibly other versions of those OSes
2795b0fe478SBruce M Simpson			dnl
280b0453382SBill Fenner			if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
281b0453382SBill Fenner				ipv6type=$i
282b0453382SBill Fenner				ipv6lib=inet6
283b0453382SBill Fenner				ipv6libdir=/usr/inet6/lib
284b0453382SBill Fenner				ipv6trylibc=yes;
285b0453382SBill Fenner				CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
286b0453382SBill Fenner			fi
287b0453382SBill Fenner			;;
288b0453382SBill Fenner		toshiba)
2895b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
2905b0fe478SBruce M Simpson[#include <sys/param.h>
291b0453382SBill Fenner#ifdef _TOSHIBA_INET6
292b0453382SBill Fenneryes
293b0453382SBill Fenner#endif],
294b0453382SBill Fenner				[ipv6type=$i;
295b0453382SBill Fenner				ipv6lib=inet6;
296b0453382SBill Fenner				ipv6libdir=/usr/local/v6/lib;
297b0453382SBill Fenner				CFLAGS="-DINET6 $CFLAGS"])
298b0453382SBill Fenner			;;
299b0453382SBill Fenner		v6d)
3005b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
3015b0fe478SBruce M Simpson[#include </usr/local/v6/include/sys/v6config.h>
302b0453382SBill Fenner#ifdef __V6D__
303b0453382SBill Fenneryes
304b0453382SBill Fenner#endif],
305b0453382SBill Fenner				[ipv6type=$i;
306b0453382SBill Fenner				ipv6lib=v6;
307b0453382SBill Fenner				ipv6libdir=/usr/local/v6/lib;
308b0453382SBill Fenner				CFLAGS="-I/usr/local/v6/include $CFLAGS"])
309b0453382SBill Fenner			;;
310b0453382SBill Fenner		zeta)
3115b0fe478SBruce M Simpson			AC_EGREP_CPP(yes,
3125b0fe478SBruce M Simpson[#include <sys/param.h>
313b0453382SBill Fenner#ifdef _ZETA_MINAMI_INET6
314b0453382SBill Fenneryes
315b0453382SBill Fenner#endif],
316b0453382SBill Fenner				[ipv6type=$i;
317b0453382SBill Fenner				ipv6lib=inet6;
318b0453382SBill Fenner				ipv6libdir=/usr/local/v6/lib;
319b0453382SBill Fenner				CFLAGS="-DINET6 $CFLAGS"])
320b0453382SBill Fenner			;;
321b0453382SBill Fenner		esac
322b0453382SBill Fenner		if test "$ipv6type" != "unknown"; then
323b0453382SBill Fenner			break
324b0453382SBill Fenner		fi
325b0453382SBill Fenner	done
326b0453382SBill Fenner	AC_MSG_RESULT($ipv6type)
327b0453382SBill Fennerfi
328b0453382SBill Fenner
329b0453382SBill Fennerif test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
330b0453382SBill Fenner	if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
331b0453382SBill Fenner		LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
332b0453382SBill Fenner		echo "You have $ipv6lib library, using it"
333b0453382SBill Fenner	else
334b0453382SBill Fenner		if test "$ipv6trylibc" = "yes"; then
335b0453382SBill Fenner			echo "You do not have $ipv6lib library, using libc"
336b0453382SBill Fenner		else
337b0453382SBill Fenner			echo 'Fatal: no $ipv6lib library found.  cannot continue.'
338b0453382SBill Fenner			echo "You need to fetch lib$ipv6lib.a from appropriate"
339b0453382SBill Fenner			echo 'ipv6 kit and compile beforehand.'
340b0453382SBill Fenner			exit 1
341b0453382SBill Fenner		fi
342b0453382SBill Fenner	fi
343b0453382SBill Fennerfi
344b0453382SBill Fenner
345b0453382SBill Fenner
346b0453382SBill Fennerif test "$ipv6" = "yes"; then
3475b0fe478SBruce M Simpson	#
3485b0fe478SBruce M Simpson	# XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
3495b0fe478SBruce M Simpson	# function in libc; there are "ngetaddrinfo()" and
3505b0fe478SBruce M Simpson	# "ogetaddrinfo()" functions, and <netdb.h> #defines
3515b0fe478SBruce M Simpson	# "getaddrinfo" to be either "ngetaddrinfo" or
3525b0fe478SBruce M Simpson	# "ogetaddrinfo", depending on whether _SOCKADDR_LEN
3535b0fe478SBruce M Simpson	# or _XOPEN_SOURCE_EXTENDED are defined or not.
3545b0fe478SBruce M Simpson	#
3555b0fe478SBruce M Simpson	# So this test doesn't work on Tru64 5.1, and possibly
3565b0fe478SBruce M Simpson	# on other 5.x releases.  This causes the configure
3575b0fe478SBruce M Simpson	# script to become confused, and results in libpcap
3585b0fe478SBruce M Simpson	# being unbuildable.
3595b0fe478SBruce M Simpson	#
360685295f4SBill Fenner	AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
361b0453382SBill Fenner	AC_MSG_CHECKING(getaddrinfo bug)
3625b0fe478SBruce M Simpson	AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
363b0453382SBill Fenner#include <sys/types.h>
364b0453382SBill Fenner#include <netdb.h>
365b0453382SBill Fenner#include <string.h>
366b0453382SBill Fenner#include <sys/socket.h>
367b0453382SBill Fenner#include <netinet/in.h>
368b0453382SBill Fenner
369b0453382SBill Fennermain()
370b0453382SBill Fenner{
371b0453382SBill Fenner  int passive, gaierr, inet4 = 0, inet6 = 0;
372b0453382SBill Fenner  struct addrinfo hints, *ai, *aitop;
373b0453382SBill Fenner  char straddr[INET6_ADDRSTRLEN], strport[16];
374b0453382SBill Fenner
375b0453382SBill Fenner  for (passive = 0; passive <= 1; passive++) {
376b0453382SBill Fenner    memset(&hints, 0, sizeof(hints));
377b0453382SBill Fenner    hints.ai_family = AF_UNSPEC;
378b0453382SBill Fenner    hints.ai_flags = passive ? AI_PASSIVE : 0;
379b0453382SBill Fenner    hints.ai_socktype = SOCK_STREAM;
3805b0fe478SBruce M Simpson    hints.ai_protocol = IPPROTO_TCP;
381b0453382SBill Fenner    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
382b0453382SBill Fenner      (void)gai_strerror(gaierr);
383b0453382SBill Fenner      goto bad;
384b0453382SBill Fenner    }
385b0453382SBill Fenner    for (ai = aitop; ai; ai = ai->ai_next) {
386b0453382SBill Fenner      if (ai->ai_addr == NULL ||
387b0453382SBill Fenner          ai->ai_addrlen == 0 ||
388b0453382SBill Fenner          getnameinfo(ai->ai_addr, ai->ai_addrlen,
389b0453382SBill Fenner                      straddr, sizeof(straddr), strport, sizeof(strport),
390b0453382SBill Fenner                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
391b0453382SBill Fenner        goto bad;
392b0453382SBill Fenner      }
393b0453382SBill Fenner      switch (ai->ai_family) {
394b0453382SBill Fenner      case AF_INET:
395b0453382SBill Fenner        if (strcmp(strport, "54321") != 0) {
396b0453382SBill Fenner          goto bad;
397b0453382SBill Fenner        }
398b0453382SBill Fenner        if (passive) {
399b0453382SBill Fenner          if (strcmp(straddr, "0.0.0.0") != 0) {
400b0453382SBill Fenner            goto bad;
401b0453382SBill Fenner          }
402b0453382SBill Fenner        } else {
403b0453382SBill Fenner          if (strcmp(straddr, "127.0.0.1") != 0) {
404b0453382SBill Fenner            goto bad;
405b0453382SBill Fenner          }
406b0453382SBill Fenner        }
407b0453382SBill Fenner        inet4++;
408b0453382SBill Fenner        break;
409b0453382SBill Fenner      case AF_INET6:
410b0453382SBill Fenner        if (strcmp(strport, "54321") != 0) {
411b0453382SBill Fenner          goto bad;
412b0453382SBill Fenner        }
413b0453382SBill Fenner        if (passive) {
414b0453382SBill Fenner          if (strcmp(straddr, "::") != 0) {
415b0453382SBill Fenner            goto bad;
416b0453382SBill Fenner          }
417b0453382SBill Fenner        } else {
418b0453382SBill Fenner          if (strcmp(straddr, "::1") != 0) {
419b0453382SBill Fenner            goto bad;
420b0453382SBill Fenner          }
421b0453382SBill Fenner        }
422b0453382SBill Fenner        inet6++;
423b0453382SBill Fenner        break;
424b0453382SBill Fenner      case AF_UNSPEC:
425b0453382SBill Fenner        goto bad;
426b0453382SBill Fenner        break;
427b0453382SBill Fenner#ifdef AF_UNIX
428b0453382SBill Fenner      case AF_UNIX:
429b0453382SBill Fenner#else
430b0453382SBill Fenner#ifdef AF_LOCAL
431b0453382SBill Fenner      case AF_LOCAL:
432b0453382SBill Fenner#endif
433b0453382SBill Fenner#endif
434b0453382SBill Fenner      default:
435b0453382SBill Fenner        /* another family support? */
436b0453382SBill Fenner        break;
437b0453382SBill Fenner      }
438b0453382SBill Fenner    }
439b0453382SBill Fenner  }
440b0453382SBill Fenner
441b0453382SBill Fenner  /* supported family should be 2, unsupported family should be 0 */
442b0453382SBill Fenner  if (!(inet4 == 0 || inet4 == 2))
443b0453382SBill Fenner    goto bad;
444b0453382SBill Fenner  if (!(inet6 == 0 || inet6 == 2))
445b0453382SBill Fenner    goto bad;
446b0453382SBill Fenner
447b0453382SBill Fenner  if (aitop)
448b0453382SBill Fenner    freeaddrinfo(aitop);
449b0453382SBill Fenner  exit(0);
450b0453382SBill Fenner
451b0453382SBill Fenner bad:
452b0453382SBill Fenner  if (aitop)
453b0453382SBill Fenner    freeaddrinfo(aitop);
454b0453382SBill Fenner  exit(1);
455b0453382SBill Fenner}
456b0453382SBill Fenner],
4575b0fe478SBruce M Simpson	td_cv_buggygetaddrinfo=no,
4585b0fe478SBruce M Simpson	td_cv_buggygetaddrinfo=yes,
4595b0fe478SBruce M Simpson	td_cv_buggygetaddrinfo=yes)])
4605b0fe478SBruce M Simpson	if test "$td_cv_buggygetaddrinfo" = no; then
461b0453382SBill Fenner		AC_MSG_RESULT(good)
4625b0fe478SBruce M Simpson	else
463b0453382SBill Fenner		AC_MSG_RESULT(buggy)
4645b0fe478SBruce M Simpson	fi
465b0453382SBill Fenner
4665b0fe478SBruce M Simpson	if test "$td_cv_buggygetaddrinfo" = "yes"; then
4675b0fe478SBruce M Simpson		#
4685b0fe478SBruce M Simpson		# XXX - it doesn't appear that "ipv6type" can ever be
4695b0fe478SBruce M Simpson		# set to "linux".  Should this be testing for
4705b0fe478SBruce M Simpson		# "linux-glibc", or for that *or* "linux-libinet6"?
4715b0fe478SBruce M Simpson		# If the latter, note that "linux-libinet6" is also
4725b0fe478SBruce M Simpson		# the type given to some non-Linux OSes.
4735b0fe478SBruce M Simpson		#
474b0453382SBill Fenner		if test "$ipv6type" != "linux"; then
475b0453382SBill Fenner			echo 'Fatal: You must get working getaddrinfo() function.'
476b0453382SBill Fenner			echo '       or you can specify "--disable-ipv6"'.
477b0453382SBill Fenner			exit 1
478b0453382SBill Fenner		else
479b0453382SBill Fenner			echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
4805b0fe478SBruce M Simpson			echo '         Better upgrade your system library to newest version'
481b0453382SBill Fenner			echo '         of GNU C library (aka glibc).'
482b0453382SBill Fenner		fi
483b0453382SBill Fenner	fi
4845b0fe478SBruce M Simpson	])
48527df3f5dSRui Paulo	AC_REPLACE_FUNCS(getnameinfo)
486b0453382SBill Fennerfi
487b0453382SBill Fenner
4885b0fe478SBruce M SimpsonAC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
4895b0fe478SBruce M Simpson[td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
4905b0fe478SBruce M Simpson[AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
4915b0fe478SBruce M Simpson	td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
4925b0fe478SBruce M Simpson	td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
4935b0fe478SBruce M Simpsonif test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
4945b0fe478SBruce M Simpson	AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
495b0453382SBill Fennerfi
496b0453382SBill Fenner
497b0453382SBill Fennerdnl
498b0453382SBill Fennerdnl Checks for addrinfo structure
499b0453382SBill FennerAC_STRUCT_ADDRINFO(ac_cv_addrinfo)
500b0453382SBill Fennerif test "$ac_cv_addrinfo" = no; then
501b0453382SBill Fenner	missing_includes=yes
502b0453382SBill Fennerfi
503b0453382SBill Fenner
504b0453382SBill Fennerdnl
505b0453382SBill Fennerdnl Checks for NI_MAXSERV
506b0453382SBill FennerAC_NI_MAXSERV(ac_cv_maxserv)
507b0453382SBill Fennerif test "$ac_cv_maxserv" = no; then
508b0453382SBill Fenner	missing_includes=yes
509b0453382SBill Fennerfi
510b0453382SBill Fenner
511b0453382SBill Fennerdnl
512b0453382SBill Fennerdnl Checks for NI_NAMEREQD
513b0453382SBill FennerAC_NI_NAMEREQD(ac_cv_namereqd)
514b0453382SBill Fennerif test "$ac_cv_namereqd" = no; then
515b0453382SBill Fenner	missing_includes=yes
516b0453382SBill Fennerfi
517b0453382SBill Fenner
518b0453382SBill Fennerdnl
519b0453382SBill Fennerdnl Checks for sockaddr_storage structure
520b0453382SBill FennerAC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
521b0453382SBill Fennerif test "$ac_cv_sa_storage" = no; then
522b0453382SBill Fenner	missing_includes=yes
523b0453382SBill Fennerfi
524b0453382SBill Fenner
5255b0fe478SBruce M SimpsonAC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
526*cac3dcd5SXin LIAC_CHECK_FUNCS(fork vfork strftime)
5271de50e9fSSam LefflerAC_CHECK_FUNCS(setlinebuf alarm)
528685295f4SBill Fenner
529685295f4SBill Fennerneedsnprintf=no
530685295f4SBill FennerAC_CHECK_FUNCS(vsnprintf snprintf,,
531685295f4SBill Fenner	[needsnprintf=yes])
532685295f4SBill Fennerif test $needsnprintf = yes; then
5331de50e9fSSam Leffler	AC_LIBOBJ(snprintf)
534685295f4SBill Fennerfi
5354edb46e9SPaul Traina
536a90e161bSBill FennerAC_LBL_TYPE_SIGNAL
5374de76e31SBill Fenner
5385b0fe478SBruce M SimpsonAC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
539a90e161bSBill Fenner
540a90e161bSBill FennerAC_CHECK_LIB(rpc, main)		dnl It's unclear why we might need -lrpc
541a90e161bSBill Fenner
5421de50e9fSSam Lefflerdnl Some platforms may need -lnsl for getrpcbynumber.
5431de50e9fSSam LefflerAC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
544a90e161bSBill Fenner
545685295f4SBill Fennerdnl AC_CHECK_LIB(z, uncompress)
546685295f4SBill Fennerdnl AC_CHECK_HEADERS(zlib.h)
5474edb46e9SPaul Traina
5484edb46e9SPaul TrainaAC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
5494edb46e9SPaul Traina
5505b0fe478SBruce M Simpson#
5515b0fe478SBruce M Simpson# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
5525b0fe478SBruce M Simpson# libraries (e.g., "-lsocket -lnsl" on Solaris).
5535b0fe478SBruce M Simpson#
5545b0fe478SBruce M Simpson# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
5555b0fe478SBruce M Simpson# use AC_CHECK_FUNC which doesn't let us specify the right #includes
5565b0fe478SBruce M Simpson# to make this work on BSD/OS 4.x.  BSD/OS 4.x ships with the BIND8
5575b0fe478SBruce M Simpson# resolver, and the way it defines inet_{ntop,pton} is rather strange;
5585b0fe478SBruce M Simpson# it does not ship with a libc symbol "inet_ntop()", it ships with
5595b0fe478SBruce M Simpson# "_inet_ntop()", and has a #define macro in one of the system headers
5605b0fe478SBruce M Simpson# to rename it.
5615b0fe478SBruce M Simpson#
5625b0fe478SBruce M Simpsondnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
5635b0fe478SBruce M SimpsonAC_MSG_CHECKING(for inet_ntop)
5645b0fe478SBruce M SimpsonAC_TRY_LINK([#include <sys/types.h>
5655b0fe478SBruce M Simpson#include <sys/socket.h>
5665b0fe478SBruce M Simpson#include <netinet/in.h>
5675b0fe478SBruce M Simpson#include <arpa/inet.h>], [char src[4], dst[128];
5685b0fe478SBruce M Simpsoninet_ntop(AF_INET, src, dst, sizeof(dst));],
5695b0fe478SBruce M Simpson	[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
5701de50e9fSSam Leffler	AC_LIBOBJ(inet_ntop)])
5715b0fe478SBruce M SimpsonAC_MSG_CHECKING(for inet_pton)
5725b0fe478SBruce M SimpsonAC_TRY_LINK([#include <sys/types.h>
5735b0fe478SBruce M Simpson#include <sys/socket.h>
5745b0fe478SBruce M Simpson#include <netinet/in.h>
5755b0fe478SBruce M Simpson#include <arpa/inet.h>], [char src[128], dst[4];
5765b0fe478SBruce M Simpsoninet_pton(AF_INET, src, dst);],
5775b0fe478SBruce M Simpson	[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
5781de50e9fSSam Leffler	AC_LIBOBJ(inet_pton)])
5795b0fe478SBruce M SimpsonAC_MSG_CHECKING(for inet_aton)
5805b0fe478SBruce M SimpsonAC_TRY_LINK([#include <sys/types.h>
5815b0fe478SBruce M Simpson#include <netinet/in.h>
5825b0fe478SBruce M Simpson#include <arpa/inet.h>], [char src[128];
5835b0fe478SBruce M Simpsonstruct in_addr dst;
5845b0fe478SBruce M Simpsoninet_aton(src, &dst);],
5855b0fe478SBruce M Simpson	[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
5861de50e9fSSam Leffler	AC_LIBOBJ(inet_aton)])
5871de50e9fSSam Leffler
5881de50e9fSSam Leffler#
5891de50e9fSSam Leffler# Check for these after AC_LBL_LIBPCAP, for the same reason.
5901de50e9fSSam Leffler#
5911de50e9fSSam Leffler# You are in a twisty little maze of UN*Xes, all different.
5921de50e9fSSam Leffler# Some might not have ether_ntohost().
5931de50e9fSSam Leffler# Some might have it, but not declare it in any header file.
5941de50e9fSSam Leffler# Some might have it, but declare it in <netinet/if_ether.h>.
5951de50e9fSSam Leffler# Some might have it, but declare it in <netinet/ether.h>
5961de50e9fSSam Leffler# (And some might have it but document it as something declared in
5971de50e9fSSam Leffler# <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
5981de50e9fSSam Leffler#
5991de50e9fSSam Leffler# Before you is a C compiler.
6001de50e9fSSam Leffler#
6011de50e9fSSam LefflerAC_CHECK_FUNCS(ether_ntohost, [
6021de50e9fSSam Leffler    AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
6031de50e9fSSam Leffler	AC_TRY_RUN([
6041de50e9fSSam Leffler		#include <netdb.h>
6051de50e9fSSam Leffler		#include <sys/types.h>
6061de50e9fSSam Leffler		#include <sys/param.h>
6071de50e9fSSam Leffler		#include <sys/socket.h>
6081de50e9fSSam Leffler
6091de50e9fSSam Leffler		int
6101de50e9fSSam Leffler		main(int argc, char **argv)
6111de50e9fSSam Leffler		{
6121de50e9fSSam Leffler			u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
6131de50e9fSSam Leffler			char name[MAXHOSTNAMELEN];
6141de50e9fSSam Leffler
6151de50e9fSSam Leffler			ether_ntohost(name, (struct ether_addr *)ea);
6161de50e9fSSam Leffler			exit(0);
6171de50e9fSSam Leffler		}
6181de50e9fSSam Leffler	], [ac_cv_buggy_ether_ntohost=no],
6191de50e9fSSam Leffler	   [ac_cv_buggy_ether_ntohost=yes],
6201de50e9fSSam Leffler	   [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
6211de50e9fSSam Leffler    if test "$ac_cv_buggy_ether_ntohost" = "no"; then
6221de50e9fSSam Leffler	AC_DEFINE(USE_ETHER_NTOHOST)
6231de50e9fSSam Leffler    fi
6241de50e9fSSam Leffler])
6251de50e9fSSam Lefflerif test "$ac_cv_func_ether_ntohost" = yes -a \
6261de50e9fSSam Leffler    "$ac_cv_buggy_ether_ntohost" = "no"; then
6271de50e9fSSam Leffler	#
6281de50e9fSSam Leffler	# OK, we have ether_ntohost().  Do we have <netinet/if_ether.h>?
6291de50e9fSSam Leffler	#
6301de50e9fSSam Leffler	if test "$ac_cv_header_netinet_if_ether_h" = yes; then
6311de50e9fSSam Leffler		#
6321de50e9fSSam Leffler		# Yes.  Does it declare ether_ntohost()?
6331de50e9fSSam Leffler		#
634f4d0c64aSSam Leffler		AC_CHECK_DECL(ether_ntohost,
6351de50e9fSSam Leffler		    [
6361de50e9fSSam Leffler			AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
6371de50e9fSSam Leffler			    [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
6381de50e9fSSam Leffler		    ],,
6391de50e9fSSam Leffler		    [
6401de50e9fSSam Leffler#include <sys/types.h>
6411de50e9fSSam Leffler#include <sys/socket.h>
6421de50e9fSSam Leffler#include <netinet/in.h>
643f4d0c64aSSam Leffler#include <arpa/inet.h>
6441de50e9fSSam Lefflerstruct mbuf;
6451de50e9fSSam Lefflerstruct rtentry;
6461de50e9fSSam Leffler#include <net/if.h>
6471de50e9fSSam Leffler#include <netinet/if_ether.h>
6481de50e9fSSam Leffler		    ])
6491de50e9fSSam Leffler	fi
6501de50e9fSSam Leffler	#
6511de50e9fSSam Leffler	# Did that succeed?
6521de50e9fSSam Leffler	#
6531de50e9fSSam Leffler	if test "$ac_cv_have_decl_ether_ntohost" != yes; then
6541de50e9fSSam Leffler		#
6551de50e9fSSam Leffler		# No, how about <netinet/ether.h>, as on Linux?
6561de50e9fSSam Leffler		#
6571de50e9fSSam Leffler		AC_CHECK_HEADERS(netinet/ether.h)
6581de50e9fSSam Leffler		if test "$ac_cv_header_netinet_ether_h" = yes; then
6591de50e9fSSam Leffler			#
6601de50e9fSSam Leffler			# We have it - does it declare ether_ntohost()?
6611de50e9fSSam Leffler			# Unset ac_cv_have_decl_ether_ntohost so we don't
6621de50e9fSSam Leffler			# treat the previous failure as a cached value and
6631de50e9fSSam Leffler			# suppress the next test.
6641de50e9fSSam Leffler			#
6651de50e9fSSam Leffler			unset ac_cv_have_decl_ether_ntohost
666f4d0c64aSSam Leffler			AC_CHECK_DECL(ether_ntohost,
6671de50e9fSSam Leffler			    [
6681de50e9fSSam Leffler				AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
6691de50e9fSSam Leffler				    [Define to 1 if netinet/ether.h declares `ether_ntohost'])
6701de50e9fSSam Leffler			    ],,
6711de50e9fSSam Leffler			    [
6721de50e9fSSam Leffler#include <netinet/ether.h>
6731de50e9fSSam Leffler			    ])
6741de50e9fSSam Leffler		fi
6751de50e9fSSam Leffler	fi
676f4d0c64aSSam Leffler	#
677f4d0c64aSSam Leffler	# Is ether_ntohost() declared?
678f4d0c64aSSam Leffler	#
679f4d0c64aSSam Leffler	if test "$ac_cv_have_decl_ether_ntohost" != yes; then
680f4d0c64aSSam Leffler		#
681f4d0c64aSSam Leffler		# No, we'll have to declare it ourselves.
682f4d0c64aSSam Leffler		# Do we have "struct ether_addr"?
683f4d0c64aSSam Leffler		#
684f4d0c64aSSam Leffler		AC_CHECK_TYPES(struct ether_addr,,,
685f4d0c64aSSam Leffler		    [
686f4d0c64aSSam Leffler#include <sys/types.h>
687f4d0c64aSSam Leffler#include <sys/socket.h>
688f4d0c64aSSam Leffler#include <netinet/in.h>
689f4d0c64aSSam Leffler#include <arpa/inet.h>
690f4d0c64aSSam Lefflerstruct mbuf;
691f4d0c64aSSam Lefflerstruct rtentry;
692f4d0c64aSSam Leffler#include <net/if.h>
693f4d0c64aSSam Leffler#include <netinet/if_ether.h>
694f4d0c64aSSam Leffler		    ])
695f4d0c64aSSam Leffler		AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
696f4d0c64aSSam Leffler		    [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
697f4d0c64aSSam Lefflerdon't.])
698f4d0c64aSSam Leffler	else
699f4d0c64aSSam Leffler		AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
700f4d0c64aSSam Leffler		    [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
701f4d0c64aSSam Lefflerdon't.])
702f4d0c64aSSam Leffler	fi
7031de50e9fSSam Lefflerfi
7045b0fe478SBruce M Simpson
705a5779b6eSRui Paulo# libdlpi is needed for Solaris 11 and later.
706a5779b6eSRui PauloAC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
707a5779b6eSRui Paulo
7085b0fe478SBruce M Simpsondnl portability macros for getaddrinfo/getnameinfo
7095b0fe478SBruce M Simpsondnl
7105b0fe478SBruce M Simpsondnl Check for sa_len
7115b0fe478SBruce M SimpsonAC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
7125b0fe478SBruce M Simpsonif test "$ac_cv_sockaddr_has_sa_len" = no; then
7135b0fe478SBruce M Simpson	missing_includes=yes
7145b0fe478SBruce M Simpsonfi
7155b0fe478SBruce M Simpson
716a5779b6eSRui Paulo#
717a5779b6eSRui Paulo# Do we have the new open API?  Check for pcap_create, and assume that,
718*cac3dcd5SXin LI# if we do, we also have pcap_activate() and the other new routines
719*cac3dcd5SXin LI# introduced in libpcap 1.0.0.
720*cac3dcd5SXin LI#
721a5779b6eSRui PauloAC_CHECK_FUNCS(pcap_create)
722*cac3dcd5SXin LIif test $ac_cv_func_pcap_create = "yes" ; then
723*cac3dcd5SXin LI	#
724*cac3dcd5SXin LI	# OK, do we have pcap_set_tstamp_type?  If so, assume we have
725*cac3dcd5SXin LI	# pcap_list_tstamp_types and pcap_free_tstamp_types as well.
726*cac3dcd5SXin LI	#
727*cac3dcd5SXin LI	AC_CHECK_FUNCS(pcap_set_tstamp_type)
728*cac3dcd5SXin LIfi
729a5779b6eSRui Paulo
7305b0fe478SBruce M SimpsonAC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
7315b0fe478SBruce M Simpsonif test $ac_cv_func_pcap_findalldevs = "yes" ; then
7325b0fe478SBruce M Simpsondnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
7335b0fe478SBruce M Simpsondnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
7345b0fe478SBruce M Simpsondnl have pcap_if_t.
735a5779b6eSRui Paulo    savedppflags="$CPPLAGS"
736a5779b6eSRui Paulo    CPPFLAGS="$CPPFLAGS $V_INCLS"
7375b0fe478SBruce M Simpson    AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
738a5779b6eSRui Paulo    CPPFLAGS="$savedcppflags"
7395b0fe478SBruce M Simpsonfi
7401de50e9fSSam Leffler
7415b0fe478SBruce M Simpsonif test $ac_cv_func_pcap_lib_version = "no" ; then
7425b0fe478SBruce M Simpson    AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
7435b0fe478SBruce M Simpson    AC_TRY_LINK([],
7445b0fe478SBruce M Simpson       [
7455b0fe478SBruce M Simpson	extern char pcap_version[];
7465b0fe478SBruce M Simpson
7471de50e9fSSam Leffler	return (int)pcap_version;
7485b0fe478SBruce M Simpson       ],
7495b0fe478SBruce M Simpson       ac_lbl_cv_pcap_version_defined=yes,
7505b0fe478SBruce M Simpson       ac_lbl_cv_pcap_version_defined=no)
7515b0fe478SBruce M Simpson    if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
7525b0fe478SBruce M Simpson    	AC_MSG_RESULT(yes)
7535b0fe478SBruce M Simpson	AC_DEFINE(HAVE_PCAP_VERSION)
7545b0fe478SBruce M Simpson    else
7555b0fe478SBruce M Simpson	AC_MSG_RESULT(no)
7565b0fe478SBruce M Simpson    fi
7575b0fe478SBruce M Simpsonfi
7585b0fe478SBruce M SimpsonAC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
7595b0fe478SBruce M SimpsonAC_TRY_LINK([],
7605b0fe478SBruce M Simpson   [
7615b0fe478SBruce M Simpson	extern int pcap_debug;
7625b0fe478SBruce M Simpson
7635b0fe478SBruce M Simpson	return pcap_debug;
7645b0fe478SBruce M Simpson   ],
7655b0fe478SBruce M Simpson   ac_lbl_cv_pcap_debug_defined=yes,
7665b0fe478SBruce M Simpson   ac_lbl_cv_pcap_debug_defined=no)
7675b0fe478SBruce M Simpsonif test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
7685b0fe478SBruce M Simpson	AC_MSG_RESULT(yes)
7695b0fe478SBruce M Simpson	AC_DEFINE(HAVE_PCAP_DEBUG)
7705b0fe478SBruce M Simpsonelse
7715b0fe478SBruce M Simpson	AC_MSG_RESULT(no)
7725b0fe478SBruce M Simpson	#
7735b0fe478SBruce M Simpson	# OK, what about "yydebug"?
7745b0fe478SBruce M Simpson	#
7755b0fe478SBruce M Simpson	AC_MSG_CHECKING(whether yydebug is defined by libpcap)
7765b0fe478SBruce M Simpson	AC_TRY_LINK([],
7775b0fe478SBruce M Simpson	   [
7785b0fe478SBruce M Simpson		extern int yydebug;
7795b0fe478SBruce M Simpson
7805b0fe478SBruce M Simpson		return yydebug;
7815b0fe478SBruce M Simpson	   ],
7825b0fe478SBruce M Simpson	   ac_lbl_cv_yydebug_defined=yes,
7835b0fe478SBruce M Simpson	   ac_lbl_cv_yydebug_defined=no)
7845b0fe478SBruce M Simpson	if test "$ac_lbl_cv_yydebug_defined" = yes ; then
7855b0fe478SBruce M Simpson		AC_MSG_RESULT(yes)
7865b0fe478SBruce M Simpson		AC_DEFINE(HAVE_YYDEBUG)
7875b0fe478SBruce M Simpson	else
7885b0fe478SBruce M Simpson		AC_MSG_RESULT(no)
7895b0fe478SBruce M Simpson	fi
7905b0fe478SBruce M Simpsonfi
791685295f4SBill FennerAC_REPLACE_FUNCS(bpf_dump)	dnl moved to libpcap in 0.6
792685295f4SBill Fenner
7934edb46e9SPaul TrainaV_GROUP=0
7944644f044SBill Fennerif test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
7954644f044SBill Fenner	V_GROUP=wheel
7964644f044SBill Fennerfi
79727df3f5dSRui Paulo#
79827df3f5dSRui Paulo# Assume V7/BSD convention for man pages (file formats in section 5,
79927df3f5dSRui Paulo# miscellaneous info in section 7).
80027df3f5dSRui Paulo#
80127df3f5dSRui PauloMAN_FILE_FORMATS=5
80227df3f5dSRui PauloMAN_MISC_INFO=7
803a90e161bSBill Fennercase "$host_os" in
8044edb46e9SPaul Traina
8054edb46e9SPaul Trainaaix*)
8064edb46e9SPaul Traina	dnl Workaround to enable certain features
807*cac3dcd5SXin LI	AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
8084edb46e9SPaul Traina	;;
8094edb46e9SPaul Traina
81027df3f5dSRui Paulohpux*)
81127df3f5dSRui Paulo	#
81227df3f5dSRui Paulo	# Use System V conventions for man pages.
81327df3f5dSRui Paulo	#
81427df3f5dSRui Paulo	MAN_FILE_FORMATS=4
81527df3f5dSRui Paulo	MAN_MISC_INFO=5
81627df3f5dSRui Paulo	;;
81727df3f5dSRui Paulo
8184edb46e9SPaul Trainairix*)
8194edb46e9SPaul Traina	V_GROUP=sys
82027df3f5dSRui Paulo
82127df3f5dSRui Paulo	#
82227df3f5dSRui Paulo	# Use System V conventions for man pages.
82327df3f5dSRui Paulo	#
82427df3f5dSRui Paulo	MAN_FILE_FORMATS=4
82527df3f5dSRui Paulo	MAN_MISC_INFO=5
8264edb46e9SPaul Traina	;;
8274edb46e9SPaul Traina
8284edb46e9SPaul Trainaosf*)
8294edb46e9SPaul Traina	V_GROUP=system
83027df3f5dSRui Paulo
83127df3f5dSRui Paulo	#
83227df3f5dSRui Paulo	# Use System V conventions for man pages.
83327df3f5dSRui Paulo	#
83427df3f5dSRui Paulo	MAN_FILE_FORMATS=4
83527df3f5dSRui Paulo	MAN_MISC_INFO=5
8364edb46e9SPaul Traina	;;
8374edb46e9SPaul Traina
8384edb46e9SPaul Trainasolaris*)
8394edb46e9SPaul Traina	V_GROUP=sys
84027df3f5dSRui Paulo
84127df3f5dSRui Paulo	#
84227df3f5dSRui Paulo	# Use System V conventions for man pages.
84327df3f5dSRui Paulo	#
84427df3f5dSRui Paulo	MAN_FILE_FORMATS=4
84527df3f5dSRui Paulo	MAN_MISC_INFO=5
8464edb46e9SPaul Traina	;;
8474edb46e9SPaul Trainaesac
8484edb46e9SPaul Traina
8494edb46e9SPaul Trainaif test -f /dev/bpf0 ; then
8504edb46e9SPaul Traina	V_GROUP=bpf
8514edb46e9SPaul Trainafi
8524edb46e9SPaul Traina
853f4d0c64aSSam LefflerAC_CHECK_HEADERS(sys/bitypes.h)
854f4d0c64aSSam Leffler
855f4d0c64aSSam LefflerAC_CHECK_TYPE([int8_t], ,
856f4d0c64aSSam Leffler	[AC_DEFINE([int8_t], [signed char],
85727df3f5dSRui Paulo	[Define to `signed char' if int8_t not defined.])],
85827df3f5dSRui Paulo	[AC_INCLUDES_DEFAULT
85927df3f5dSRui Paulo#ifdef HAVE_SYS_BITYPES_H
86027df3f5dSRui Paulo#include <sys/bitypes.h>
86127df3f5dSRui Paulo#endif])
862f4d0c64aSSam LefflerAC_CHECK_TYPE([u_int8_t], ,
863f4d0c64aSSam Leffler	[AC_DEFINE([u_int8_t], [unsigned char],
864f4d0c64aSSam Leffler	[Define to `unsigned char' if u_int8_t not defined.])],
865f4d0c64aSSam Leffler	[AC_INCLUDES_DEFAULT
866f4d0c64aSSam Leffler#ifdef HAVE_SYS_BITYPES_H
867f4d0c64aSSam Leffler#include <sys/bitypes.h>
868f4d0c64aSSam Leffler#endif])
869f4d0c64aSSam LefflerAC_CHECK_TYPE([int16_t], ,
870f4d0c64aSSam Leffler	[AC_DEFINE([int16_t], [short],
87127df3f5dSRui Paulo	[Define to `short' if int16_t not defined.])]
87227df3f5dSRui Paulo	[AC_INCLUDES_DEFAULT
87327df3f5dSRui Paulo#ifdef HAVE_SYS_BITYPES_H
87427df3f5dSRui Paulo#include <sys/bitypes.h>
87527df3f5dSRui Paulo#endif])
876f4d0c64aSSam LefflerAC_CHECK_TYPE([u_int16_t], ,
877f4d0c64aSSam Leffler	[AC_DEFINE([u_int16_t], [unsigned short],
878f4d0c64aSSam Leffler	[Define to `unsigned short' if u_int16_t not defined.])],
879f4d0c64aSSam Leffler	[AC_INCLUDES_DEFAULT
880f4d0c64aSSam Leffler#ifdef HAVE_SYS_BITYPES_H
881f4d0c64aSSam Leffler#include <sys/bitypes.h>
882f4d0c64aSSam Leffler#endif])
883f4d0c64aSSam LefflerAC_CHECK_TYPE([int32_t], ,
884f4d0c64aSSam Leffler	[AC_DEFINE([int32_t], [int],
88527df3f5dSRui Paulo	[Define to `int' if int32_t not defined.])],
88627df3f5dSRui Paulo	[AC_INCLUDES_DEFAULT
88727df3f5dSRui Paulo#ifdef HAVE_SYS_BITYPES_H
88827df3f5dSRui Paulo#include <sys/bitypes.h>
88927df3f5dSRui Paulo#endif])
890f4d0c64aSSam LefflerAC_CHECK_TYPE([u_int32_t], ,
891f4d0c64aSSam Leffler	[AC_DEFINE([u_int32_t], [unsigned int],
892f4d0c64aSSam Leffler	[Define to `unsigned int' if u_int32_t not defined.])],
893f4d0c64aSSam Leffler	[AC_INCLUDES_DEFAULT
894f4d0c64aSSam Leffler#ifdef HAVE_SYS_BITYPES_H
895f4d0c64aSSam Leffler#include <sys/bitypes.h>
896f4d0c64aSSam Leffler#endif])
897f4d0c64aSSam LefflerAC_CHECK_TYPE([int64_t], ,
898f4d0c64aSSam Leffler	[AC_DEFINE([int64_t], [long long],
89927df3f5dSRui Paulo	[Define to `long long' if int64_t not defined.])],
90027df3f5dSRui Paulo	[AC_INCLUDES_DEFAULT
90127df3f5dSRui Paulo#ifdef HAVE_SYS_BITYPES_H
90227df3f5dSRui Paulo#include <sys/bitypes.h>
90327df3f5dSRui Paulo#endif])
904f4d0c64aSSam LefflerAC_CHECK_TYPE([u_int64_t], ,
905f4d0c64aSSam Leffler	[AC_DEFINE([u_int64_t], [unsigned long long],
906f4d0c64aSSam Leffler	[Define to `unsigned long long' if u_int64_t not defined.])],
907f4d0c64aSSam Leffler	[AC_INCLUDES_DEFAULT
908f4d0c64aSSam Leffler#ifdef HAVE_SYS_BITYPES_H
909f4d0c64aSSam Leffler#include <sys/bitypes.h>
910f4d0c64aSSam Leffler#endif])
9111de50e9fSSam Leffler
9121de50e9fSSam Leffler#
9131de50e9fSSam Leffler# We can't just check for <inttypes.h> - some systems have one that
9141de50e9fSSam Leffler# doesn't define all the PRI[doxu]64 macros.
9151de50e9fSSam Leffler#
9161de50e9fSSam LefflerAC_CHECK_HEADERS(inttypes.h,
9171de50e9fSSam Leffler  [
9181de50e9fSSam Leffler    #
9191de50e9fSSam Leffler    # OK, we have inttypes.h, but does it define those macros?
9201de50e9fSSam Leffler    #
9211de50e9fSSam Leffler    AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
9221de50e9fSSam Leffler    AC_COMPILE_IFELSE(
9231de50e9fSSam Leffler      [
9241de50e9fSSam Leffler	AC_LANG_SOURCE(
9251de50e9fSSam Leffler	  [[
9261de50e9fSSam Leffler	    #include <inttypes.h>
9271de50e9fSSam Leffler	    #include <stdio.h>
9281de50e9fSSam Leffler	    #include <sys/types.h>
929f4d0c64aSSam Leffler	    #ifdef HAVE_SYS_BITYPES_H
930f4d0c64aSSam Leffler	    #include <sys/bitypes.h>
931f4d0c64aSSam Leffler	    #endif
9321de50e9fSSam Leffler
9331de50e9fSSam Leffler	    main()
9341de50e9fSSam Leffler	    {
9351de50e9fSSam Leffler	      printf("%" PRId64 "\n", (u_int64_t)1);
9361de50e9fSSam Leffler	      printf("%" PRIo64 "\n", (u_int64_t)1);
9371de50e9fSSam Leffler	      printf("%" PRIx64 "\n", (u_int64_t)1);
9381de50e9fSSam Leffler	      printf("%" PRIu64 "\n", (u_int64_t)1);
9391de50e9fSSam Leffler	    }
9401de50e9fSSam Leffler	  ]])
9411de50e9fSSam Leffler      ],
9421de50e9fSSam Leffler      [
9431de50e9fSSam Leffler	AC_MSG_RESULT(yes)
9441de50e9fSSam Leffler	ac_lbl_inttypes_h_defines_formats=yes
9451de50e9fSSam Leffler      ],
9461de50e9fSSam Leffler      [
9471de50e9fSSam Leffler	AC_MSG_RESULT(no)
9481de50e9fSSam Leffler	ac_lbl_inttypes_h_defines_formats=no
9491de50e9fSSam Leffler      ])
9501de50e9fSSam Leffler  ],
9511de50e9fSSam Leffler  [
9521de50e9fSSam Leffler    #
9531de50e9fSSam Leffler    # We don't have inttypes.h, so it obviously can't define those
9541de50e9fSSam Leffler    # macros.
9551de50e9fSSam Leffler    #
9561de50e9fSSam Leffler    ac_lbl_inttypes_h_defines_formats=no
9571de50e9fSSam Leffler  ])
958f4d0c64aSSam Lefflerif test "$ac_lbl_inttypes_h_defines_formats" = no; then
959f4d0c64aSSam Leffler  AC_LBL_CHECK_64BIT_FORMAT(l,
960f4d0c64aSSam Leffler    [
9611de50e9fSSam Leffler      AC_LBL_CHECK_64BIT_FORMAT(ll,
9621de50e9fSSam Leffler        [
9631de50e9fSSam Leffler          AC_LBL_CHECK_64BIT_FORMAT(L,
9641de50e9fSSam Leffler	    [
9651de50e9fSSam Leffler	      AC_LBL_CHECK_64BIT_FORMAT(q,
9661de50e9fSSam Leffler	        [
9671de50e9fSSam Leffler	          AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
9681de50e9fSSam Leffler	        ])
9691de50e9fSSam Leffler	    ])
9701de50e9fSSam Leffler	])
971f4d0c64aSSam Leffler    ])
9721de50e9fSSam Lefflerfi
9734edb46e9SPaul Traina
974*cac3dcd5SXin LI#
975*cac3dcd5SXin LI# Check for some headers introduced in later versions of libpcap
976*cac3dcd5SXin LI# and used by some printers.
977*cac3dcd5SXin LI#
978*cac3dcd5SXin LI# Those headers use the {u_}intN_t types, so we must do this after
979*cac3dcd5SXin LI# we check for what's needed to get them defined.
980*cac3dcd5SXin LI#
981*cac3dcd5SXin LIsavedcppflags="$CPPFLAGS"
982*cac3dcd5SXin LICPPFLAGS="$CPPFLAGS $V_INCLS"
983*cac3dcd5SXin LIAC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
984*cac3dcd5SXin LIAC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
985*cac3dcd5SXin LICPPFLAGS="$savedcppflags"
986*cac3dcd5SXin LI
987a5779b6eSRui PauloAC_PROG_RANLIB
988a5779b6eSRui Paulo
9894edb46e9SPaul TrainaAC_LBL_DEVEL(V_CCOPT)
9904edb46e9SPaul Traina
9914edb46e9SPaul TrainaAC_LBL_SOCKADDR_SA_LEN
9924edb46e9SPaul Traina
9934edb46e9SPaul TrainaAC_LBL_UNALIGNED_ACCESS
9944edb46e9SPaul Traina
995b0453382SBill FennerAC_VAR_H_ERRNO
996b0453382SBill Fenner
997a5779b6eSRui Paulo# Check for SSLeay
998a5779b6eSRui PauloAC_MSG_CHECKING(whether to use SSLeay libcrypto)
999a5779b6eSRui Paulo# Specify location for both includes and libraries.
1000a5779b6eSRui Paulowant_libcrypto=youmama
1001a5779b6eSRui PauloAC_ARG_WITH(crypto,
1002a5779b6eSRui Paulo    AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
1003a5779b6eSRui Paulo		   [use SSLeay libcrypto (located in directory PATH, if supplied).  @<:@default=yes, if available@:>@]),
1004a5779b6eSRui Paulo[
1005a5779b6eSRui Paulo	if test $withval = no
1006a5779b6eSRui Paulo	then
1007a5779b6eSRui Paulo		want_libcrypto=no
1008a5779b6eSRui Paulo		AC_MSG_RESULT(no)
1009a5779b6eSRui Paulo	elif test $withval = yes
1010a5779b6eSRui Paulo	then
1011a5779b6eSRui Paulo		want_libcrypto=yes
1012a5779b6eSRui Paulo		AC_MSG_RESULT(yes)
1013a5779b6eSRui Paulo	else
1014a5779b6eSRui Paulo		want_libcrypto=yes
1015a5779b6eSRui Paulo		AC_MSG_RESULT(yes)
1016a5779b6eSRui Paulo		crypto_dir=$withval
1017a5779b6eSRui Paulo	fi
1018a5779b6eSRui Paulo],[
1019a5779b6eSRui Paulo	#
1020a5779b6eSRui Paulo	# Use libcrypto if it's present, otherwise don't.
1021a5779b6eSRui Paulo	#
1022a5779b6eSRui Paulo	want_libcrypto=ifavailable
1023a5779b6eSRui Paulo	AC_MSG_RESULT([yes, if available])
1024a5779b6eSRui Paulo])
1025a5779b6eSRui Pauloif test "$want_libcrypto" != "no"; then
1026b0453382SBill Fenner	ac_cv_ssleay_path=no
1027b0453382SBill Fenner	incdir=no
1028a5779b6eSRui Paulo	if test "x$crypto_dir" = x; then
1029a5779b6eSRui Paulo		#
1030a5779b6eSRui Paulo		# Location not specified; check the default locations.
1031a5779b6eSRui Paulo		#
1032a5779b6eSRui Paulo		AC_MSG_CHECKING(where SSLeay is located)
1033a5779b6eSRui Paulo		dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1034a5779b6eSRui Paulo		if test "x${host_alias}" != x; then
1035a5779b6eSRui Paulo			dirs="/usr/${host_alias} $dirs"
1036a5779b6eSRui Paulo		fi
1037a5779b6eSRui Paulo		for dir in $dirs; do
1038a5779b6eSRui Paulo			AC_LBL_SSLEAY($dir)
10391de50e9fSSam Leffler
1040b0453382SBill Fenner			if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1041b0453382SBill Fenner				break;
1042b0453382SBill Fenner			else
1043b0453382SBill Fenner				ac_cv_ssleay_path=no
1044b0453382SBill Fenner				incdir=no
1045b0453382SBill Fenner			fi
1046b0453382SBill Fenner		done
1047a5779b6eSRui Paulo		if test "$ac_cv_ssleay_path" != no; then
1048b0453382SBill Fenner			AC_MSG_RESULT($ac_cv_ssleay_path)
1049a5779b6eSRui Paulo		fi
1050a5779b6eSRui Paulo	else
1051a5779b6eSRui Paulo		AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1052a5779b6eSRui Paulo		AC_LBL_SSLEAY($crypto_dir)
1053a5779b6eSRui Paulo		if test "$ac_cv_ssleay_path" != no; then
1054a5779b6eSRui Paulo			AC_MSG_RESULT(found)
1055a5779b6eSRui Paulo		fi
1056a5779b6eSRui Paulo	fi
1057b0453382SBill Fenner	if test "$ac_cv_ssleay_path" != no; then
1058b0453382SBill Fenner		V_INCLS="$V_INCLS $incdir"
105927df3f5dSRui Paulo		if test "$dir" != "/usr"; then
1060685295f4SBill Fenner			LDFLAGS="-L$dir/lib $LDFLAGS"
106127df3f5dSRui Paulo		fi
1062b0453382SBill Fenner		if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1063b0453382SBill Fenner			LIBS="$LIBS -lRSAglue"
1064b0453382SBill Fenner		fi
1065b0453382SBill Fenner		if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1066b0453382SBill Fenner			LIBS="$LIBS -lrsaref"
1067b0453382SBill Fenner		fi
10681de50e9fSSam Leffler		AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1069b0453382SBill Fenner
1070*cac3dcd5SXin LI		savedppflags="$CPPLAGS"
1071b0453382SBill Fenner		CPPFLAGS="$CPPFLAGS $V_INCLS"
10725b0fe478SBruce M Simpson		AC_CHECK_HEADERS(openssl/evp.h)
1073*cac3dcd5SXin LI		CPPFLAGS="$savedcppflags"
1074a5779b6eSRui Paulo	else
1075a5779b6eSRui Paulo		#
1076a5779b6eSRui Paulo		# Not found.  Did the user explicitly ask for it?
1077a5779b6eSRui Paulo		#
1078a5779b6eSRui Paulo		AC_MSG_RESULT(not found)
1079a5779b6eSRui Paulo		if test "$want_libcrypto" = yes; then
1080a5779b6eSRui Paulo			AC_MSG_ERROR(SSLeay not found)
1081b0453382SBill Fenner		fi
1082a5779b6eSRui Paulo	fi
1083a5779b6eSRui Paulofi
10844edb46e9SPaul Traina
10851de50e9fSSam Lefflerdnl
10861de50e9fSSam Lefflerdnl set additional include path if necessary
10871de50e9fSSam Lefflerif test "$missing_includes" = "yes"; then
1088*cac3dcd5SXin LI	CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1089*cac3dcd5SXin LI	V_INCLS="$V_INCLS -I$srcdir/missing"
10901de50e9fSSam Lefflerfi
10911de50e9fSSam Leffler
10924edb46e9SPaul TrainaAC_SUBST(V_CCOPT)
10935b0fe478SBruce M SimpsonAC_SUBST(V_DEFS)
10944edb46e9SPaul TrainaAC_SUBST(V_GROUP)
10954edb46e9SPaul TrainaAC_SUBST(V_INCLS)
10964edb46e9SPaul TrainaAC_SUBST(V_PCAPDEP)
1097b0453382SBill FennerAC_SUBST(LOCALSRC)
109827df3f5dSRui PauloAC_SUBST(MAN_FILE_FORMATS)
109927df3f5dSRui PauloAC_SUBST(MAN_MISC_INFO)
11004edb46e9SPaul Traina
11014edb46e9SPaul TrainaAC_PROG_INSTALL
11024edb46e9SPaul Traina
1103b0453382SBill FennerAC_CONFIG_HEADER(config.h)
1104b0453382SBill Fenner
1105685295f4SBill FennerAC_OUTPUT_COMMANDS([if test -f .devel; then
1106685295f4SBill Fenner	echo timestamp > stamp-h
1107685295f4SBill Fenner	cat Makefile-devel-adds >> Makefile
11084edb46e9SPaul Traina	make depend
1109685295f4SBill Fennerfi])
111027df3f5dSRui PauloAC_OUTPUT(Makefile tcpdump.1)
11114edb46e9SPaul Trainaexit 0
1112