]> The Tcpdump Group git mirrors - tcpdump/blob - configure.in
Initial revision
[tcpdump] / configure.in
1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.71 1999-10-07 23:47:10 mcr Exp $ (LBL)
2 dnl
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
5 dnl
6 dnl Process this file with autoconf to produce a configure script.
7 dnl
8
9 AC_INIT(tcpdump.c)
10
11 AC_CANONICAL_SYSTEM
12
13 umask 002
14
15 if test -z "$PWD" ; then
16 PWD=`pwd`
17 fi
18
19 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
20
21 AC_CHECK_HEADERS(fcntl.h malloc.h memory.h rpc/rpcent.h)
22 AC_HEADER_TIME
23
24 case "$target_os" in
25
26 linux*)
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)
34 fi
35 AC_DEFINE(HAVE_NET_SLIP_H)
36 ;;
37
38 *)
39 AC_CHECK_HEADERS(net/slip.h)
40 ;;
41 esac
42
43 AC_REPLACE_FUNCS(vfprintf strcasecmp)
44 AC_CHECK_FUNCS(ether_ntoa setlinebuf)
45
46 dnl The following generates a warning from autoconf...
47 AC_C_BIGENDIAN
48
49 AC_CHECK_LIB(dnet, main)
50 AC_CHECK_LIB(rpc, main)
51
52 AC_LBL_TYPE_SIGNAL
53
54 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
55
56 V_GROUP=0
57 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
58 V_GROUP=wheel
59 fi
60 case "$target_os" in
61
62 aix*)
63 dnl Workaround to enable certain features
64 AC_DEFINE(_SUN)
65 ;;
66
67 irix*)
68 V_GROUP=sys
69 ;;
70
71 linux*)
72 V_INCLS="$V_INCLS -Ilinux-include"
73 ;;
74
75 osf*)
76 V_GROUP=system
77 dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
78 AC_DEFINE(__STDC__,2)
79 ;;
80
81 solaris*)
82 V_GROUP=sys
83 ;;
84 esac
85
86 if test -f /dev/bpf0 ; then
87 V_GROUP=bpf
88 fi
89
90 AC_LBL_CHECK_TYPE(int32_t, int)
91 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
92
93 AC_LBL_DEVEL(V_CCOPT)
94
95 AC_LBL_SOCKADDR_SA_LEN
96
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"
101 AC_TRY_COMPILE([
102 # include <sys/types.h>
103 # if __STDC__
104 /* osf3 has REALLY good prototyes */
105 struct mbuf;
106 struct rtentry;
107 # endif
108 # include <sys/socket.h>
109 # include <net/if.h>
110 # include <netinet/in.h>
111 # include <netinet/if_ether.h>],
112 [u_int i =
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)
120 fi
121
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"
126 AC_TRY_COMPILE([
127 # include <sys/types.h>
128 # if __STDC__
129 /* osf3 has REALLY good prototyes */
130 struct mbuf;
131 struct rtentry;
132 # endif
133 # include <sys/socket.h>
134 # include <net/if.h>
135 # include <netinet/in.h>
136 # include <netinet/if_ether.h>],
137 [u_int i =
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)
145 fi
146
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"
151 AC_TRY_COMPILE([
152 # include <sys/types.h>
153 # include <sys/socket.h>
154 # if __STDC__
155 /* osf3 has REALLY good prototyes */
156 struct mbuf;
157 struct rtentry;
158 # endif
159 # include <net/if.h>
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)
169 fi
170
171 AC_LBL_UNALIGNED_ACCESS
172
173 if test "${srcdir}" = "." ; then
174 srcdirprefix=""
175 else
176 srcdirprefix="./"
177 fi
178
179 if test -r ${srcdirprefix}lbl/gnuc.h ; then
180 rm -f gnuc.h
181 ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
182 fi
183
184 AC_SUBST(V_CCOPT)
185 AC_SUBST(V_GROUP)
186 AC_SUBST(V_INCLS)
187 AC_SUBST(V_PCAPDEP)
188
189 AC_PROG_INSTALL
190
191 AC_OUTPUT(Makefile)
192
193 if test -f .devel ; then
194 make depend
195 fi
196 exit 0