1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.86 2000-10-21 04:50:43 guy 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.86 $)
14 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
18 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
21 dnl libpcap doesn't itself use <sys/ioccom.h>; however, the test program
22 dnl in "AC_LBL_FIXINCLUDES" in "aclocal.m4" uses it, so we have to
23 dnl test for it and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
24 dnl "AC_LBL_FIXINCLUDES" won't work on some platforms such as Solaris.
26 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h ifaddrs.h)
30 AC_CHECK_FUNCS(ether_hostton strerror freeifaddrs strlcpy)
32 dnl to pacify those who hate protochain insn
33 AC_MSG_CHECKING(if --disable-protochain option is specified)
34 AC_ARG_ENABLE(protochain, [ --disable-protochain disable \"protochain\" insn])
35 case "x$enable_protochain" in
36 xyes) enable_protochain=enabled ;;
37 xno) enable_protochain=disabled ;;
38 x) enable_protochain=enabled ;;
41 if test "$enable_protochain" = "disabled"; then
42 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
44 AC_MSG_RESULT(${enable_protochain})
47 dnl Not all versions of test support -c (character special) but it's a
48 dnl better way of testing since the device might be protected. So we
49 dnl check in our normal order using -r and then check the for the /dev
50 dnl guys again using -c.
52 dnl XXX This could be done for cross-compiling, but for now it's not.
54 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
55 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
57 AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
58 AC_MSG_CHECKING(packet capture type)
59 if test ! -z "$with_pcap" ; then
61 elif test -r /dev/bpf0 ; then
63 elif test -r /usr/include/net/pfilt.h ; then
65 elif test -r /dev/enet ; then
67 elif test -r /dev/nit ; then
69 elif test -r /usr/include/sys/net/nit.h ; then
71 elif test -r /usr/include/net/raw.h ; then
73 elif test -r /usr/include/sys/dlpi.h ; then
75 elif test -r /usr/include/linux/socket.h ; then
77 elif test -c /dev/bpf0 ; then # check again in case not readable
79 elif test -c /dev/enet ; then # check again in case not readable
81 elif test -c /dev/nit ; then # check again in case not readable
86 AC_MSG_RESULT($V_PCAP)
88 AC_MSG_CHECKING(if --enable-ipv6 option is specified)
89 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version])
90 if test "$enable_ipv6" = "yes"; then
91 AC_DEFINE(INET6,1,[IPv6])
93 AC_MSG_RESULT(${enable_ipv6-no})
98 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
99 AC_MSG_CHECKING(for /dev/dlpi device)
100 if test -c /dev/dlpi ; then
102 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
106 AC_MSG_CHECKING(for $dir directory)
107 if test -d $dir ; then
109 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
117 AC_CHECK_HEADERS(netpacket/packet.h)
118 AC_MSG_CHECKING(Linux kernel version)
119 if test "$cross_compiling" = yes; then
120 AC_CACHE_VAL(ac_cv_linux_vers,
121 ac_cv_linux_vers=unknown)
123 AC_CACHE_VAL(ac_cv_linux_vers,
124 ac_cv_linux_vers=`uname -r 2>&1 | \
125 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
127 AC_MSG_RESULT($ac_cv_linux_vers)
128 if test $ac_cv_linux_vers = unknown ; then
129 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
131 if test $ac_cv_linux_vers -lt 2 ; then
132 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
137 AC_MSG_WARN(cannot determine packet capture interface)
138 AC_MSG_WARN((see the INSTALL doc for more info))
143 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
144 if test "$V_LEX" = lex ; then
145 # Some versions of lex can't handle the definitions section of scanner.l .
146 # Try lexing it and complain if it can't deal.
147 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
148 if lex -t scanner.l > /dev/null 2>&1; then
149 tcpdump_cv_capable_lex=yes
151 tcpdump_cv_capable_lex=insufficient
153 if test $tcpdump_cv_capable_lex = insufficient ; then
154 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
155 libpcap. flex is a lex replacement that has many advantages, including
156 being able to compile libpcap. For more information, see
157 http://www.gnu.org/software/flex/flex.html .])
164 dnl Workaround to enable certain features
165 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
169 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
179 dnl HPUX 10.20 and above is similar to HPUX 9...
180 AC_DEFINE(HAVE_HPUX10_20,1,[on HP-UX 10.20])
184 AC_MSG_CHECKING(if SINIX compiler defines sinix)
185 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
189 ac_cv_cc_sinix_defined=yes,
190 ac_cv_cc_sinix_defined=no))
191 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
192 if test $ac_cv_cc_sinix_defined = no ; then
193 AC_DEFINE(sinix,1,[on sinix])
198 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
204 AC_LBL_DEVEL(V_CCOPT)
206 AC_LBL_SOCKADDR_SA_LEN
208 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
210 AC_LBL_UNALIGNED_ACCESS
213 ln -s ${srcdir}/bpf/net net
224 AC_CONFIG_HEADER(config.h)
228 if test -f .devel ; then