1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.82 2000-07-06 01:50:36 assar 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.
9 AC_REVISION($Revision: 1.82 $)
14 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
16 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
20 AC_CHECK_HEADERS(sys/sockio.h ifaddrs.h)
24 AC_CHECK_FUNCS(ether_hostton strerror freeifaddrs strlcpy)
26 dnl to pacify those who hate protochain insn
27 AC_MSG_CHECKING(if --disable-protochain option is specified)
28 AC_ARG_ENABLE(protochain, [ --disable-protochain disable \"protochain\" insn])
29 case "x$enable_protochain" in
30 xyes) enable_protochain=enabled ;;
31 xno) enable_protochain=disabled ;;
32 x) enable_protochain=enabled ;;
35 if test "$enable_protochain" = "disabled"; then
36 AC_DEFINE(NO_PROTOCHAIN)
38 AC_MSG_RESULT(${enable_protochain})
41 dnl Not all versions of test support -c (character special) but it's a
42 dnl better way of testing since the device might be protected. So we
43 dnl check in our normal order using -r and then check the for the /dev
44 dnl guys again using -c.
46 dnl XXX This could be done for cross-compiling, but for now it's not.
48 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
49 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
51 AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
52 AC_MSG_CHECKING(packet capture type)
53 if test ! -z "$with_pcap" ; then
55 elif test -r /dev/bpf0 ; then
57 elif test -r /usr/include/net/pfilt.h ; then
59 elif test -r /dev/enet ; then
61 elif test -r /dev/nit ; then
63 elif test -r /usr/include/sys/net/nit.h ; then
65 elif test -r /usr/include/net/raw.h ; then
67 elif test -r /usr/include/sys/dlpi.h ; then
69 elif test -r /usr/include/linux/socket.h ; then
71 elif test -c /dev/bpf0 ; then # check again in case not readable
73 elif test -c /dev/enet ; then # check again in case not readable
75 elif test -c /dev/nit ; then # check again in case not readable
80 AC_MSG_RESULT($V_PCAP)
82 AC_MSG_CHECKING(if --enable-ipv6 option is specified)
83 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version])
84 if test "$enable_ipv6" = "yes"; then
87 AC_MSG_RESULT(${enable_ipv6-no})
92 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
93 AC_MSG_CHECKING(for /dev/dlpi device)
94 if test -c /dev/dlpi ; then
96 AC_DEFINE(HAVE_DEV_DLPI)
100 AC_MSG_CHECKING(for $dir directory)
101 if test -d $dir ; then
103 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir")
111 AC_CHECK_HEADERS(netpacket/packet.h)
112 AC_MSG_CHECKING(Linux kernel version)
113 if test "$cross_compiling" = yes; then
114 AC_CACHE_VAL(ac_cv_linux_vers,
115 ac_cv_linux_vers=unknown)
117 AC_CACHE_VAL(ac_cv_linux_vers,
118 ac_cv_linux_vers=`uname -r 2>&1 | \
119 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
121 AC_MSG_RESULT($ac_cv_linux_vers)
122 if test $ac_cv_linux_vers = unknown ; then
123 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
125 if test $ac_cv_linux_vers -lt 2 ; then
126 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
131 AC_MSG_WARN(cannot determine packet capture interface)
132 AC_MSG_WARN((see the INSTALL doc for more info))
137 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
142 dnl Workaround to enable certain features
147 AC_DEFINE(HAVE_HPUX9)
157 dnl HPUX 10.20 and above is similar to HPUX 9...
158 AC_DEFINE(HAVE_HPUX10_20)
162 AC_MSG_CHECKING(if SINIX compiler defines sinix)
163 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
167 ac_cv_cc_sinix_defined=yes,
168 ac_cv_cc_sinix_defined=no))
169 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
170 if test $ac_cv_cc_sinix_defined = no ; then
176 AC_DEFINE(HAVE_SOLARIS)
180 V_INCLS="$V_INCLS -Ilinux-include"
186 AC_LBL_DEVEL(V_CCOPT)
188 AC_LBL_SOCKADDR_SA_LEN
190 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
192 AC_LBL_UNALIGNED_ACCESS
194 if test -r ${srcdir}/lbl/gnuc.h ; then
196 ln -s ${srcdir}/lbl/gnuc.h gnuc.h
200 ln -s ${srcdir}/bpf/net net
213 if test -f .devel ; then