]> The Tcpdump Group git mirrors - libpcap/blob - configure.in
Improve dag_platform_finddevs range and efficiency.
[libpcap] / configure.in
1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.168 2008-12-23 20:49:26 guy 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 #
10 # See
11 #
12 # http://ftp.gnu.org/gnu/config/README
13 #
14 # for the URLs to use to fetch new versions of config.guess and
15 # config.sub.
16 #
17
18 AC_REVISION($Revision: 1.168 $)
19 AC_PREREQ(2.50)
20 AC_INIT(pcap.c)
21
22 AC_CANONICAL_SYSTEM
23
24 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
25 AC_LBL_C_INLINE
26 AC_C___ATTRIBUTE__
27
28 AC_CHECK_HEADERS(sys/bitypes.h)
29
30 AC_CHECK_TYPE([int8_t], ,
31 [AC_DEFINE([int8_t], [signed char],
32 [Define to `signed char' if int8_t not defined.])],
33 [AC_INCLUDES_DEFAULT
34 #ifdef HAVE_SYS_BITYPES_H
35 #include <sys/bitypes.h>
36 #endif])
37 AC_CHECK_TYPE([u_int8_t], ,
38 [AC_DEFINE([u_int8_t], [unsigned char],
39 [Define to `unsigned char' if u_int8_t not defined.])],
40 [AC_INCLUDES_DEFAULT
41 #ifdef HAVE_SYS_BITYPES_H
42 #include <sys/bitypes.h>
43 #endif])
44 AC_CHECK_TYPE([int16_t], ,
45 [AC_DEFINE([int16_t], [short],
46 [Define to `short' if int16_t not defined.])]
47 [AC_INCLUDES_DEFAULT
48 #ifdef HAVE_SYS_BITYPES_H
49 #include <sys/bitypes.h>
50 #endif])
51 AC_CHECK_TYPE([u_int16_t], ,
52 [AC_DEFINE([u_int16_t], [unsigned short],
53 [Define to `unsigned short' if u_int16_t not defined.])],
54 [AC_INCLUDES_DEFAULT
55 #ifdef HAVE_SYS_BITYPES_H
56 #include <sys/bitypes.h>
57 #endif])
58 AC_CHECK_TYPE([int32_t], ,
59 [AC_DEFINE([int32_t], [int],
60 [Define to `int' if int32_t not defined.])],
61 [AC_INCLUDES_DEFAULT
62 #ifdef HAVE_SYS_BITYPES_H
63 #include <sys/bitypes.h>
64 #endif])
65 AC_CHECK_TYPE([u_int32_t], ,
66 [AC_DEFINE([u_int32_t], [unsigned int],
67 [Define to `unsigned int' if u_int32_t not defined.])],
68 [AC_INCLUDES_DEFAULT
69 #ifdef HAVE_SYS_BITYPES_H
70 #include <sys/bitypes.h>
71 #endif])
72 AC_CHECK_TYPE([int64_t], ,
73 [AC_DEFINE([int64_t], [long long],
74 [Define to `long long' if int64_t not defined.])],
75 [AC_INCLUDES_DEFAULT
76 #ifdef HAVE_SYS_BITYPES_H
77 #include <sys/bitypes.h>
78 #endif])
79 AC_CHECK_TYPE([u_int64_t], ,
80 [AC_DEFINE([u_int64_t], [unsigned long long],
81 [Define to `unsigned long long' if u_int64_t not defined.])],
82 [AC_INCLUDES_DEFAULT
83 #ifdef HAVE_SYS_BITYPES_H
84 #include <sys/bitypes.h>
85 #endif])
86
87 #
88 # Try to arrange for large file support.
89 #
90 AC_SYS_LARGEFILE
91 AC_FUNC_FSEEKO
92
93 dnl
94 dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
95 dnl include <sys/ioccom.h>, and we were to drop support for older
96 dnl releases without that fix, so that pcap-bpf.c doesn't need to
97 dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
98 dnl in "aclocal.m4" uses it, so we would still have to test for it
99 dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
100 dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
101 dnl
102 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h limits.h paths.h)
103 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
104 #include <sys/socket.h>
105 #include <net/if.h>])
106 if test "$ac_cv_header_net_pfvar_h" = yes; then
107 #
108 # Check for various PF actions.
109 #
110 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
111 AC_TRY_COMPILE(
112 [#include <sys/types.h>
113 #include <sys/socket.h>
114 #include <net/if.h>
115 #include <net/pfvar.h>],
116 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
117 [
118 AC_MSG_RESULT(yes)
119 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
120 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
121 ],
122 AC_MSG_RESULT(no))
123 fi
124 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
125 #include <sys/socket.h>])
126 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
127 #
128 # The simple test didn't work.
129 # Do we need to include <net/if.h> first?
130 # Unset ac_cv_header_netinet_if_ether_h so we don't
131 # treat the previous failure as a cached value and
132 # suppress the next test.
133 #
134 AC_MSG_NOTICE([Rechecking with some additional includes])
135 unset ac_cv_header_netinet_if_ether_h
136 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
137 #include <sys/socket.h>
138 #include <netinet/in.h>
139 struct mbuf;
140 struct rtentry;
141 #include <net/if.h>])
142 fi
143
144 AC_LBL_FIXINCLUDES
145
146 AC_CHECK_FUNCS(strerror strlcpy)
147
148 needsnprintf=no
149 AC_CHECK_FUNCS(vsnprintf snprintf,,
150 [needsnprintf=yes])
151 if test $needsnprintf = yes; then
152 AC_LIBOBJ(snprintf)
153 fi
154
155 #
156 # Do this before checking for ether_hostton(), as it's a
157 # "gethostbyname() -ish function".
158 #
159 AC_LBL_LIBRARY_NET
160
161 #
162 # You are in a twisty little maze of UN*Xes, all different.
163 # Some might not have ether_hostton().
164 # Some might have it, but not declare it in any header file.
165 # Some might have it, but declare it in <netinet/if_ether.h>.
166 # Some might have it, but declare it in <netinet/ether.h>
167 # (And some might have it but document it as something declared in
168 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
169 #
170 # Before you is a C compiler.
171 #
172 AC_CHECK_FUNCS(ether_hostton)
173 if test "$ac_cv_func_ether_hostton" = yes; then
174 #
175 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
176 #
177 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
178 #
179 # Yes. Does it declare ether_hostton()?
180 #
181 AC_CHECK_DECL(ether_hostton,
182 [
183 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
184 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
185 ],,
186 [
187 #include <sys/types.h>
188 #include <sys/socket.h>
189 #include <netinet/in.h>
190 #include <arpa/inet.h>
191 struct mbuf;
192 struct rtentry;
193 #include <net/if.h>
194 #include <netinet/if_ether.h>
195 ])
196 fi
197 #
198 # Did that succeed?
199 #
200 if test "$ac_cv_have_decl_ether_hostton" != yes; then
201 #
202 # No, how about <netinet/ether.h>, as on Linux?
203 #
204 AC_CHECK_HEADERS(netinet/ether.h)
205 if test "$ac_cv_header_netinet_ether_h" = yes; then
206 #
207 # We have it - does it declare ether_hostton()?
208 # Unset ac_cv_have_decl_ether_hostton so we don't
209 # treat the previous failure as a cached value and
210 # suppress the next test.
211 #
212 unset ac_cv_have_decl_ether_hostton
213 AC_CHECK_DECL(ether_hostton,
214 [
215 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
216 [Define to 1 if netinet/ether.h declares `ether_hostton'])
217 ],,
218 [
219 #include <netinet/ether.h>
220 ])
221 fi
222 fi
223 #
224 # Is ether_hostton() declared?
225 #
226 if test "$ac_cv_have_decl_ether_hostton" != yes; then
227 #
228 # No, we'll have to declare it ourselves.
229 # Do we have "struct ether_addr"?
230 #
231 AC_CHECK_TYPES(struct ether_addr,,,
232 [
233 #include <sys/types.h>
234 #include <sys/socket.h>
235 #include <netinet/in.h>
236 #include <arpa/inet.h>
237 struct mbuf;
238 struct rtentry;
239 #include <net/if.h>
240 #include <netinet/if_ether.h>
241 ])
242 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
243 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
244 don't.])
245 else
246 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
247 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
248 don't.])
249 fi
250 fi
251
252 dnl to pacify those who hate protochain insn
253 AC_MSG_CHECKING(if --disable-protochain option is specified)
254 AC_ARG_ENABLE(protochain,
255 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
256 case "x$enable_protochain" in
257 xyes) enable_protochain=enabled ;;
258 xno) enable_protochain=disabled ;;
259 x) enable_protochain=enabled ;;
260 esac
261
262 if test "$enable_protochain" = "disabled"; then
263 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
264 fi
265 AC_MSG_RESULT(${enable_protochain})
266
267 #
268 # SITA support is mutually exclusive with native capture support;
269 # "--with-sita" selects SITA support.
270 #
271 AC_ARG_WITH(sita,
272 AC_HELP_STRING([--with-sita],[include SITA support]),
273 [
274 if test ! "x$withval" = "xno" ; then
275 AC_DEFINE(SITA,1,[include ACN support])
276 AC_MSG_NOTICE(Enabling SITA ACN support)
277 V_PCAP=sita
278 V_FINDALLDEVS=sita
279 fi
280 ],
281 [
282 dnl
283 dnl Not all versions of test support -c (character special) but it's a
284 dnl better way of testing since the device might be protected. So we
285 dnl check in our normal order using -r and then check the for the /dev
286 dnl guys again using -c.
287 dnl
288 dnl XXX This could be done for cross-compiling, but for now it's not.
289 dnl
290 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
291 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
292 fi
293 AC_ARG_WITH(pcap,
294 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
295 AC_MSG_CHECKING(packet capture type)
296 if test ! -z "$with_pcap" ; then
297 V_PCAP="$withval"
298 elif test -r /dev/bpf ; then
299 #
300 # Cloning BPF device.
301 #
302 V_PCAP=bpf
303 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
304 elif test -r /dev/bpf0 ; then
305 V_PCAP=bpf
306 elif test -r /usr/include/net/pfilt.h ; then
307 V_PCAP=pf
308 elif test -r /dev/enet ; then
309 V_PCAP=enet
310 elif test -r /dev/nit ; then
311 V_PCAP=snit
312 elif test -r /usr/include/sys/net/nit.h ; then
313 V_PCAP=nit
314 elif test -r /usr/include/linux/socket.h ; then
315 V_PCAP=linux
316 elif test -r /usr/include/net/raw.h ; then
317 V_PCAP=snoop
318 elif test -r /usr/include/odmi.h ; then
319 #
320 # On AIX, the BPF devices might not yet be present - they're
321 # created the first time libpcap runs after booting.
322 # We check for odmi.h instead.
323 #
324 V_PCAP=bpf
325 elif test -c /dev/bpf0 ; then # check again in case not readable
326 V_PCAP=bpf
327 elif test -r /usr/include/sys/dlpi.h ; then
328 V_PCAP=dlpi
329 elif test -c /dev/enet ; then # check again in case not readable
330 V_PCAP=enet
331 elif test -c /dev/nit ; then # check again in case not readable
332 V_PCAP=snit
333 else
334 V_PCAP=null
335 fi
336 AC_MSG_RESULT($V_PCAP)
337
338 #
339 # Do capture-mechanism-dependent tests.
340 #
341 case "$V_PCAP" in
342 dlpi)
343 #
344 # Checks to see if Solaris has the public libdlpi(3LIB) library.
345 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
346 # public libdlpi(3LIB) version. Before libdlpi was made public, a
347 # private version also existed, which did not have the same APIs.
348 # Due to a gcc bug, the default search path for 32-bit libraries does
349 # not include /lib, we add it explicitly here.
350 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
351 # Also, due to the bug above applications that link to libpcap with
352 # libdlpi will have to add "-L/lib" option to "configure".
353 #
354 saved_ldflags=$LDFLAGS
355 LDFLAGS="$LIBS -L/lib"
356 AC_CHECK_LIB(dlpi, dlpi_walk,
357 LIBS="-ldlpi $LIBS"
358 V_PCAP=libdlpi
359 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists]),
360 V_PCAP=dlpi)
361 LDFLAGS=$saved_ldflags
362
363 #
364 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
365 # versions of DLPI.
366 #
367 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
368 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
369 AC_TRY_COMPILE(
370 [
371 #include <sys/types.h>
372 #include <sys/time.h>
373 #include <sys/dlpi.h>
374 ],
375 [int i = DL_PROMISC_PHYS;],
376 ac_cv_sys_dlpi_usable=yes,
377 ac_cv_sys_dlpi_usable=no))
378 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
379 if test $ac_cv_sys_dlpi_usable = no ; then
380 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
381 fi
382
383 #
384 # Check whether we have a /dev/dlpi device or have multiple devices.
385 #
386 AC_MSG_CHECKING(for /dev/dlpi device)
387 if test -c /dev/dlpi ; then
388 AC_MSG_RESULT(yes)
389 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
390 else
391 AC_MSG_RESULT(no)
392 dir="/dev/dlpi"
393 AC_MSG_CHECKING(for $dir directory)
394 if test -d $dir ; then
395 AC_MSG_RESULT(yes)
396 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
397 else
398 AC_MSG_RESULT(no)
399 fi
400 fi
401
402 #
403 # This check is for Solaris with DLPI support for passive modes.
404 # See dlpi(7P) for more details.
405 #
406 AC_LBL_DL_PASSIVE_REQ_T
407 ;;
408
409 linux)
410 AC_MSG_CHECKING(Linux kernel version)
411 if test "$cross_compiling" = yes; then
412 AC_CACHE_VAL(ac_cv_linux_vers,
413 ac_cv_linux_vers=unknown)
414 else
415 AC_CACHE_VAL(ac_cv_linux_vers,
416 ac_cv_linux_vers=`uname -r 2>&1 | \
417 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
418 fi
419 AC_MSG_RESULT($ac_cv_linux_vers)
420 if test $ac_cv_linux_vers = unknown ; then
421 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
422 fi
423 if test $ac_cv_linux_vers -lt 2 ; then
424 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
425 fi
426
427 #
428 # Do we have the wireless extensions?
429 #
430 AC_CHECK_HEADERS(linux/wireless.h, [], [],
431 [
432 #include <sys/socket.h>
433 #include <linux/if.h>
434 #include <linux/types.h>
435 ])
436
437 #
438 # Do we have libnl?
439 #
440 AC_ARG_WITH(libnl,
441 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
442 with_libnl=$withval,,)
443
444 if test x$with_libnl != xno ; then
445 AC_CHECK_LIB(nl, nl_handle_alloc,
446 LIBS="-lnl $LIBS"
447 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]),
448 if test x$with_libnl = xyes ; then
449 AC_MSG_ERROR([libnl support requested but libnl not found])
450 fi
451 )
452 fi
453
454 AC_LBL_TPACKET_STATS
455 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
456 ;;
457
458 bpf)
459 #
460 # Check whether we have the *BSD-style ioctls.
461 #
462 AC_CHECK_HEADERS(net/if_media.h)
463
464 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
465 AC_TRY_COMPILE(
466 [#include <sys/socket.h>
467 #include <sys/ioctl.h>
468 #include <net/if.h>
469 #include <net/bpf.h>],
470 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
471 [
472 AC_MSG_RESULT(yes)
473 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
474 [define if the system supports zerocopy BPF])
475 ],
476 AC_MSG_RESULT(no))
477
478 #
479 # Check whether we have struct BPF_TIMEVAL.
480 #
481 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
482 [
483 #include <sys/types.h>
484 #include <sys/ioctl.h>
485 #ifdef HAVE_SYS_IOCCOM_H
486 #include <sys/ioccom.h>
487 #endif
488 #include <net/bpf.h>
489 ])
490 ;;
491
492 dag)
493 V_DEFS="$V_DEFS -DDAG_ONLY"
494 ;;
495
496 septel)
497 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
498 ;;
499
500 null)
501 AC_MSG_WARN(cannot determine packet capture interface)
502 AC_MSG_WARN((see the INSTALL doc for more info))
503 ;;
504 esac
505
506 dnl
507 dnl Now figure out how we get a list of interfaces and addresses,
508 dnl if we support capturing. Don't bother if we don't support
509 dnl capturing.
510 dnl
511 if test "$V_PCAP" = null
512 then
513 #
514 # We can't capture, so we can't open any capture
515 # devices, so we won't return any interfaces.
516 #
517 V_FINDALLDEVS=null
518 else
519 AC_CHECK_FUNC(getifaddrs,[
520 #
521 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
522 # as well, just in case some platform is really weird.
523 #
524 AC_CHECK_HEADER(ifaddrs.h,[
525 #
526 # We have the header, so we use "getifaddrs()" to
527 # get the list of interfaces.
528 #
529 V_FINDALLDEVS=getad
530 ],[
531 #
532 # We don't have the header - give up.
533 # XXX - we could also fall back on some other
534 # mechanism, but, for now, this'll catch this
535 # problem so that we can at least try to figure
536 # out something to do on systems with "getifaddrs()"
537 # but without "ifaddrs.h", if there is something
538 # we can do on those systems.
539 #
540 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
541 ])
542 ],[
543 #
544 # Well, we don't have "getifaddrs()", so we have to use
545 # some other mechanism; determine what that mechanism is.
546 #
547 # The first thing we use is the type of capture mechanism,
548 # which is somewhat of a proxy for the OS we're using.
549 #
550 case "$V_PCAP" in
551
552 dlpi|libdlpi)
553 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
554 #
555 # This might be Solaris 8 or later, with
556 # SIOCGLIFCONF, or it might be some other OS
557 # or some older version of Solaris, with
558 # just SIOCGIFCONF.
559 #
560 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
561 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
562 AC_TRY_COMPILE(
563 [#include <sys/param.h>
564 #include <sys/file.h>
565 #include <sys/ioctl.h>
566 #include <sys/socket.h>
567 #include <sys/sockio.h>],
568 [ioctl(0, SIOCGLIFCONF, (char *)0);],
569 ac_cv_lbl_have_siocglifconf=yes,
570 ac_cv_lbl_have_siocglifconf=no))
571 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
572 if test $ac_cv_lbl_have_siocglifconf = yes ; then
573 V_FINDALLDEVS=glifc
574 else
575 V_FINDALLDEVS=gifc
576 fi
577 #
578 # Needed for common functions used by pcap-[dlpi,libdlpi].c
579 #
580 SSRC="dlpisubs.c"
581 ;;
582
583 *)
584 #
585 # Assume we just have SIOCGIFCONF.
586 # (XXX - on at least later Linux kernels, there's
587 # another mechanism, and we should be using that
588 # instead.)
589 #
590 V_FINDALLDEVS=gifc
591 ;;
592 esac])
593 fi
594 ])
595
596 AC_MSG_CHECKING(for socklen_t)
597 AC_TRY_COMPILE([
598 #include <sys/types.h>
599 #include <sys/socket.h>
600 ],
601 [ socklen_t x; ],
602 have_socklen_t=yes,
603 have_socklen_t=no)
604 if test "x$have_socklen_t" = "xyes"; then
605 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
606 fi
607 AC_MSG_RESULT($have_socklen_t)
608
609 AC_ARG_ENABLE(ipv6,
610 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
611 [],
612 [enable_ipv6=ifavailable])
613 if test "$enable_ipv6" != "no"; then
614 AC_CHECK_FUNC(getaddrinfo,
615 [
616 AC_DEFINE(INET6,1,[IPv6])
617 ],
618 [
619 if test "$enable_ipv6" != "ifavailable"; then
620 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
621 fi
622 ])
623 fi
624
625 AC_MSG_CHECKING(whether to build optimizer debugging code)
626 AC_ARG_ENABLE(optimizer-dbg,
627 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
628 if test "$enable_optimizer_dbg" = "yes"; then
629 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
630 fi
631 AC_MSG_RESULT(${enable_optimizer_dbg-no})
632
633 AC_MSG_CHECKING(whether to build parser debugging code)
634 AC_ARG_ENABLE(yydebug,
635 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
636 if test "$enable_yydebug" = "yes"; then
637 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
638 fi
639 AC_MSG_RESULT(${enable_yydebug-no})
640
641 AC_MSG_CHECKING(whether we have /proc/net/dev)
642 if test -r /proc/net/dev ; then
643 ac_cv_lbl_proc_net_dev=yes
644 else
645 ac_cv_lbl_proc_net_dev=no
646 fi
647 if test $ac_cv_lbl_proc_net_dev = yes; then
648 AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev])
649 fi
650 AC_MSG_RESULT($ac_cv_lbl_proc_net_dev)
651
652 # Check for Endace DAG card support.
653 AC_ARG_WITH([dag],
654 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
655 [
656 if test "$withval" = no
657 then
658 # User doesn't want DAG support.
659 want_dag=no
660 elif test "$withval" = yes
661 then
662 # User wants DAG support but hasn't specified a directory.
663 want_dag=yes
664 else
665 # User wants DAG support and has specified a directory, so use the provided value.
666 want_dag=yes
667 dag_root=$withval
668 fi
669 ],[
670 #
671 # Use DAG API if present, otherwise don't
672 #
673 want_dag=ifpresent
674 ])
675
676 AC_ARG_WITH([dag-includes],
677 AC_HELP_STRING([--with-dag-includes=DIR],[Endace DAG include directory]),
678 [
679 # User wants DAG support and has specified a header directory, so use the provided value.
680 want_dag=yes
681 dag_include_dir=$withval
682 ],[])
683
684 AC_ARG_WITH([dag-libraries],
685 AC_HELP_STRING([--with-dag-libraries=DIR],[Endace DAG library directory]),
686 [
687 # User wants DAG support and has specified a library directory, so use the provided value.
688 want_dag=yes
689 dag_lib_dir=$withval
690 ],[])
691
692 case "$V_PCAP" in
693 linux|bpf|dag)
694 #
695 # We support the DAG API if we're on Linux or BSD, or if we're
696 # building a DAG-only libpcap.
697 #
698 ;;
699 *)
700 #
701 # If the user explicitly requested DAG, tell them it's not
702 # supported.
703 #
704 # If they expressed no preference, don't include it.
705 #
706 if test $want_dag = yes; then
707 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
708 elif test $want_dag = yes; then
709 want_dag=no
710 fi
711 ;;
712 esac
713
714 ac_cv_lbl_dag_api=no
715 if test "$want_dag" != no; then
716
717 AC_MSG_CHECKING([whether we have DAG API headers])
718
719 # If necessary, set default paths for DAG API headers and libraries.
720 if test -z "$dag_root"; then
721 dag_root=/usr/local
722 fi
723
724 if test -z "$dag_include_dir"; then
725 dag_include_dir="$dag_root/include"
726 fi
727
728 if test -z "$dag_lib_dir"; then
729 dag_lib_dir="$dag_root/lib"
730 fi
731
732 if test -z "$dag_tools_dir"; then
733 dag_tools_dir="$dag_root/tools"
734 fi
735
736 if test -r $dag_include_dir/dagapi.h; then
737 ac_cv_lbl_dag_api=yes
738 fi
739 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
740 fi
741
742 if test $ac_cv_lbl_dag_api = yes; then
743
744 AC_MSG_CHECKING([dagapi.o])
745 dagapi_obj=no
746 if test -r $dag_tools_dir/dagapi.o; then
747 # 2.4.x.
748 dagapi_obj=$dag_tools_dir/dagapi.o
749 elif test -r $dag_lib_dir/dagapi.o; then
750 # 2.5.x.
751 dagapi_obj=$dag_lib_dir/dagapi.o
752 elif test -r $dag_lib_dir/libdag.a; then
753 # 2.5.x.
754 ar x $dag_lib_dir/libdag.a dagapi.o 2>/dev/null
755 if test -r ./dagapi.o; then
756 dagapi_obj=./dagapi.o
757 else
758 ar x $dag_lib_dir/libdag.a libdag_la-dagapi.o 2>/dev/null
759 if test -r ./libdag_la-dagapi.o; then
760 dagapi_obj=./libdag_la-dagapi.o
761 fi
762 fi
763 fi
764
765 if test $dagapi_obj = no; then
766 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
767 ac_cv_lbl_dag_api=no
768 else
769 AC_MSG_RESULT([yes ($dagapi_obj)])
770 fi
771 fi
772
773 if test $ac_cv_lbl_dag_api = yes; then
774
775 AC_MSG_CHECKING([dagopts.o])
776 dagopts_obj=no
777 if test -r $dag_tools_dir/dagopts.o; then
778 # 2.4.x.
779 dagopts_obj=$dag_tools_dir/dagopts.o
780 elif test -r $dag_lib_dir/dagopts.o; then
781 # 2.5.x.
782 dagopts_obj=$dag_lib_dir/dagopts.o
783 elif test -r $dag_lib_dir/libdag.a; then
784 # 2.5.x.
785 ar x $dag_lib_dir/libdag.a dagopts.o 2>/dev/null
786 if test -r ./dagopts.o; then
787 dagopts_obj=./dagopts.o
788 else
789 ar x $dag_lib_dir/libdag.a libdag_la-dagopts.o 2>/dev/null
790 if test -r ./libdag_la-dagopts.o; then
791 dagopts_obj=./libdag_la-dagopts.o
792 fi
793 fi
794 fi
795
796 if test $dagopts_obj = no; then
797 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
798 ac_cv_lbl_dag_api=no
799 else
800 AC_MSG_RESULT([yes ($dagopts_obj)])
801 fi
802 fi
803
804 if test $ac_cv_lbl_dag_api = yes; then
805 # Under 2.5.x only we need to add dagreg.o.
806 if test -r $dag_include_dir/dagreg.h; then
807 AC_MSG_CHECKING([dagreg.o])
808 dagreg_obj=no
809 if test -r $dag_lib_dir/dagreg.o; then
810 # Object file is ready and waiting.
811 dagreg_obj=$dag_lib_dir/dagreg.o
812 elif test -r $dag_lib_dir/libdag.a; then
813 # Extract from libdag.a.
814 ar x $dag_lib_dir/libdag.a dagreg.o 2>/dev/null
815 if test -r ./dagreg.o; then
816 dagreg_obj=./dagreg.o
817 else
818 ar x $dag_lib_dir/libdag.a libdag_la-dagreg.o 2>/dev/null
819 if test -r ./libdag_la-dagreg.o; then
820 dagreg_obj=./libdag_la-dagreg.o
821 fi
822 fi
823 fi
824
825 if test $dagreg_obj = no; then
826 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
827 ac_cv_lbl_dag_api=no
828 else
829 AC_MSG_RESULT([yes ($dagreg_obj)])
830 fi
831 fi
832 fi
833
834 if test $ac_cv_lbl_dag_api = yes; then
835 # Under 2.5.x only we need to add dagutil.o.
836 if test -r $dag_include_dir/dagutil.h; then
837 AC_MSG_CHECKING([dagutil.o])
838 dagutil_obj=no
839 if test -r $dag_lib_dir/dagutil.o; then
840 # Object file is ready and waiting.
841 dagutil_obj=$dag_lib_dir/dagutil.o
842 elif test -r $dag_lib_dir/libdag.a; then
843 # Extract from libdag.a.
844 ar x $dag_lib_dir/libdag.a dagutil.o 2>/dev/null
845 if test -r ./dagutil.o; then
846 dagutil_obj=./dagutil.o
847 else
848 ar x $dag_lib_dir/libdag.a libdag_la-dagutil.o 2>/dev/null
849 if test -r ./libdag_la-dagutil.o; then
850 dagutil_obj=./libdag_la-dagutil.o
851 fi
852 fi
853 fi
854
855 if test $dagutil_obj = no; then
856 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
857 ac_cv_lbl_dag_api=no
858 else
859 AC_MSG_RESULT([yes ($dagutil_obj)])
860 fi
861 fi
862 fi
863
864 if test $ac_cv_lbl_dag_api = yes; then
865 V_INCLS="$V_INCLS -I$dag_include_dir"
866 ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj $dagutil_obj"
867 if test $V_PCAP != dag ; then
868 SSRC="pcap-dag.c"
869 fi
870
871 # See if we can find a general version string.
872 # Don't need to save and restore LIBS to prevent -ldag being
873 # included if there's a found-action (arg 3).
874 saved_ldflags=$LDFLAGS
875 LDFLAGS="-L$dag_lib_dir"
876 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
877 AC_CHECK_LIB([dag],[dag_get_erf_types], [
878 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
879 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
880 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
881 LDFLAGS=$saved_ldflags
882
883 if test "$dag_streams" = 1; then
884 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
885 LIBS="$LIBS -ldag"
886 fi
887
888 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
889 fi
890
891 AC_MSG_CHECKING(whether we have the DAG API)
892
893 if test $ac_cv_lbl_dag_api = no; then
894 AC_MSG_RESULT(no)
895 if test "$want_dag" = yes; then
896 # User wanted DAG support but we couldn't find it.
897 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
898 fi
899
900 if test "$V_PCAP" = dag; then
901 # User requested "dag" capture type but the DAG API wasn't
902 # found.
903 AC_MSG_ERROR([Specifying the capture type as "dag" requires the DAG API to be present; use the --with-dag options to specify the location. (Try "./configure --help" for more information.)])
904 fi
905 else
906 AC_MSG_RESULT(yes)
907 fi
908
909 AC_ARG_WITH(septel,
910 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, on Linux, if present@:>@]),
911 [
912 if test "$withval" = no
913 then
914 want_septel=no
915 elif test "$withval" = yes
916 then
917 want_septel=yes
918 septel_root=
919 else
920 want_septel=yes
921 septel_root=$withval
922 fi
923 ],[
924 #
925 # Use Septel API if present, otherwise don't
926 #
927 want_septel=ifpresent
928 septel_root=./../septel
929 ])
930 ac_cv_lbl_septel_api=no
931 case "$V_PCAP" in
932 linux|septel)
933 #
934 # We support the Septel API if we're on Linux, or if we're building
935 # a Septel-only libpcap.
936 #
937 ;;
938 *)
939 #
940 # If the user explicitly requested Septel, tell them it's not
941 # supported.
942 #
943 # If they expressed no preference, don't include it.
944 #
945 if test $want_septel = yes; then
946 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
947 elif test $want_septel = yes; then
948 want_septel=no
949 fi
950 ;;
951 esac
952
953 if test "$with_septel" != no; then
954 AC_MSG_CHECKING(whether we have Septel API)
955
956 if test -z "$septel_root"; then
957 septel_root=$srcdir/../septel
958 fi
959
960 septel_tools_dir="$septel_root"
961 septel_include_dir="$septel_root/INC"
962
963 ac_cv_lbl_septel_api=no
964 if test -r "$septel_include_dir/msg.h"; then
965 V_INCLS="$V_INCLS -I$septel_include_dir"
966 ADDLOBJS="$ADDLOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
967 ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
968
969 if test "$V_PCAP" != septel ; then
970 SSRC="pcap-septel.c"
971 fi
972 ac_cv_lbl_septel_api=yes
973 fi
974
975 AC_MSG_RESULT($ac_cv_lbl_septel_api)
976 if test $ac_cv_lbl_septel_api = no; then
977 if test "$want_septel" = yes; then
978 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
979 fi
980 else
981 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
982 fi
983 fi
984
985 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
986 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
987 fi
988
989
990 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
991 if test "$V_LEX" = lex ; then
992 # Some versions of lex can't handle the definitions section of scanner.l .
993 # Try lexing it and complain if it can't deal.
994 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
995 if lex -t scanner.l > /dev/null 2>&1; then
996 tcpdump_cv_capable_lex=yes
997 else
998 tcpdump_cv_capable_lex=insufficient
999 fi)
1000 if test $tcpdump_cv_capable_lex = insufficient ; then
1001 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
1002 libpcap. flex is a lex replacement that has many advantages, including
1003 being able to compile libpcap. For more information, see
1004 http://www.gnu.org/software/flex/flex.html .])
1005 fi
1006 fi
1007
1008 #
1009 # Assume, by default, no support for shared libraries and V7/BSD convention
1010 # for man pages (file formats in section 5, miscellaneous info in section 7).
1011 # Individual cases can override this.
1012 #
1013 DYEXT="none"
1014 MAN_FILE_FORMATS=5
1015 MAN_MISC_INFO=7
1016 case "$host_os" in
1017
1018 aix*)
1019 dnl Workaround to enable certain features
1020 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1021
1022 #
1023 # AIX makes it fun to build shared and static libraries,
1024 # because they're *both* ".a" archive libraries. We
1025 # build the static library for the benefit of the traditional
1026 # scheme of building libpcap and tcpdump in subdirectories of
1027 # the same directory, with tcpdump statically linked with the
1028 # libpcap in question, but we also build a shared library as
1029 # "libpcap.shareda" and install *it*, rather than the static
1030 # library, as "libpcap.a".
1031 #
1032 DYEXT="shareda"
1033
1034 case "$V_PCAP" in
1035
1036 dlpi)
1037 #
1038 # If we're using DLPI, applications will need to
1039 # use /lib/pse.exp if present, as we use the
1040 # STREAMS routines.
1041 #
1042 pseexe="/lib/pse.exp"
1043 AC_MSG_CHECKING(for $pseexe)
1044 if test -f $pseexe ; then
1045 AC_MSG_RESULT(yes)
1046 LIBS="-I:$pseexe"
1047 fi
1048 ;;
1049
1050 bpf)
1051 #
1052 # If we're using BPF, we need "-lodm" and "-lcfg", as
1053 # we use them to load the BPF module.
1054 #
1055 LIBS="-lodm -lcfg"
1056 ;;
1057 esac
1058 ;;
1059
1060 darwin*)
1061 DYEXT="dylib"
1062 V_CCOPT="$V_CCOPT -fno-common"
1063 ;;
1064
1065 hpux9*)
1066 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1067
1068 #
1069 # Use System V conventions for man pages.
1070 #
1071 MAN_FILE_FORMATS=4
1072 MAN_MISC_INFO=5
1073 ;;
1074
1075 hpux10.0*)
1076
1077 #
1078 # Use System V conventions for man pages.
1079 #
1080 MAN_FILE_FORMATS=4
1081 MAN_MISC_INFO=5
1082 ;;
1083
1084 hpux10.1*)
1085
1086 #
1087 # Use System V conventions for man pages.
1088 #
1089 MAN_FILE_FORMATS=4
1090 MAN_MISC_INFO=5
1091 ;;
1092
1093 hpux*)
1094 dnl HPUX 10.20 and above is similar to HPUX 9, but
1095 dnl not the same....
1096 dnl
1097 dnl XXX - DYEXT should be set to "sl" if this is building
1098 dnl for 32-bit PA-RISC, but should be left as "so" for
1099 dnl 64-bit PA-RISC or, I suspect, IA-64.
1100 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1101 if test "`uname -m`" = "ia64"; then
1102 DYEXT="so"
1103 else
1104 DYEXT="sl"
1105 fi
1106
1107 #
1108 # "-b" builds a shared library; "+h" sets the soname.
1109 #
1110 SHLIB_OPT="-b"
1111 SONAME_OPT="+h"
1112
1113 #
1114 # Use System V conventions for man pages.
1115 #
1116 MAN_FILE_FORMATS=4
1117 MAN_MISC_INFO=5
1118 ;;
1119
1120 irix*)
1121 #
1122 # Use System V conventions for man pages.
1123 #
1124 MAN_FILE_FORMATS=4
1125 MAN_MISC_INFO=5
1126 ;;
1127
1128 linux*|freebsd*|netbsd*|openbsd*|dragonfly*)
1129 DYEXT="so"
1130
1131 #
1132 # Compiler assumed to be GCC; run-time linker may require a -R
1133 # flag.
1134 #
1135 if test "$libdir" != "/usr/lib"; then
1136 V_RFLAGS=-Wl,-R$libdir
1137 fi
1138 ;;
1139
1140 osf*)
1141 DYEXT="so"
1142
1143 #
1144 # Use System V conventions for man pages.
1145 #
1146 MAN_FILE_FORMATS=4
1147 MAN_MISC_INFO=5
1148 ;;
1149
1150 sinix*)
1151 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1152 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1153 AC_TRY_COMPILE(
1154 [],
1155 [int i = sinix;],
1156 ac_cv_cc_sinix_defined=yes,
1157 ac_cv_cc_sinix_defined=no))
1158 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1159 if test $ac_cv_cc_sinix_defined = no ; then
1160 AC_DEFINE(sinix,1,[on sinix])
1161 fi
1162 ;;
1163
1164 solaris*)
1165 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1166
1167 DYEXT="so"
1168 #
1169 # Use System V conventions for man pages.
1170 #
1171 MAN_FILE_FORMATS=4
1172 MAN_MISC_INFO=5
1173 ;;
1174 esac
1175
1176 AC_PROG_RANLIB
1177
1178 AC_LBL_DEVEL(V_CCOPT)
1179
1180 AC_LBL_SOCKADDR_SA_LEN
1181
1182 AC_LBL_SOCKADDR_STORAGE
1183
1184 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1185
1186 AC_LBL_UNALIGNED_ACCESS
1187
1188 #
1189 # Makefile.in includes rules to generate version.h, so we assume
1190 # that it will be generated if autoconf is used.
1191 #
1192 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1193
1194 rm -f net
1195 ln -s ${srcdir}/bpf/net net
1196
1197 AC_SUBST(V_CCOPT)
1198 AC_SUBST(V_DEFS)
1199 AC_SUBST(V_FINDALLDEVS)
1200 AC_SUBST(V_INCLS)
1201 AC_SUBST(V_LEX)
1202 AC_SUBST(V_PCAP)
1203 AC_SUBST(V_SHLIB_CMD)
1204 AC_SUBST(V_SHLIB_OPT)
1205 AC_SUBST(V_SONAME_OPT)
1206 AC_SUBST(V_RPATH_OPT)
1207 AC_SUBST(V_YACC)
1208 AC_SUBST(ADDLOBJS)
1209 AC_SUBST(ADDLARCHIVEOBJS)
1210 AC_SUBST(SSRC)
1211 AC_SUBST(DYEXT)
1212 AC_SUBST(MAN_FILE_FORMATS)
1213 AC_SUBST(MAN_MISC_INFO)
1214
1215 dnl check for USB sniffing support
1216 AC_MSG_CHECKING(for USB sniffing support)
1217 case "$host_os" in
1218 linux*)
1219 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1220 USB_SRC=pcap-usb-linux.c
1221 AC_MSG_RESULT(yes)
1222 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1223 if test $? -ne 0 ; then
1224 ac_usb_dev_name="usbmon"
1225 fi
1226 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1227 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1228 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1229 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1230 #
1231 # OK, does it define bRequestType? Older versions of the kernel
1232 # define fields with names like "requesttype, "request", and
1233 # "value", rather than "bRequestType", "bRequest", and
1234 # "wValue".
1235 #
1236 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1237 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1238 AC_TRY_COMPILE([
1239 AC_INCLUDES_DEFAULT
1240 #ifdef HAVE_SYS_BITYPES_H
1241 #include <sys/bitypes.h>
1242 #endif
1243 # include <linux/usbdevice_fs.h>],
1244 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1245 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1246 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1247 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1248 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1249 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1250 [if struct usbdevfs_ctrltransfer has bRequestType])
1251 fi
1252 fi
1253 ;;
1254 *)
1255 AC_MSG_RESULT(no)
1256 ;;
1257 esac
1258 AC_SUBST(PCAP_SUPPORT_USB)
1259 AC_SUBST(USB_SRC)
1260
1261 AC_ARG_ENABLE([bluetooth],
1262 [AC_HELP_STRING([--enable-bluetooth],[enable bluetooth support @<:@default=yes, if support available@:>@])],
1263 ,enable_bluetooth=yes)
1264
1265 if test "x$enable_bluetooth" != "xno" ; then
1266 dnl check for bluetooth sniffing support
1267 case "$host_os" in
1268 linux*)
1269 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1270 [
1271 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1272 BT_SRC=pcap-bt-linux.c
1273 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1274 ],
1275 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1276 )
1277 ;;
1278 *)
1279 AC_MSG_NOTICE(no Bluetooth sniffing support)
1280 ;;
1281 esac
1282 AC_SUBST(PCAP_SUPPORT_BT)
1283 AC_SUBST(BT_SRC)
1284 fi
1285
1286 AC_PROG_INSTALL
1287
1288 AC_CONFIG_HEADER(config.h)
1289
1290 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1291 pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap
1292 pcap_datalink.3pcap pcap_dump_open.3pcap
1293 pcap_list_datalinks.3pcap pcap_open_dead.3pcap
1294 pcap_open_offline.3pcap)
1295
1296 if test -f .devel ; then
1297 make depend
1298 fi
1299 exit 0