1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.71 1999-10-07 23:47:10 mcr Exp $ (LBL)
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
6 dnl Process this file with autoconf to produce a configure script.
15 if test -z "$PWD" ; then
19 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
21 AC_CHECK_HEADERS(fcntl.h malloc.h memory.h rpc/rpcent.h)
27 AC_MSG_CHECKING(Linux kernel version)
28 AC_CACHE_VAL(ac_cv_linux_vers,
29 ac_cv_linux_vers=`uname -r 2>&1 | \
30 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
31 AC_MSG_RESULT($ac_cv_linux_vers)
32 if test $ac_cv_linux_vers -lt 2 ; then
33 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
35 AC_DEFINE(HAVE_NET_SLIP_H)
39 AC_CHECK_HEADERS(net/slip.h)
43 AC_REPLACE_FUNCS(vfprintf strcasecmp)
44 AC_CHECK_FUNCS(ether_ntoa setlinebuf)
46 dnl The following generates a warning from autoconf...
49 AC_CHECK_LIB(dnet, main)
50 AC_CHECK_LIB(rpc, main)
54 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
57 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
63 dnl Workaround to enable certain features
72 V_INCLS="$V_INCLS -Ilinux-include"
77 dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
86 if test -f /dev/bpf0 ; then
90 AC_LBL_CHECK_TYPE(int32_t, int)
91 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
95 AC_LBL_SOCKADDR_SA_LEN
97 AC_MSG_CHECKING(if ether_header uses ether_addr structs)
98 AC_CACHE_VAL(ac_cv_ether_header_has_ea,
99 LBL_SAVE_CFLAGS="$CFLAGS"
100 CFLAGS="$CFLAGS $V_INCLS"
102 # include <sys/types.h>
104 /* osf3 has REALLY good prototyes */
108 # include <sys/socket.h>
110 # include <netinet/in.h>
111 # include <netinet/if_ether.h>],
113 sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
114 ac_cv_ether_header_has_ea=yes,
115 ac_cv_ether_header_has_ea=no)
116 CFLAGS="$LBL_SAVE_CFLAGS")
117 AC_MSG_RESULT($ac_cv_ether_header_has_ea)
118 if test $ac_cv_ether_header_has_ea = yes ; then
119 AC_DEFINE(ETHER_HEADER_HAS_EA)
122 AC_MSG_CHECKING(if ether_arp uses ether_addr structs)
123 AC_CACHE_VAL(ac_cv_ether_arp_has_ea,
124 LBL_SAVE_CFLAGS="$CFLAGS"
125 CFLAGS="$CFLAGS $V_INCLS"
127 # include <sys/types.h>
129 /* osf3 has REALLY good prototyes */
133 # include <sys/socket.h>
135 # include <netinet/in.h>
136 # include <netinet/if_ether.h>],
138 sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)],
139 ac_cv_ether_arp_has_ea=yes,
140 ac_cv_ether_arp_has_ea=no)
141 CFLAGS="$LBL_SAVE_CFLAGS")
142 AC_MSG_RESULT($ac_cv_ether_arp_has_ea)
143 if test $ac_cv_ether_arp_has_ea = yes ; then
144 AC_DEFINE(ETHER_ARP_HAS_EA)
147 AC_MSG_CHECKING(if ether_arp uses erp_xsha member)
148 AC_CACHE_VAL(ac_cv_struct_ether_arp_x,
149 LBL_SAVE_CFLAGS="$CFLAGS"
150 CFLAGS="$CFLAGS $V_INCLS"
152 # include <sys/types.h>
153 # include <sys/socket.h>
155 /* osf3 has REALLY good prototyes */
160 # include <netinet/in.h>
161 # include <netinet/if_ether.h>],
162 [u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)],
163 ac_cv_struct_ether_arp_x=yes,
164 ac_cv_struct_ether_arp_x=no)
165 CFLAGS="$LBL_SAVE_CFLAGS")
166 AC_MSG_RESULT($ac_cv_struct_ether_arp_x)
167 if test $ac_cv_struct_ether_arp_x = yes ; then
168 AC_DEFINE(ETHER_ARP_HAS_X)
171 AC_LBL_UNALIGNED_ACCESS
173 if test "${srcdir}" = "." ; then
179 if test -r ${srcdirprefix}lbl/gnuc.h ; then
181 ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
193 if test -f .devel ; then