IRQ handler rewrite by Gabor Juhos, uses C no longer assembly
[openwrt/staging/chunkeey.git] / target / linux / etrax-2.6 / image / e100boot / src / libpcap-0.4 / configure.in
1 dnl @(#) $Header: /usr/local/cvs/linux/tools/build/e100boot/libpcap-0.4/configure.in,v 1.1 1999/08/26 10:05:21 johana 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(pcap.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(malloc.h sys/ioccom.h sys/sockio.h)
22
23 AC_LBL_FIXINCLUDES
24
25 AC_CHECK_FUNCS(ether_hostton strerror)
26
27 dnl
28 dnl Not all versions of test support -c (character special) but it's a
29 dnl better way of testing since the device might be protected. So we
30 dnl check in our normal order using -r and then check the for the /dev
31 dnl guys again using -c.
32 dnl
33 AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
34 AC_MSG_CHECKING(packet capture type)
35 if test ! -z "$with_pcap" ; then
36 V_PCAP="$withval"
37 elif test -r /dev/bpf0 ; then
38 V_PCAP=bpf
39 elif test -r /usr/include/net/pfilt.h ; then
40 V_PCAP=pf
41 elif test -r /dev/enet ; then
42 V_PCAP=enet
43 elif test -r /dev/nit ; then
44 V_PCAP=snit
45 elif test -r /usr/include/sys/net/nit.h ; then
46 V_PCAP=nit
47 elif test -r /usr/include/net/raw.h ; then
48 V_PCAP=snoop
49 elif test -r /usr/include/sys/dlpi.h ; then
50 V_PCAP=dlpi
51 elif test -r /usr/include/linux/socket.h ; then
52 V_PCAP=linux
53 elif test -c /dev/bpf0 ; then # check again in case not readable
54 V_PCAP=bpf
55 elif test -c /dev/enet ; then # check again in case not readable
56 V_PCAP=enet
57 elif test -c /dev/nit ; then # check again in case not readable
58 V_PCAP=snit
59 else
60 V_PCAP=null
61 fi
62 AC_MSG_RESULT($V_PCAP)
63
64 case "$V_PCAP" in
65
66 dlpi)
67 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
68 AC_MSG_CHECKING(for /dev/dlpi device)
69 if test -c /dev/dlpi ; then
70 AC_MSG_RESULT(yes)
71 AC_DEFINE(HAVE_DEV_DLPI)
72 else
73 AC_MSG_RESULT(no)
74 dir="/dev/dlpi"
75 AC_MSG_CHECKING(for $dir directory)
76 if test -d $dir ; then
77 AC_MSG_RESULT(yes)
78 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir")
79 else
80 AC_MSG_RESULT(no)
81 fi
82 fi
83 ;;
84
85 linux)
86 AC_CHECK_HEADERS(net/if_arp.h)
87 AC_MSG_CHECKING(Linux kernel version)
88 AC_CACHE_VAL(ac_cv_linux_vers,
89 ac_cv_linux_vers=`uname -r 2>&1 | \
90 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
91 AC_MSG_RESULT($ac_cv_linux_vers)
92 if test $ac_cv_linux_vers -lt 2 ; then
93 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
94 fi
95 ;;
96
97 null)
98 AC_MSG_WARN(cannot determine packet capture interface)
99 AC_MSG_WARN((see the INSTALL doc for more info))
100 ;;
101
102 esac
103
104 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
105
106 case "$target_os" in
107
108 aix*)
109 dnl Workaround to enable certain features
110 AC_DEFINE(_SUN)
111 ;;
112
113 hpux9*)
114 AC_DEFINE(HAVE_HPUX9)
115 ;;
116
117 hpux10.0*)
118 ;;
119
120 hpux10.1*)
121 ;;
122
123 hpux*)
124 dnl HPUX 10.20 and above is similar to HPUX 9...
125 AC_DEFINE(HAVE_HPUX10_20)
126 ;;
127
128 sinix*)
129 AC_MSG_CHECKING(if SINIX compiler defines sinix)
130 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
131 AC_TRY_COMPILE(
132 [],
133 [int i = sinix;],
134 ac_cv_cc_sinix_defined=yes,
135 ac_cv_cc_sinix_defined=no))
136 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
137 if test $ac_cv_cc_sinix_defined = no ; then
138 AC_DEFINE(sinix)
139 fi
140 ;;
141
142 solaris*)
143 AC_DEFINE(HAVE_SOLARIS)
144 ;;
145
146 linux*)
147 V_INCLS="$V_INCLS -Ilinux-include"
148 ;;
149 esac
150
151 AC_CHECK_PROGS(V_RANLIB, ranlib, @true)
152
153 AC_LBL_DEVEL(V_CCOPT)
154
155 AC_LBL_SOCKADDR_SA_LEN
156
157 AC_LBL_UNALIGNED_ACCESS
158
159 if test "${srcdir}" = "." ; then
160 srcdirprefix=""
161 else
162 srcdirprefix="./"
163 fi
164
165 if test -r ${srcdirprefix}lbl/gnuc.h ; then
166 rm -f gnuc.h
167 ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
168 fi
169
170 rm -f bpf_filter.c
171 ln -s ${srcdirprefix}bpf/net/bpf_filter.c bpf_filter.c
172 rm -f net
173 ln -s ${srcdirprefix}bpf/net net
174
175 AC_SUBST(V_CCOPT)
176 AC_SUBST(V_INCLS)
177 AC_SUBST(V_LEX)
178 AC_SUBST(V_PCAP)
179 AC_SUBST(V_RANLIB)
180 AC_SUBST(V_YACC)
181
182 AC_PROG_INSTALL
183
184 AC_OUTPUT(Makefile)
185
186 if test -f .devel ; then
187 make depend
188 fi
189 exit 0