2 dnl Copyright (c) 1994, 1995, 1996, 1997
3 dnl The Regents of the University of California. All rights reserved.
5 dnl Process this file with autoconf to produce a configure script.
11 # http://ftp.gnu.org/gnu/config/README
13 # for the URLs to use to fetch new versions of config.guess and
22 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
24 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
28 if test "$ac_cv___attribute__" = "yes"; then
29 AC_C___ATTRIBUTE___UNUSED
30 AC_C___ATTRIBUTE___FORMAT
33 AC_CHECK_HEADERS(sys/bitypes.h)
35 AC_CHECK_TYPE([int8_t], ,
36 [AC_DEFINE([int8_t], [signed char],
37 [Define to `signed char' if int8_t not defined.])],
39 #ifdef HAVE_SYS_BITYPES_H
40 #include <sys/bitypes.h>
42 AC_CHECK_TYPE([u_int8_t], ,
43 [AC_DEFINE([u_int8_t], [unsigned char],
44 [Define to `unsigned char' if u_int8_t not defined.])],
46 #ifdef HAVE_SYS_BITYPES_H
47 #include <sys/bitypes.h>
49 AC_CHECK_TYPE([int16_t], ,
50 [AC_DEFINE([int16_t], [short],
51 [Define to `short' if int16_t not defined.])]
53 #ifdef HAVE_SYS_BITYPES_H
54 #include <sys/bitypes.h>
56 AC_CHECK_TYPE([u_int16_t], ,
57 [AC_DEFINE([u_int16_t], [unsigned short],
58 [Define to `unsigned short' if u_int16_t not defined.])],
60 #ifdef HAVE_SYS_BITYPES_H
61 #include <sys/bitypes.h>
63 AC_CHECK_TYPE([int32_t], ,
64 [AC_DEFINE([int32_t], [int],
65 [Define to `int' if int32_t not defined.])],
67 #ifdef HAVE_SYS_BITYPES_H
68 #include <sys/bitypes.h>
70 AC_CHECK_TYPE([u_int32_t], ,
71 [AC_DEFINE([u_int32_t], [unsigned int],
72 [Define to `unsigned int' if u_int32_t not defined.])],
74 #ifdef HAVE_SYS_BITYPES_H
75 #include <sys/bitypes.h>
77 AC_CHECK_TYPE([int64_t], ,
78 [AC_DEFINE([int64_t], [long long],
79 [Define to `long long' if int64_t not defined.])],
81 #ifdef HAVE_SYS_BITYPES_H
82 #include <sys/bitypes.h>
84 AC_CHECK_TYPE([u_int64_t], ,
85 [AC_DEFINE([u_int64_t], [unsigned long long],
86 [Define to `unsigned long long' if u_int64_t not defined.])],
88 #ifdef HAVE_SYS_BITYPES_H
89 #include <sys/bitypes.h>
93 # Try to arrange for large file support.
99 dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
100 dnl include <sys/ioccom.h>, and we were to drop support for older
101 dnl releases without that fix, so that pcap-bpf.c doesn't need to
102 dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
103 dnl in "aclocal.m4" uses it, so we would still have to test for it
104 dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
105 dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
107 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h limits.h paths.h)
108 AC_CHECK_HEADERS(linux/types.h)
109 AC_CHECK_HEADERS(linux/if_packet.h netpacket/packet.h netpacket/if_packet.h)
110 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
111 #include <sys/socket.h>
112 #include <net/if.h>])
113 if test "$ac_cv_header_net_pfvar_h" = yes; then
115 # Check for various PF actions.
117 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
119 [#include <sys/types.h>
120 #include <sys/socket.h>
122 #include <net/pfvar.h>],
123 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
126 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
127 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
131 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
132 #include <sys/socket.h>])
133 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
135 # The simple test didn't work.
136 # Do we need to include <net/if.h> first?
137 # Unset ac_cv_header_netinet_if_ether_h so we don't
138 # treat the previous failure as a cached value and
139 # suppress the next test.
141 AC_MSG_NOTICE([Rechecking with some additional includes])
142 unset ac_cv_header_netinet_if_ether_h
143 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
144 #include <sys/socket.h>
145 #include <netinet/in.h>
148 #include <net/if.h>])
153 AC_CHECK_FUNCS(strerror strlcpy)
156 AC_CHECK_FUNCS(vsnprintf snprintf,,
158 if test $needsnprintf = yes; then
159 AC_LIBOBJ([snprintf])
163 # Do this before checking for ether_hostton(), as it's a
164 # "gethostbyname() -ish function".
169 # You are in a twisty little maze of UN*Xes, all different.
170 # Some might not have ether_hostton().
171 # Some might have it, but not declare it in any header file.
172 # Some might have it, but declare it in <netinet/if_ether.h>.
173 # Some might have it, but declare it in <netinet/ether.h>
174 # (And some might have it but document it as something declared in
175 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
177 # Before you is a C compiler.
179 AC_CHECK_FUNCS(ether_hostton)
180 if test "$ac_cv_func_ether_hostton" = yes; then
182 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
184 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
186 # Yes. Does it declare ether_hostton()?
188 AC_CHECK_DECL(ether_hostton,
190 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
191 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
194 #include <sys/types.h>
195 #include <sys/socket.h>
196 #include <netinet/in.h>
197 #include <arpa/inet.h>
201 #include <netinet/if_ether.h>
207 if test "$ac_cv_have_decl_ether_hostton" != yes; then
209 # No, how about <netinet/ether.h>, as on Linux?
211 AC_CHECK_HEADERS(netinet/ether.h)
212 if test "$ac_cv_header_netinet_ether_h" = yes; then
214 # We have it - does it declare ether_hostton()?
215 # Unset ac_cv_have_decl_ether_hostton so we don't
216 # treat the previous failure as a cached value and
217 # suppress the next test.
219 unset ac_cv_have_decl_ether_hostton
220 AC_CHECK_DECL(ether_hostton,
222 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
223 [Define to 1 if netinet/ether.h declares `ether_hostton'])
226 #include <netinet/ether.h>
231 # Is ether_hostton() declared?
233 if test "$ac_cv_have_decl_ether_hostton" != yes; then
235 # No, we'll have to declare it ourselves.
236 # Do we have "struct ether_addr"?
238 AC_CHECK_TYPES(struct ether_addr,,,
240 #include <sys/types.h>
241 #include <sys/socket.h>
242 #include <netinet/in.h>
243 #include <arpa/inet.h>
247 #include <netinet/if_ether.h>
249 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
250 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
253 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
254 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
259 dnl to pacify those who hate protochain insn
260 AC_MSG_CHECKING(if --disable-protochain option is specified)
261 AC_ARG_ENABLE(protochain,
262 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
263 case "x$enable_protochain" in
264 xyes) enable_protochain=enabled ;;
265 xno) enable_protochain=disabled ;;
266 x) enable_protochain=enabled ;;
269 if test "$enable_protochain" = "disabled"; then
270 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
272 AC_MSG_RESULT(${enable_protochain})
275 # SITA support is mutually exclusive with native capture support;
276 # "--with-sita" selects SITA support.
279 AC_HELP_STRING([--with-sita],[include SITA support]),
281 if test ! "x$withval" = "xno" ; then
282 AC_DEFINE(SITA,1,[include ACN support])
283 AC_MSG_NOTICE(Enabling SITA ACN support)
290 dnl Not all versions of test support -c (character special) but it's a
291 dnl better way of testing since the device might be protected. So we
292 dnl check in our normal order using -r and then check the for the /dev
293 dnl guys again using -c.
295 dnl XXX This could be done for cross-compiling, but for now it's not.
297 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
298 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
301 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
302 AC_MSG_CHECKING(packet capture type)
303 if test ! -z "$with_pcap" ; then
305 elif test -r /dev/bpf -o -h /dev/bpf ; then
307 # Cloning BPF device.
310 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
311 elif test -r /dev/bpf0 ; then
313 elif test -r /usr/include/net/pfilt.h ; then
315 elif test -r /dev/enet ; then
317 elif test -r /dev/nit ; then
319 elif test -r /usr/include/sys/net/nit.h ; then
321 elif test -r /usr/include/linux/socket.h ; then
323 elif test -r /usr/include/net/raw.h ; then
325 elif test -r /usr/include/odmi.h ; then
327 # On AIX, the BPF devices might not yet be present - they're
328 # created the first time libpcap runs after booting.
329 # We check for odmi.h instead.
332 elif test -c /dev/bpf0 ; then # check again in case not readable
334 elif test -r /usr/include/sys/dlpi.h ; then
336 elif test -c /dev/enet ; then # check again in case not readable
338 elif test -c /dev/nit ; then # check again in case not readable
343 AC_MSG_RESULT($V_PCAP)
346 # Do capture-mechanism-dependent tests.
351 # Needed for common functions used by pcap-[dlpi,libdlpi].c
356 # Checks for some header files.
358 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
361 # Checks to see if Solaris has the public libdlpi(3LIB) library.
362 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
363 # public libdlpi(3LIB) version. Before libdlpi was made public, a
364 # private version also existed, which did not have the same APIs.
365 # Due to a gcc bug, the default search path for 32-bit libraries does
366 # not include /lib, we add it explicitly here.
367 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
368 # Also, due to the bug above applications that link to libpcap with
369 # libdlpi will have to add "-L/lib" option to "configure".
371 saved_ldflags=$LDFLAGS
372 LDFLAGS="$LIBS -L/lib"
373 AC_CHECK_LIB(dlpi, dlpi_walk,
377 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
380 LDFLAGS=$saved_ldflags
383 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
386 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
387 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
390 #include <sys/types.h>
391 #include <sys/time.h>
392 #include <sys/dlpi.h>
394 [int i = DL_PROMISC_PHYS;],
395 ac_cv_sys_dlpi_usable=yes,
396 ac_cv_sys_dlpi_usable=no))
397 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
398 if test $ac_cv_sys_dlpi_usable = no ; then
399 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
403 # Check whether we have a /dev/dlpi device or have multiple devices.
405 AC_MSG_CHECKING(for /dev/dlpi device)
406 if test -c /dev/dlpi ; then
408 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
412 AC_MSG_CHECKING(for $dir directory)
413 if test -d $dir ; then
415 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
422 # This check is for Solaris with DLPI support for passive modes.
423 # See dlpi(7P) for more details.
425 AC_LBL_DL_PASSIVE_REQ_T
430 # Do we have the wireless extensions?
432 AC_CHECK_HEADERS(linux/wireless.h, [], [],
434 #include <sys/socket.h>
435 #include <linux/if.h>
436 #include <linux/types.h>
443 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
444 with_libnl=$withval,,)
446 if test x$with_libnl != xno ; then
449 incdir=-I/usr/include/libnl3
451 if test x$withval != x ; then
452 libnldir=-L${withval}/lib/.libs
453 incdir=-I${withval}/include
457 # Try libnl 3.x first.
459 AC_CHECK_LIB(nl-3, nl_socket_alloc,
462 # Yes, we have libnl 3.x.
464 LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
465 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
466 AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
467 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
468 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
469 V_INCLS="$V_INCLS ${incdir}"
471 ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
473 if test x$have_any_nl = xno ; then
477 AC_CHECK_LIB(nl, nl_socket_alloc,
480 # Yes, we have libnl 2.x.
482 LIBS="${libnldir} -lnl-genl -lnl $LIBS"
483 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
484 AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
485 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
486 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
491 if test x$have_any_nl = xno ; then
493 # No, we don't; do we have libnl 1.x?
495 AC_CHECK_LIB(nl, nl_handle_alloc,
500 LIBS="${libnldir} -lnl $LIBS"
501 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
506 if test x$have_any_nl = xno ; then
508 # No, we don't have libnl at all.
510 if test x$with_libnl = xyes ; then
511 AC_MSG_ERROR([libnl support requested but libnl not found])
516 AC_CHECK_HEADERS(linux/ethtool.h,,,
519 #include <linux/types.h>
522 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
527 # Check whether we have the *BSD-style ioctls.
529 AC_CHECK_HEADERS(net/if_media.h)
531 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
533 [#include <sys/socket.h>
534 #include <sys/ioctl.h>
536 #include <net/bpf.h>],
537 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
540 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
541 [define if the system supports zerocopy BPF])
546 # Check whether we have struct BPF_TIMEVAL.
548 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
550 #include <sys/types.h>
551 #include <sys/ioctl.h>
552 #ifdef HAVE_SYS_IOCCOM_H
553 #include <sys/ioccom.h>
560 V_DEFS="$V_DEFS -DDAG_ONLY"
564 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
568 V_DEFS="$V_DEFS -DSNF_ONLY"
572 AC_MSG_WARN(cannot determine packet capture interface)
573 AC_MSG_WARN((see the INSTALL doc for more info))
578 dnl Now figure out how we get a list of interfaces and addresses,
579 dnl if we support capturing. Don't bother if we don't support
582 if test "$V_PCAP" = null
585 # We can't capture, so we can't open any capture
586 # devices, so we won't return any interfaces.
590 AC_CHECK_FUNC(getifaddrs,[
592 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
593 # as well, just in case some platform is really weird.
595 AC_CHECK_HEADER(ifaddrs.h,[
597 # We have the header, so we use "getifaddrs()" to
598 # get the list of interfaces.
603 # We don't have the header - give up.
604 # XXX - we could also fall back on some other
605 # mechanism, but, for now, this'll catch this
606 # problem so that we can at least try to figure
607 # out something to do on systems with "getifaddrs()"
608 # but without "ifaddrs.h", if there is something
609 # we can do on those systems.
611 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
615 # Well, we don't have "getifaddrs()", so we have to use
616 # some other mechanism; determine what that mechanism is.
618 # The first thing we use is the type of capture mechanism,
619 # which is somewhat of a proxy for the OS we're using.
625 # This might be Solaris 8 or later, with
626 # SIOCGLIFCONF, or it might be some other OS
627 # or some older version of Solaris, with
630 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
631 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
633 [#include <sys/param.h>
634 #include <sys/file.h>
635 #include <sys/ioctl.h>
636 #include <sys/socket.h>
637 #include <sys/sockio.h>],
638 [ioctl(0, SIOCGLIFCONF, (char *)0);],
639 ac_cv_lbl_have_siocglifconf=yes,
640 ac_cv_lbl_have_siocglifconf=no))
641 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
642 if test $ac_cv_lbl_have_siocglifconf = yes ; then
651 # Assume we just have SIOCGIFCONF.
652 # (XXX - on at least later Linux kernels, there's
653 # another mechanism, and we should be using that
662 AC_MSG_CHECKING(for socklen_t)
664 #include <sys/types.h>
665 #include <sys/socket.h>
670 if test "x$have_socklen_t" = "xyes"; then
671 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
673 AC_MSG_RESULT($have_socklen_t)
676 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
678 [enable_ipv6=ifavailable])
679 if test "$enable_ipv6" != "no"; then
680 AC_CHECK_FUNC(getaddrinfo,
682 AC_DEFINE(INET6,1,[IPv6])
685 if test "$enable_ipv6" != "ifavailable"; then
686 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
691 AC_MSG_CHECKING(whether to build optimizer debugging code)
692 AC_ARG_ENABLE(optimizer-dbg,
693 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
694 if test "$enable_optimizer_dbg" = "yes"; then
695 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
697 AC_MSG_RESULT(${enable_optimizer_dbg-no})
699 AC_MSG_CHECKING(whether to build parser debugging code)
700 AC_ARG_ENABLE(yydebug,
701 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
702 if test "$enable_yydebug" = "yes"; then
703 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
705 AC_MSG_RESULT(${enable_yydebug-no})
707 # Check for Endace DAG card support.
709 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
711 if test "$withval" = no
713 # User doesn't want DAG support.
715 elif test "$withval" = yes
717 # User wants DAG support but hasn't specified a directory.
720 # User wants DAG support and has specified a directory, so use the provided value.
726 # Use DAG API if present, otherwise don't
731 AC_ARG_WITH([dag-includes],
732 AC_HELP_STRING([--with-dag-includes=DIR],[Endace DAG include directory]),
734 # User wants DAG support and has specified a header directory, so use the provided value.
736 dag_include_dir=$withval
739 AC_ARG_WITH([dag-libraries],
740 AC_HELP_STRING([--with-dag-libraries=DIR],[Endace DAG library directory]),
742 # User wants DAG support and has specified a library directory, so use the provided value.
750 # We support the DAG API if we're on Linux or BSD, or if we're
751 # building a DAG-only libpcap.
756 # If the user explicitly requested DAG, tell them it's not
759 # If they expressed no preference, don't include it.
761 if test $want_dag = yes; then
762 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
763 elif test $want_dag = yes; then
770 if test "$want_dag" != no; then
772 AC_MSG_CHECKING([whether we have DAG API headers])
774 # If necessary, set default paths for DAG API headers and libraries.
775 if test -z "$dag_root"; then
779 if test -z "$dag_include_dir"; then
780 dag_include_dir="$dag_root/include"
783 if test -z "$dag_lib_dir"; then
784 dag_lib_dir="$dag_root/lib"
787 if test -z "$dag_tools_dir"; then
788 dag_tools_dir="$dag_root/tools"
791 if test -r $dag_include_dir/dagapi.h; then
792 ac_cv_lbl_dag_api=yes
794 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
797 if test $ac_cv_lbl_dag_api = yes; then
798 V_INCLS="$V_INCLS -I$dag_include_dir"
800 if test $V_PCAP != dag ; then
804 # See if we can find a general version string.
805 # Don't need to save and restore LIBS to prevent -ldag being
806 # included if there's a found-action (arg 3).
807 saved_ldflags=$LDFLAGS
808 LDFLAGS="-L$dag_lib_dir"
809 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
810 AC_CHECK_LIB([dag],[dag_get_erf_types], [
811 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
812 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
813 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
815 LDFLAGS=$saved_ldflags
817 if test "$dag_streams" = 1; then
818 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
820 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
822 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
823 if test "$ac_dag_have_vdag" = 1; then
824 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
825 LIBS="$LIBS -lpthread"
829 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
832 AC_MSG_CHECKING(whether we have the DAG API)
834 if test $ac_cv_lbl_dag_api = no; then
836 if test "$want_dag" = yes; then
837 # User wanted DAG support but we couldn't find it.
838 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
841 if test "$V_PCAP" = dag; then
842 # User requested "dag" capture type but the DAG API wasn't
844 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.)])
851 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, on Linux, if present@:>@]),
853 if test "$withval" = no
856 elif test "$withval" = yes
866 # Use Septel API if present, otherwise don't
868 want_septel=ifpresent
869 septel_root=./../septel
871 ac_cv_lbl_septel_api=no
875 # We support the Septel API if we're on Linux, or if we're building
876 # a Septel-only libpcap.
881 # If the user explicitly requested Septel, tell them it's not
884 # If they expressed no preference, don't include it.
886 if test $want_septel = yes; then
887 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
888 elif test $want_septel = yes; then
894 if test "$with_septel" != no; then
895 AC_MSG_CHECKING(whether we have Septel API)
897 if test -z "$septel_root"; then
898 septel_root=$srcdir/../septel
901 septel_tools_dir="$septel_root"
902 septel_include_dir="$septel_root/INC"
904 ac_cv_lbl_septel_api=no
905 if test -r "$septel_include_dir/msg.h"; then
906 V_INCLS="$V_INCLS -I$septel_include_dir"
907 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"
908 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"
910 if test "$V_PCAP" != septel ; then
913 ac_cv_lbl_septel_api=yes
916 AC_MSG_RESULT($ac_cv_lbl_septel_api)
917 if test $ac_cv_lbl_septel_api = no; then
918 if test "$want_septel" = yes; then
919 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
922 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
926 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
927 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
930 # Check for Myricom SNF support.
932 AC_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
934 if test "$withval" = no
936 # User explicitly doesn't want SNF
938 elif test "$withval" = yes
940 # User wants SNF support but hasn't specific a directory.
943 # User wants SNF support with a specified directory.
949 # Use Sniffer API if present, otherwise don't
954 AC_ARG_WITH([snf-includes],
955 AC_HELP_STRING([--with-snf-includes=DIR],[Myricom SNF include directory]),
957 # User wants SNF with specific header directory
959 snf_include_dir=$withval
962 AC_ARG_WITH([snf-libraries],
963 AC_HELP_STRING([--with-snf-libraries=DIR],[Myricom SNF library directory]),
965 # User wants SNF with specific lib directory
973 # We support the Sniffer API if we're on BSD, Linux, or if we're
974 # building a Sniffer-only libpcap.
979 # If the user explicitly requested Sniffer, tell them it's not
982 # If they expressed no preference, don't include it.
984 if test $want_snf = yes; then
985 AC_MSG_ERROR(Myricom SNF support only available with 'bpf' 'linux' and 'snf' packet capture types)
986 elif test $want_snf = yes; then
993 if test "$with_snf" != no; then
995 AC_MSG_CHECKING(whether we have Myricom Sniffer API)
997 if test -z "$snf_root"; then
1001 if test -z "$snf_include_dir"; then
1002 snf_include_dir="$snf_root/include"
1005 if test -z "$snf_lib_dir"; then
1006 snf_lib_dir="$snf_root/lib"
1009 if test -f "$snf_include_dir/snf.h"; then
1010 ac_cv_lbl_snf_api=yes
1012 AC_MSG_RESULT([$ac_cv_lbl_snf_api ($snf_root)])
1014 if test $ac_cv_lbl_snf_api = no; then
1015 if test "$want_snf" = yes; then
1016 AC_MSG_ERROR(SNF API headers not found under $snf_include_dir; use --without-snf)
1019 saved_ldflags=$LDFLAGS
1020 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1021 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"], [ac_cv_lbl_snf_api="no"])
1022 LDFLAGS="$saved_ldflags"
1024 if test $ac_cv_lbl_snf_api = no; then
1025 if test "$want_snf" = yes; then
1026 AC_MSG_ERROR(SNF API cannot correctly be linked check config.log; use --without-snf)
1029 V_INCLS="$V_INCLS -I$snf_include_dir"
1031 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1032 if test "$V_PCAP" != snf ; then
1035 AC_DEFINE(HAVE_SNF_API, 1, [define if you have Myricom SNF API])
1040 if test "$V_PCAP" = snf -a "$ac_cv_lbl_snf_api" = no; then
1041 AC_MSG_ERROR(Specifying the capture type as 'snf' requires the Myricom Sniffer API to be present; use --with-snf=DIR)
1044 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
1045 if test "$V_LEX" = lex ; then
1046 # Some versions of lex can't handle the definitions section of scanner.l .
1047 # Try lexing it and complain if it can't deal.
1048 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1049 if lex -t scanner.l > /dev/null 2>&1; then
1050 tcpdump_cv_capable_lex=yes
1052 tcpdump_cv_capable_lex=insufficient
1054 if test $tcpdump_cv_capable_lex = insufficient ; then
1055 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
1056 libpcap. flex is a lex replacement that has many advantages, including
1057 being able to compile libpcap. For more information, see
1058 http://www.gnu.org/software/flex/flex.html .])
1063 # Assume, by default, no support for shared libraries and V7/BSD convention
1064 # for man pages (file formats in section 5, miscellaneous info in section 7).
1065 # Individual cases can override this.
1073 dnl Workaround to enable certain features
1074 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1077 # AIX makes it fun to build shared and static libraries,
1078 # because they're *both* ".a" archive libraries. We
1079 # build the static library for the benefit of the traditional
1080 # scheme of building libpcap and tcpdump in subdirectories of
1081 # the same directory, with tcpdump statically linked with the
1082 # libpcap in question, but we also build a shared library as
1083 # "libpcap.shareda" and install *it*, rather than the static
1084 # library, as "libpcap.a".
1092 # If we're using DLPI, applications will need to
1093 # use /lib/pse.exp if present, as we use the
1096 pseexe="/lib/pse.exp"
1097 AC_MSG_CHECKING(for $pseexe)
1098 if test -f $pseexe ; then
1106 # If we're using BPF, we need "-lodm" and "-lcfg", as
1107 # we use them to load the BPF module.
1116 V_CCOPT="$V_CCOPT -fno-common"
1117 AC_ARG_ENABLE(universal,
1118 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
1119 if test "$enable_universal" != "no"; then
1124 # Pre-Tiger. Build only for 32-bit PowerPC; no
1125 # need for any special compiler or linker flags.
1131 # Tiger, prior to Intel support. Build for 32-bit
1132 # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
1133 # first. (I'm guessing that's what Apple does.)
1135 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64"
1136 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64"
1141 # Tiger, subsequent to Intel support but prior to
1142 # x86-64 support. Build for 32-bit PowerPC, 64-bit
1143 # PowerPC, and x86, with 32-bit PowerPC first.
1144 # (I'm guessing that's what Apple does.)
1146 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386"
1147 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386"
1152 # All other Tiger, so subsequent to x86-64
1153 # support. Build for 32-bit PowerPC, 64-bit
1154 # PowerPC, x86, and x86-64, and with 32-bit PowerPC
1155 # first. (I'm guessing that's what Apple does.)
1157 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1158 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1163 # Leopard. Build for 32-bit PowerPC, 64-bit
1164 # PowerPC, x86, and x86-64, with 32-bit PowerPC
1165 # first. (That's what Apple does.)
1167 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1168 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1173 # Snow Leopard. Build for x86-64, x86, and
1174 # 32-bit PowerPC, with x86-64 first. (That's
1175 # what Apple does, even though Snow Leopard
1176 # doesn't run on PPC, so PPC libpcap runs under
1177 # Rosetta, and Rosetta doesn't support BPF
1178 # ioctls, so PPC programs can't do live
1181 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
1182 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
1187 # Post-Snow Leopard. Build for x86-64 and
1188 # x86, with x86-64 first. (That's probably what
1189 # Apple does, given that Rosetta is gone.)
1190 # XXX - update if and when Apple drops support
1191 # for 32-bit x86 code.
1193 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
1194 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
1201 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1204 # Use System V conventions for man pages.
1213 # Use System V conventions for man pages.
1222 # Use System V conventions for man pages.
1229 dnl HPUX 10.20 and above is similar to HPUX 9, but
1230 dnl not the same....
1232 dnl XXX - DYEXT should be set to "sl" if this is building
1233 dnl for 32-bit PA-RISC, but should be left as "so" for
1234 dnl 64-bit PA-RISC or, I suspect, IA-64.
1235 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1236 if test "`uname -m`" = "ia64"; then
1243 # "-b" builds a shared library; "+h" sets the soname.
1249 # Use System V conventions for man pages.
1257 # Use System V conventions for man pages.
1263 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*)
1267 # Compiler assumed to be GCC; run-time linker may require a -R
1270 if test "$libdir" != "/usr/lib"; then
1271 V_RFLAGS=-Wl,-R$libdir
1279 # Use System V conventions for man pages.
1286 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1287 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1291 ac_cv_cc_sinix_defined=yes,
1292 ac_cv_cc_sinix_defined=no))
1293 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1294 if test $ac_cv_cc_sinix_defined = no ; then
1295 AC_DEFINE(sinix,1,[on sinix])
1300 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1304 # Use System V conventions for man pages.
1311 AC_ARG_ENABLE(shared,
1312 AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
1313 test "x$enable_shared" = "xno" && DYEXT="none"
1316 AC_CHECK_TOOL([AR], [ar])
1321 AC_LBL_DEVEL(V_CCOPT)
1323 AC_LBL_SOCKADDR_SA_LEN
1325 AC_LBL_SOCKADDR_STORAGE
1327 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1329 AC_LBL_UNALIGNED_ACCESS
1332 # Makefile.in includes rules to generate version.h, so we assume
1333 # that it will be generated if autoconf is used.
1335 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1338 ln -s ${srcdir}/bpf/net net
1342 AC_SUBST(V_FINDALLDEVS)
1346 AC_SUBST(V_SHLIB_CMD)
1347 AC_SUBST(V_SHLIB_OPT)
1348 AC_SUBST(V_SONAME_OPT)
1349 AC_SUBST(V_RPATH_OPT)
1352 AC_SUBST(ADDLARCHIVEOBJS)
1355 AC_SUBST(MAN_FILE_FORMATS)
1356 AC_SUBST(MAN_MISC_INFO)
1358 AC_ARG_ENABLE([usb],
1359 [AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
1363 if test "x$enable_usb" != "xno" ; then
1364 dnl check for USB sniffing support
1365 AC_MSG_CHECKING(for USB sniffing support)
1368 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1369 USB_SRC=pcap-usb-linux.c
1371 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1372 if test $? -ne 0 ; then
1373 ac_usb_dev_name="usbmon"
1375 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1376 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1378 # Do we have a version of <linux/compiler.h> available?
1379 # If so, we might need it for <linux/usbdevice_fs.h>.
1381 AC_CHECK_HEADERS(linux/compiler.h)
1382 if test "$ac_cv_header_linux_compiler_h" = yes; then
1384 # Yes - include it when testing for <linux/usbdevice_fs.h>.
1386 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
1388 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1390 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1392 # OK, does it define bRequestType? Older versions of the kernel
1393 # define fields with names like "requesttype, "request", and
1394 # "value", rather than "bRequestType", "bRequest", and
1397 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1398 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1401 #ifdef HAVE_SYS_BITYPES_H
1402 #include <sys/bitypes.h>
1404 #ifdef HAVE_LINUX_COMPILER_H
1405 #include <linux/compiler.h>
1407 #include <linux/usbdevice_fs.h>],
1408 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1409 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1410 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1411 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1412 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1413 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1414 [if struct usbdevfs_ctrltransfer has bRequestType])
1423 AC_SUBST(PCAP_SUPPORT_USB)
1426 dnl check for netfilter sniffing support
1427 AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
1432 # Life's too short to deal with trying to get this to compile
1433 # if you don't get the right types defined with
1434 # __KERNEL_STRICT_NAMES getting defined by some other include.
1436 # Check whether the includes Just Work. If not, don't turn on
1437 # netfilter support.
1439 AC_MSG_CHECKING(whether we can compile the netfilter support)
1440 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
1443 #include <sys/socket.h>
1444 #include <netinet/in.h>
1445 #include <linux/types.h>
1447 #include <linux/netlink.h>
1448 #include <linux/netfilter.h>
1449 #include <linux/netfilter/nfnetlink.h>
1450 #include <linux/netfilter/nfnetlink_log.h>
1451 #include <linux/netfilter/nfnetlink_queue.h>],
1453 ac_cv_netfilter_can_compile=yes,
1454 ac_cv_netfilter_can_compile=no))
1455 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
1456 if test $ac_cv_netfilter_can_compile = yes ; then
1457 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
1458 [target host supports netfilter sniffing])
1459 NETFILTER_SRC=pcap-netfilter-linux.c
1466 AC_SUBST(PCAP_SUPPORT_NETFILTER)
1467 AC_SUBST(NETFILTER_SRC)
1469 AC_ARG_ENABLE([bluetooth],
1470 [AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
1472 [enable_bluetooth=ifsupportavailable])
1474 if test "x$enable_bluetooth" != "xno" ; then
1475 dnl check for Bluetooth sniffing support
1478 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1480 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1481 BT_SRC=pcap-bt-linux.c
1482 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1485 # OK, does struct sockaddr_hci have an hci_channel
1488 AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
1489 AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
1492 #include <bluetooth/bluetooth.h>
1493 #include <bluetooth/hci.h>
1495 [u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
1496 ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
1497 ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
1498 AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
1499 if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
1500 AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
1501 [if struct sockaddr_hci has hci_channel member])
1504 # OK, is HCI_CHANNEL_MONITOR defined?
1506 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
1507 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
1510 #include <bluetooth/bluetooth.h>
1511 #include <bluetooth/hci.h>
1513 [u_int i = HCI_CHANNEL_MONITOR],
1514 ac_cv_lbl_hci_channel_monitor_is_defined=yes,
1515 ac_cv_lbl_hci_channel_monitor_is_defined=no))
1516 AC_MSG_RESULT($ac_cv_lbl_hci_channel_monitor_is_defined)
1517 if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then
1518 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
1519 [target host supports Bluetooth Monitor])
1520 BT_MONITOR_SRC=pcap-bt-monitor-linux.c
1523 ac_lbl_bluetooth_available=yes
1525 ac_lbl_bluetooth_available=no
1527 if test "x$ac_lbl_bluetooth_available" == "xno" ; then
1528 if test "x$enable_bluetooth" = "xyes" ; then
1529 AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1531 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1536 if test "x$enable_bluetooth" = "xyes" ; then
1537 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
1539 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
1543 AC_SUBST(PCAP_SUPPORT_BT)
1545 AC_SUBST(BT_MONITOR_SRC)
1548 AC_ARG_ENABLE([canusb],
1549 [AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
1551 [enable_canusb=ifsupportavailable])
1553 if test "x$enable_canusb" != "xno" ; then
1554 dnl check for canusb support
1557 AC_CHECK_HEADER(libusb-1.0/libusb.h,
1559 AC_CHECK_LIB(usb-1.0, libusb_init,
1561 AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
1562 CANUSB_SRC=pcap-canusb-linux.c
1563 LIBS="-lusb-1.0 -lpthread $LIBS"
1564 ac_lbl_has_libusb=yes
1566 ac_lbl_has_libusb=no,
1570 ac_lbl_has_libusb=no
1572 if test "x$ac_lbl_has_libusb" = "xyes" ; then
1573 AC_MSG_NOTICE(canusb sniffing is supported)
1575 if test "x$enable_canusb" = "xyes" ; then
1576 AC_MSG_ERROR(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1578 AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1583 if test "x$enable_canusb" = "xyes" ; then
1584 AC_MSG_ERROR(no canusb support implemented for $host_os)
1586 AC_MSG_NOTICE(no canusb support implemented for $host_os)
1590 AC_SUBST(PCAP_SUPPORT_CANUSB)
1591 AC_SUBST(CANUSB_SRC)
1594 AC_ARG_ENABLE([can],
1595 [AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
1597 [enable_can=ifsupportavailable])
1599 if test "x$enable_can" != "xno" ; then
1600 dnl check for CAN sniffing support
1603 AC_CHECK_HEADER(linux/can.h,
1605 AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
1606 CAN_SRC=pcap-can-linux.c
1607 AC_MSG_NOTICE(CAN sniffing is supported)
1610 if test "x$enable_can" = "xyes" ; then
1611 AC_MSG_ERROR(CAN sniffing is not supported)
1613 AC_MSG_NOTICE(CAN sniffing is not supported)
1616 [#include <sys/socket.h>]
1620 if test "x$enable_can" = "xyes" ; then
1621 AC_MSG_ERROR(no CAN sniffing support implemented for $host_os)
1623 AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
1627 AC_SUBST(PCAP_SUPPORT_CAN)
1631 AC_ARG_ENABLE([dbus],
1632 [AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
1634 [enable_dbus=ifavailable])
1636 if test "x$enable_dbus" != "xno"; then
1637 if test "x$enable_dbus" = "xyes"; then
1642 # We don't support D-Bus sniffing on OS X; see
1644 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1646 # The user requested it, so fail.
1648 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
1655 # We don't support D-Bus sniffing on OS X; see
1657 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1659 # The user dind't explicitly request it, so just
1660 # silently refuse to enable it.
1668 if test "x$enable_dbus" != "xno"; then
1669 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
1670 if test "x$PKGCONFIG" != "xno"; then
1671 AC_MSG_CHECKING([for D-Bus])
1672 if "$PKGCONFIG" dbus-1; then
1673 AC_MSG_RESULT([yes])
1674 DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
1675 DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
1676 save_CFLAGS="$CFLAGS"
1678 CFLAGS="$CFLAGS $DBUS_CFLAGS"
1679 LIBS="$LIBS $DBUS_LIBS"
1680 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
1682 [#include <string.h>
1685 #include <sys/time.h>
1687 #include <dbus/dbus.h>],
1688 [return dbus_connection_read_write(NULL, 0);],
1690 AC_MSG_RESULT([yes])
1691 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
1692 DBUS_SRC=pcap-dbus.c
1693 V_INCLS="$V_INCLS $DBUS_CFLAGS"
1697 if test "x$enable_dbus" = "xyes"; then
1698 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
1702 CFLAGS="$save_CFLAGS"
1705 if test "x$enable_dbus" = "xyes"; then
1706 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
1710 AC_SUBST(PCAP_SUPPORT_DBUS)
1714 dnl check for hardware timestamp support
1717 AC_CHECK_HEADERS([linux/net_tstamp.h])
1720 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1724 dnl The packet ring capture facility of Linux, described in
1725 dnl Documentation/networking/packet_mmap.txt, is not 32/64-bit compatible before
1726 dnl version 2.6.27. A 32-bit kernel requires a 32-bit userland, and likewise for
1727 dnl 64-bit. The effect of this is that a 32-bit libpcap binary will not run
1728 dnl correctly on a 64-bit kernel (the binary will use the wrong offsets into a
1729 dnl kernel struct). This problem was solved in Linux 2.6.27. Use
1730 dnl --disable-packet-ring whenever a 32-bit application must run on a 64-bit
1731 dnl target host, and either the build host or the target host run Linux 2.6.26
1733 AC_ARG_ENABLE([packet-ring],
1734 [AC_HELP_STRING([--enable-packet-ring],[enable Linux packet ring support @<:@default=yes@:>@])],
1735 ,enable_packet_ring=yes)
1737 if test "x$enable_packet_ring" != "xno" ; then
1738 AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use Linux packet ring capture if available])
1739 AC_SUBST(PCAP_SUPPORT_PACKET_RING)
1744 AC_CONFIG_HEADER(config.h)
1746 AC_OUTPUT_COMMANDS([if test -f .devel; then
1747 echo timestamp > stamp-h
1748 cat Makefile-devel-adds >> Makefile
1751 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1752 pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
1753 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
1754 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
1755 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
1756 pcap_open_offline.3pcap pcap_set_tstamp_precision.3pcap
1757 pcap_set_tstamp_type.3pcap)