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_HEADERS(linux/sockios.h linux/if_bonding.h,,,
155 #include <sys/socket.h>
156 #include <linux/if.h>
163 AC_CHECK_FUNCS(strerror strlcpy)
166 AC_CHECK_FUNCS(vsnprintf snprintf,,
168 if test $needsnprintf = yes; then
169 AC_LIBOBJ([snprintf])
173 # Do this before checking for ether_hostton(), as it's a
174 # "gethostbyname() -ish function".
179 # You are in a twisty little maze of UN*Xes, all different.
180 # Some might not have ether_hostton().
181 # Some might have it, but not declare it in any header file.
182 # Some might have it, but declare it in <netinet/if_ether.h>.
183 # Some might have it, but declare it in <netinet/ether.h>
184 # (And some might have it but document it as something declared in
185 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
187 # Before you is a C compiler.
189 AC_CHECK_FUNCS(ether_hostton)
190 if test "$ac_cv_func_ether_hostton" = yes; then
192 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
194 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
196 # Yes. Does it declare ether_hostton()?
198 AC_CHECK_DECL(ether_hostton,
200 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
201 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
204 #include <sys/types.h>
205 #include <sys/socket.h>
206 #include <netinet/in.h>
207 #include <arpa/inet.h>
211 #include <netinet/if_ether.h>
217 if test "$ac_cv_have_decl_ether_hostton" != yes; then
219 # No, how about <netinet/ether.h>, as on Linux?
221 AC_CHECK_HEADERS(netinet/ether.h)
222 if test "$ac_cv_header_netinet_ether_h" = yes; then
224 # We have it - does it declare ether_hostton()?
225 # Unset ac_cv_have_decl_ether_hostton so we don't
226 # treat the previous failure as a cached value and
227 # suppress the next test.
229 unset ac_cv_have_decl_ether_hostton
230 AC_CHECK_DECL(ether_hostton,
232 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
233 [Define to 1 if netinet/ether.h declares `ether_hostton'])
236 #include <netinet/ether.h>
241 # Is ether_hostton() declared?
243 if test "$ac_cv_have_decl_ether_hostton" != yes; then
245 # No, we'll have to declare it ourselves.
246 # Do we have "struct ether_addr"?
248 AC_CHECK_TYPES(struct ether_addr,,,
250 #include <sys/types.h>
251 #include <sys/socket.h>
252 #include <netinet/in.h>
253 #include <arpa/inet.h>
257 #include <netinet/if_ether.h>
259 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
260 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
263 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
264 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
269 dnl to pacify those who hate protochain insn
270 AC_MSG_CHECKING(if --disable-protochain option is specified)
271 AC_ARG_ENABLE(protochain,
272 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
273 case "x$enable_protochain" in
274 xyes) enable_protochain=enabled ;;
275 xno) enable_protochain=disabled ;;
276 x) enable_protochain=enabled ;;
279 if test "$enable_protochain" = "disabled"; then
280 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
282 AC_MSG_RESULT(${enable_protochain})
285 # SITA support is mutually exclusive with native capture support;
286 # "--with-sita" selects SITA support.
289 AC_HELP_STRING([--with-sita],[include SITA support]),
291 if test ! "x$withval" = "xno" ; then
292 AC_DEFINE(SITA,1,[include ACN support])
293 AC_MSG_NOTICE(Enabling SITA ACN support)
300 dnl Not all versions of test support -c (character special) but it's a
301 dnl better way of testing since the device might be protected. So we
302 dnl check in our normal order using -r and then check the for the /dev
303 dnl guys again using -c.
305 dnl XXX This could be done for cross-compiling, but for now it's not.
307 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
308 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
311 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
312 AC_MSG_CHECKING(packet capture type)
313 if test ! -z "$with_pcap" ; then
315 elif test -r /dev/bpf -o -h /dev/bpf ; then
317 # Cloning BPF device.
320 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
321 elif test -r /dev/bpf0 ; then
323 elif test -r /usr/include/net/pfilt.h ; then
325 elif test -r /dev/enet ; then
327 elif test -r /dev/nit ; then
329 elif test -r /usr/include/sys/net/nit.h ; then
331 elif test -r /usr/include/linux/socket.h ; then
333 elif test -r /usr/include/net/raw.h ; then
335 elif test -r /usr/include/odmi.h ; then
337 # On AIX, the BPF devices might not yet be present - they're
338 # created the first time libpcap runs after booting.
339 # We check for odmi.h instead.
342 elif test -c /dev/bpf0 ; then # check again in case not readable
344 elif test -r /usr/include/sys/dlpi.h ; then
346 elif test -c /dev/enet ; then # check again in case not readable
348 elif test -c /dev/nit ; then # check again in case not readable
353 AC_MSG_RESULT($V_PCAP)
356 # Do capture-mechanism-dependent tests.
361 # Needed for common functions used by pcap-[dlpi,libdlpi].c
366 # Checks for some header files.
368 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
371 # Checks to see if Solaris has the public libdlpi(3LIB) library.
372 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
373 # public libdlpi(3LIB) version. Before libdlpi was made public, a
374 # private version also existed, which did not have the same APIs.
375 # Due to a gcc bug, the default search path for 32-bit libraries does
376 # not include /lib, we add it explicitly here.
377 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
378 # Also, due to the bug above applications that link to libpcap with
379 # libdlpi will have to add "-L/lib" option to "configure".
381 saved_ldflags=$LDFLAGS
382 LDFLAGS="$LIBS -L/lib"
383 AC_CHECK_LIB(dlpi, dlpi_walk,
387 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
390 LDFLAGS=$saved_ldflags
393 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
396 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
397 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
400 #include <sys/types.h>
401 #include <sys/time.h>
402 #include <sys/dlpi.h>
404 [int i = DL_PROMISC_PHYS;],
405 ac_cv_sys_dlpi_usable=yes,
406 ac_cv_sys_dlpi_usable=no))
407 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
408 if test $ac_cv_sys_dlpi_usable = no ; then
409 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
413 # Check whether we have a /dev/dlpi device or have multiple devices.
415 AC_MSG_CHECKING(for /dev/dlpi device)
416 if test -c /dev/dlpi ; then
418 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
422 AC_MSG_CHECKING(for $dir directory)
423 if test -d $dir ; then
425 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
432 # This check is for Solaris with DLPI support for passive modes.
433 # See dlpi(7P) for more details.
435 AC_LBL_DL_PASSIVE_REQ_T
440 # Do we have the wireless extensions?
442 AC_CHECK_HEADERS(linux/wireless.h, [], [],
444 #include <sys/socket.h>
445 #include <linux/if.h>
446 #include <linux/types.h>
453 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
454 with_libnl=$withval,,)
456 if test x$with_libnl != xno ; then
459 incdir=-I/usr/include/libnl3
461 if test x$withval != x ; then
462 libnldir=-L${withval}/lib/.libs
463 incdir=-I${withval}/include
467 # Try libnl 3.x first.
469 AC_CHECK_LIB(nl-3, nl_socket_alloc,
472 # Yes, we have libnl 3.x.
474 LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
475 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
476 AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
477 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
478 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
479 V_INCLS="$V_INCLS ${incdir}"
481 ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
483 if test x$have_any_nl = xno ; then
487 AC_CHECK_LIB(nl, nl_socket_alloc,
490 # Yes, we have libnl 2.x.
492 LIBS="${libnldir} -lnl-genl -lnl $LIBS"
493 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
494 AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
495 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
496 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
501 if test x$have_any_nl = xno ; then
503 # No, we don't; do we have libnl 1.x?
505 AC_CHECK_LIB(nl, nl_handle_alloc,
510 LIBS="${libnldir} -lnl $LIBS"
511 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
516 if test x$have_any_nl = xno ; then
518 # No, we don't have libnl at all.
520 if test x$with_libnl = xyes ; then
521 AC_MSG_ERROR([libnl support requested but libnl not found])
526 AC_CHECK_HEADERS(linux/ethtool.h,,,
529 #include <linux/types.h>
532 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
537 # Check whether we have the *BSD-style ioctls.
539 AC_CHECK_HEADERS(net/if_media.h)
541 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
543 [#include <sys/socket.h>
544 #include <sys/ioctl.h>
546 #include <net/bpf.h>],
547 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
550 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
551 [define if the system supports zerocopy BPF])
556 # Check whether we have struct BPF_TIMEVAL.
558 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
560 #include <sys/types.h>
561 #include <sys/ioctl.h>
562 #ifdef HAVE_SYS_IOCCOM_H
563 #include <sys/ioccom.h>
570 V_DEFS="$V_DEFS -DDAG_ONLY"
574 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
578 V_DEFS="$V_DEFS -DSNF_ONLY"
582 AC_MSG_WARN(cannot determine packet capture interface)
583 AC_MSG_WARN((see the INSTALL doc for more info))
588 dnl Now figure out how we get a list of interfaces and addresses,
589 dnl if we support capturing. Don't bother if we don't support
592 if test "$V_PCAP" = null
595 # We can't capture, so we can't open any capture
596 # devices, so we won't return any interfaces.
600 AC_CHECK_FUNC(getifaddrs,[
602 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
603 # as well, just in case some platform is really weird.
605 AC_CHECK_HEADER(ifaddrs.h,[
607 # We have the header, so we use "getifaddrs()" to
608 # get the list of interfaces.
613 # We don't have the header - give up.
614 # XXX - we could also fall back on some other
615 # mechanism, but, for now, this'll catch this
616 # problem so that we can at least try to figure
617 # out something to do on systems with "getifaddrs()"
618 # but without "ifaddrs.h", if there is something
619 # we can do on those systems.
621 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
625 # Well, we don't have "getifaddrs()", so we have to use
626 # some other mechanism; determine what that mechanism is.
628 # The first thing we use is the type of capture mechanism,
629 # which is somewhat of a proxy for the OS we're using.
635 # This might be Solaris 8 or later, with
636 # SIOCGLIFCONF, or it might be some other OS
637 # or some older version of Solaris, with
640 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
641 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
643 [#include <sys/param.h>
644 #include <sys/file.h>
645 #include <sys/ioctl.h>
646 #include <sys/socket.h>
647 #include <sys/sockio.h>],
648 [ioctl(0, SIOCGLIFCONF, (char *)0);],
649 ac_cv_lbl_have_siocglifconf=yes,
650 ac_cv_lbl_have_siocglifconf=no))
651 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
652 if test $ac_cv_lbl_have_siocglifconf = yes ; then
661 # Assume we just have SIOCGIFCONF.
662 # (XXX - on at least later Linux kernels, there's
663 # another mechanism, and we should be using that
672 AC_MSG_CHECKING(for socklen_t)
674 #include <sys/types.h>
675 #include <sys/socket.h>
680 if test "x$have_socklen_t" = "xyes"; then
681 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
683 AC_MSG_RESULT($have_socklen_t)
686 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
688 [enable_ipv6=ifavailable])
689 if test "$enable_ipv6" != "no"; then
690 AC_CHECK_FUNC(getaddrinfo,
692 AC_DEFINE(INET6,1,[IPv6])
695 if test "$enable_ipv6" != "ifavailable"; then
696 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
701 AC_MSG_CHECKING(whether to build optimizer debugging code)
702 AC_ARG_ENABLE(optimizer-dbg,
703 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
704 if test "$enable_optimizer_dbg" = "yes"; then
705 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
707 AC_MSG_RESULT(${enable_optimizer_dbg-no})
709 AC_MSG_CHECKING(whether to build parser debugging code)
710 AC_ARG_ENABLE(yydebug,
711 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
712 if test "$enable_yydebug" = "yes"; then
713 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
715 AC_MSG_RESULT(${enable_yydebug-no})
717 # Check for Endace DAG card support.
719 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
721 if test "$withval" = no
723 # User doesn't want DAG support.
725 elif test "$withval" = yes
727 # User wants DAG support but hasn't specified a directory.
730 # User wants DAG support and has specified a directory, so use the provided value.
736 # Use DAG API if present, otherwise don't
741 AC_ARG_WITH([dag-includes],
742 AC_HELP_STRING([--with-dag-includes=DIR],[Endace DAG include directory]),
744 # User wants DAG support and has specified a header directory, so use the provided value.
746 dag_include_dir=$withval
749 AC_ARG_WITH([dag-libraries],
750 AC_HELP_STRING([--with-dag-libraries=DIR],[Endace DAG library directory]),
752 # User wants DAG support and has specified a library directory, so use the provided value.
760 # We support the DAG API if we're on Linux or BSD, or if we're
761 # building a DAG-only libpcap.
766 # If the user explicitly requested DAG, tell them it's not
769 # If they expressed no preference, don't include it.
771 if test $want_dag = yes; then
772 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
773 elif test $want_dag = yes; then
780 if test "$want_dag" != no; then
782 AC_MSG_CHECKING([whether we have DAG API headers])
784 # If necessary, set default paths for DAG API headers and libraries.
785 if test -z "$dag_root"; then
789 if test -z "$dag_include_dir"; then
790 dag_include_dir="$dag_root/include"
793 if test -z "$dag_lib_dir"; then
794 dag_lib_dir="$dag_root/lib"
797 if test -z "$dag_tools_dir"; then
798 dag_tools_dir="$dag_root/tools"
801 if test -r $dag_include_dir/dagapi.h; then
802 ac_cv_lbl_dag_api=yes
804 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
807 if test $ac_cv_lbl_dag_api = yes; then
808 V_INCLS="$V_INCLS -I$dag_include_dir"
810 if test $V_PCAP != dag ; then
814 # See if we can find a general version string.
815 # Don't need to save and restore LIBS to prevent -ldag being
816 # included if there's a found-action (arg 3).
817 saved_ldflags=$LDFLAGS
818 LDFLAGS="-L$dag_lib_dir"
819 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
820 AC_CHECK_LIB([dag],[dag_get_erf_types], [
821 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
822 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
823 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
825 LDFLAGS=$saved_ldflags
827 if test "$dag_streams" = 1; then
828 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
830 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
832 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
833 if test "$ac_dag_have_vdag" = 1; then
834 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
835 LIBS="$LIBS -lpthread"
839 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
842 AC_MSG_CHECKING(whether we have the DAG API)
844 if test $ac_cv_lbl_dag_api = no; then
846 if test "$want_dag" = yes; then
847 # User wanted DAG support but we couldn't find it.
848 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
851 if test "$V_PCAP" = dag; then
852 # User requested "dag" capture type but the DAG API wasn't
854 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.)])
861 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, on Linux, if present@:>@]),
863 if test "$withval" = no
866 elif test "$withval" = yes
876 # Use Septel API if present, otherwise don't
878 want_septel=ifpresent
879 septel_root=./../septel
881 ac_cv_lbl_septel_api=no
885 # We support the Septel API if we're on Linux, or if we're building
886 # a Septel-only libpcap.
891 # If the user explicitly requested Septel, tell them it's not
894 # If they expressed no preference, don't include it.
896 if test $want_septel = yes; then
897 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
898 elif test $want_septel = yes; then
904 if test "$with_septel" != no; then
905 AC_MSG_CHECKING(whether we have Septel API)
907 if test -z "$septel_root"; then
908 septel_root=$srcdir/../septel
911 septel_tools_dir="$septel_root"
912 septel_include_dir="$septel_root/INC"
914 ac_cv_lbl_septel_api=no
915 if test -r "$septel_include_dir/msg.h"; then
916 V_INCLS="$V_INCLS -I$septel_include_dir"
917 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"
918 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"
920 if test "$V_PCAP" != septel ; then
923 ac_cv_lbl_septel_api=yes
926 AC_MSG_RESULT($ac_cv_lbl_septel_api)
927 if test $ac_cv_lbl_septel_api = no; then
928 if test "$want_septel" = yes; then
929 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
932 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
936 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
937 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
940 # Check for Myricom SNF support.
942 AC_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
944 if test "$withval" = no
946 # User explicitly doesn't want SNF
948 elif test "$withval" = yes
950 # User wants SNF support but hasn't specific a directory.
953 # User wants SNF support with a specified directory.
959 # Use Sniffer API if present, otherwise don't
964 AC_ARG_WITH([snf-includes],
965 AC_HELP_STRING([--with-snf-includes=DIR],[Myricom SNF include directory]),
967 # User wants SNF with specific header directory
969 snf_include_dir=$withval
972 AC_ARG_WITH([snf-libraries],
973 AC_HELP_STRING([--with-snf-libraries=DIR],[Myricom SNF library directory]),
975 # User wants SNF with specific lib directory
983 # We support the Sniffer API if we're on BSD, Linux, or if we're
984 # building a Sniffer-only libpcap.
989 # If the user explicitly requested Sniffer, tell them it's not
992 # If they expressed no preference, don't include it.
994 if test $want_snf = yes; then
995 AC_MSG_ERROR(Myricom SNF support only available with 'bpf' 'linux' and 'snf' packet capture types)
996 elif test $want_snf = yes; then
1002 ac_cv_lbl_snf_api=no
1003 if test "$with_snf" != no; then
1005 AC_MSG_CHECKING(whether we have Myricom Sniffer API)
1007 if test -z "$snf_root"; then
1011 if test -z "$snf_include_dir"; then
1012 snf_include_dir="$snf_root/include"
1015 if test -z "$snf_lib_dir"; then
1016 snf_lib_dir="$snf_root/lib"
1019 if test -f "$snf_include_dir/snf.h"; then
1020 ac_cv_lbl_snf_api=yes
1022 AC_MSG_RESULT([$ac_cv_lbl_snf_api ($snf_root)])
1024 if test $ac_cv_lbl_snf_api = no; then
1025 if test "$want_snf" = yes; then
1026 AC_MSG_ERROR(SNF API headers not found under $snf_include_dir; use --without-snf)
1029 saved_ldflags=$LDFLAGS
1030 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1031 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"], [ac_cv_lbl_snf_api="no"])
1032 LDFLAGS="$saved_ldflags"
1034 if test $ac_cv_lbl_snf_api = no; then
1035 if test "$want_snf" = yes; then
1036 AC_MSG_ERROR(SNF API cannot correctly be linked check config.log; use --without-snf)
1039 V_INCLS="$V_INCLS -I$snf_include_dir"
1041 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1042 if test "$V_PCAP" != snf ; then
1045 AC_DEFINE(HAVE_SNF_API, 1, [define if you have Myricom SNF API])
1050 if test "$V_PCAP" = snf -a "$ac_cv_lbl_snf_api" = no; then
1051 AC_MSG_ERROR(Specifying the capture type as 'snf' requires the Myricom Sniffer API to be present; use --with-snf=DIR)
1054 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
1055 if test "$V_LEX" = lex ; then
1056 # Some versions of lex can't handle the definitions section of scanner.l .
1057 # Try lexing it and complain if it can't deal.
1058 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1059 if lex -t scanner.l > /dev/null 2>&1; then
1060 tcpdump_cv_capable_lex=yes
1062 tcpdump_cv_capable_lex=insufficient
1064 if test $tcpdump_cv_capable_lex = insufficient ; then
1065 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
1066 libpcap. flex is a lex replacement that has many advantages, including
1067 being able to compile libpcap. For more information, see
1068 http://www.gnu.org/software/flex/flex.html .])
1073 # Assume, by default, no support for shared libraries and V7/BSD convention
1074 # for man pages (file formats in section 5, miscellaneous info in section 7).
1075 # Individual cases can override this.
1083 dnl Workaround to enable certain features
1084 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1087 # AIX makes it fun to build shared and static libraries,
1088 # because they're *both* ".a" archive libraries. We
1089 # build the static library for the benefit of the traditional
1090 # scheme of building libpcap and tcpdump in subdirectories of
1091 # the same directory, with tcpdump statically linked with the
1092 # libpcap in question, but we also build a shared library as
1093 # "libpcap.shareda" and install *it*, rather than the static
1094 # library, as "libpcap.a".
1102 # If we're using DLPI, applications will need to
1103 # use /lib/pse.exp if present, as we use the
1106 pseexe="/lib/pse.exp"
1107 AC_MSG_CHECKING(for $pseexe)
1108 if test -f $pseexe ; then
1116 # If we're using BPF, we need "-lodm" and "-lcfg", as
1117 # we use them to load the BPF module.
1126 V_CCOPT="$V_CCOPT -fno-common"
1127 AC_ARG_ENABLE(universal,
1128 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
1129 if test "$enable_universal" != "no"; then
1134 # Pre-Tiger. Build only for 32-bit PowerPC; no
1135 # need for any special compiler or linker flags.
1141 # Tiger, prior to Intel support. Build for 32-bit
1142 # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
1143 # first. (I'm guessing that's what Apple does.)
1145 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64"
1146 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64"
1151 # Tiger, subsequent to Intel support but prior to
1152 # x86-64 support. Build for 32-bit PowerPC, 64-bit
1153 # PowerPC, and x86, with 32-bit PowerPC first.
1154 # (I'm guessing that's what Apple does.)
1156 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386"
1157 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386"
1162 # All other Tiger, so subsequent to x86-64
1163 # support. Build for 32-bit PowerPC, 64-bit
1164 # PowerPC, x86, and x86-64, and with 32-bit PowerPC
1165 # first. (I'm guessing 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 # Leopard. Build for 32-bit PowerPC, 64-bit
1174 # PowerPC, x86, and x86-64, with 32-bit PowerPC
1175 # first. (That's what Apple does.)
1177 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1178 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1183 # Snow Leopard. Build for x86-64, x86, and
1184 # 32-bit PowerPC, with x86-64 first. (That's
1185 # what Apple does, even though Snow Leopard
1186 # doesn't run on PPC, so PPC libpcap runs under
1187 # Rosetta, and Rosetta doesn't support BPF
1188 # ioctls, so PPC programs can't do live
1191 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
1192 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
1197 # Post-Snow Leopard. Build for x86-64 and
1198 # x86, with x86-64 first. (That's probably what
1199 # Apple does, given that Rosetta is gone.)
1200 # XXX - update if and when Apple drops support
1201 # for 32-bit x86 code.
1203 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
1204 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
1211 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1214 # Use System V conventions for man pages.
1223 # Use System V conventions for man pages.
1232 # Use System V conventions for man pages.
1239 dnl HPUX 10.20 and above is similar to HPUX 9, but
1240 dnl not the same....
1242 dnl XXX - DYEXT should be set to "sl" if this is building
1243 dnl for 32-bit PA-RISC, but should be left as "so" for
1244 dnl 64-bit PA-RISC or, I suspect, IA-64.
1245 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1246 if test "`uname -m`" = "ia64"; then
1253 # "-b" builds a shared library; "+h" sets the soname.
1259 # Use System V conventions for man pages.
1267 # Use System V conventions for man pages.
1273 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*)
1277 # Compiler assumed to be GCC; run-time linker may require a -R
1280 if test "$libdir" != "/usr/lib"; then
1281 V_RFLAGS=-Wl,-R$libdir
1289 # Use System V conventions for man pages.
1296 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1297 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1301 ac_cv_cc_sinix_defined=yes,
1302 ac_cv_cc_sinix_defined=no))
1303 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1304 if test $ac_cv_cc_sinix_defined = no ; then
1305 AC_DEFINE(sinix,1,[on sinix])
1310 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1314 # Use System V conventions for man pages.
1321 AC_ARG_ENABLE(shared,
1322 AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
1323 test "x$enable_shared" = "xno" && DYEXT="none"
1326 AC_CHECK_TOOL([AR], [ar])
1331 AC_LBL_DEVEL(V_CCOPT)
1333 AC_LBL_SOCKADDR_SA_LEN
1335 AC_LBL_SOCKADDR_STORAGE
1337 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1339 AC_LBL_UNALIGNED_ACCESS
1342 # Makefile.in includes rules to generate version.h, so we assume
1343 # that it will be generated if autoconf is used.
1345 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1348 ln -s ${srcdir}/bpf/net net
1352 AC_SUBST(V_FINDALLDEVS)
1356 AC_SUBST(V_SHLIB_CMD)
1357 AC_SUBST(V_SHLIB_OPT)
1358 AC_SUBST(V_SONAME_OPT)
1359 AC_SUBST(V_RPATH_OPT)
1362 AC_SUBST(ADDLARCHIVEOBJS)
1365 AC_SUBST(MAN_FILE_FORMATS)
1366 AC_SUBST(MAN_MISC_INFO)
1368 AC_ARG_ENABLE([usb],
1369 [AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
1373 if test "x$enable_usb" != "xno" ; then
1374 dnl check for USB sniffing support
1375 AC_MSG_CHECKING(for USB sniffing support)
1378 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1379 USB_SRC=pcap-usb-linux.c
1381 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1382 if test $? -ne 0 ; then
1383 ac_usb_dev_name="usbmon"
1385 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1386 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1388 # Do we have a version of <linux/compiler.h> available?
1389 # If so, we might need it for <linux/usbdevice_fs.h>.
1391 AC_CHECK_HEADERS(linux/compiler.h)
1392 if test "$ac_cv_header_linux_compiler_h" = yes; then
1394 # Yes - include it when testing for <linux/usbdevice_fs.h>.
1396 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
1398 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1400 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1402 # OK, does it define bRequestType? Older versions of the kernel
1403 # define fields with names like "requesttype, "request", and
1404 # "value", rather than "bRequestType", "bRequest", and
1407 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1408 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1411 #ifdef HAVE_SYS_BITYPES_H
1412 #include <sys/bitypes.h>
1414 #ifdef HAVE_LINUX_COMPILER_H
1415 #include <linux/compiler.h>
1417 #include <linux/usbdevice_fs.h>],
1418 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1419 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1420 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1421 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1422 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1423 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1424 [if struct usbdevfs_ctrltransfer has bRequestType])
1433 AC_SUBST(PCAP_SUPPORT_USB)
1436 dnl check for netfilter sniffing support
1437 AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
1442 # Life's too short to deal with trying to get this to compile
1443 # if you don't get the right types defined with
1444 # __KERNEL_STRICT_NAMES getting defined by some other include.
1446 # Check whether the includes Just Work. If not, don't turn on
1447 # netfilter support.
1449 AC_MSG_CHECKING(whether we can compile the netfilter support)
1450 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
1453 #include <sys/socket.h>
1454 #include <netinet/in.h>
1455 #include <linux/types.h>
1457 #include <linux/netlink.h>
1458 #include <linux/netfilter.h>
1459 #include <linux/netfilter/nfnetlink.h>
1460 #include <linux/netfilter/nfnetlink_log.h>
1461 #include <linux/netfilter/nfnetlink_queue.h>],
1463 ac_cv_netfilter_can_compile=yes,
1464 ac_cv_netfilter_can_compile=no))
1465 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
1466 if test $ac_cv_netfilter_can_compile = yes ; then
1467 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
1468 [target host supports netfilter sniffing])
1469 NETFILTER_SRC=pcap-netfilter-linux.c
1476 AC_SUBST(PCAP_SUPPORT_NETFILTER)
1477 AC_SUBST(NETFILTER_SRC)
1479 AC_ARG_ENABLE([bluetooth],
1480 [AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
1482 [enable_bluetooth=ifsupportavailable])
1484 if test "x$enable_bluetooth" != "xno" ; then
1485 dnl check for Bluetooth sniffing support
1488 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1490 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1491 BT_SRC=pcap-bt-linux.c
1492 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1495 # OK, does struct sockaddr_hci have an hci_channel
1498 AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
1499 AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
1502 #include <bluetooth/bluetooth.h>
1503 #include <bluetooth/hci.h>
1505 [u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
1506 ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
1507 ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
1508 AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
1509 if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
1510 AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
1511 [if struct sockaddr_hci has hci_channel member])
1514 # OK, is HCI_CHANNEL_MONITOR defined?
1516 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
1517 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
1520 #include <bluetooth/bluetooth.h>
1521 #include <bluetooth/hci.h>
1523 [u_int i = HCI_CHANNEL_MONITOR],
1524 ac_cv_lbl_hci_channel_monitor_is_defined=yes,
1525 ac_cv_lbl_hci_channel_monitor_is_defined=no))
1526 AC_MSG_RESULT($ac_cv_lbl_hci_channel_monitor_is_defined)
1527 if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then
1528 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
1529 [target host supports Bluetooth Monitor])
1530 BT_MONITOR_SRC=pcap-bt-monitor-linux.c
1533 ac_lbl_bluetooth_available=yes
1535 ac_lbl_bluetooth_available=no
1537 if test "x$ac_lbl_bluetooth_available" == "xno" ; then
1538 if test "x$enable_bluetooth" = "xyes" ; then
1539 AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1541 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1546 if test "x$enable_bluetooth" = "xyes" ; then
1547 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
1549 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
1553 AC_SUBST(PCAP_SUPPORT_BT)
1555 AC_SUBST(BT_MONITOR_SRC)
1558 AC_ARG_ENABLE([canusb],
1559 [AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
1561 [enable_canusb=ifsupportavailable])
1563 if test "x$enable_canusb" != "xno" ; then
1564 dnl check for canusb support
1567 AC_CHECK_HEADER(libusb-1.0/libusb.h,
1569 AC_CHECK_LIB(usb-1.0, libusb_init,
1571 AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
1572 CANUSB_SRC=pcap-canusb-linux.c
1573 LIBS="-lusb-1.0 -lpthread $LIBS"
1574 ac_lbl_has_libusb=yes
1576 ac_lbl_has_libusb=no,
1580 ac_lbl_has_libusb=no
1582 if test "x$ac_lbl_has_libusb" = "xyes" ; then
1583 AC_MSG_NOTICE(canusb sniffing is supported)
1585 if test "x$enable_canusb" = "xyes" ; then
1586 AC_MSG_ERROR(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1588 AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1593 if test "x$enable_canusb" = "xyes" ; then
1594 AC_MSG_ERROR(no canusb support implemented for $host_os)
1596 AC_MSG_NOTICE(no canusb support implemented for $host_os)
1600 AC_SUBST(PCAP_SUPPORT_CANUSB)
1601 AC_SUBST(CANUSB_SRC)
1604 AC_ARG_ENABLE([can],
1605 [AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
1607 [enable_can=ifsupportavailable])
1609 if test "x$enable_can" != "xno" ; then
1610 dnl check for CAN sniffing support
1613 AC_CHECK_HEADER(linux/can.h,
1615 AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
1616 CAN_SRC=pcap-can-linux.c
1617 AC_MSG_NOTICE(CAN sniffing is supported)
1620 if test "x$enable_can" = "xyes" ; then
1621 AC_MSG_ERROR(CAN sniffing is not supported)
1623 AC_MSG_NOTICE(CAN sniffing is not supported)
1626 [#include <sys/socket.h>]
1630 if test "x$enable_can" = "xyes" ; then
1631 AC_MSG_ERROR(no CAN sniffing support implemented for $host_os)
1633 AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
1637 AC_SUBST(PCAP_SUPPORT_CAN)
1641 AC_ARG_ENABLE([dbus],
1642 [AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
1644 [enable_dbus=ifavailable])
1646 if test "x$enable_dbus" != "xno"; then
1647 if test "x$enable_dbus" = "xyes"; then
1652 # We don't support D-Bus sniffing on OS X; see
1654 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1656 # The user requested it, so fail.
1658 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
1665 # We don't support D-Bus sniffing on OS X; see
1667 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1669 # The user dind't explicitly request it, so just
1670 # silently refuse to enable it.
1678 if test "x$enable_dbus" != "xno"; then
1679 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
1680 if test "x$PKGCONFIG" != "xno"; then
1681 AC_MSG_CHECKING([for D-Bus])
1682 if "$PKGCONFIG" dbus-1; then
1683 AC_MSG_RESULT([yes])
1684 DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
1685 DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
1686 save_CFLAGS="$CFLAGS"
1688 CFLAGS="$CFLAGS $DBUS_CFLAGS"
1689 LIBS="$LIBS $DBUS_LIBS"
1690 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
1692 [#include <string.h>
1695 #include <sys/time.h>
1697 #include <dbus/dbus.h>],
1698 [return dbus_connection_read_write(NULL, 0);],
1700 AC_MSG_RESULT([yes])
1701 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
1702 DBUS_SRC=pcap-dbus.c
1703 V_INCLS="$V_INCLS $DBUS_CFLAGS"
1707 if test "x$enable_dbus" = "xyes"; then
1708 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
1712 CFLAGS="$save_CFLAGS"
1715 if test "x$enable_dbus" = "xyes"; then
1716 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
1720 AC_SUBST(PCAP_SUPPORT_DBUS)
1724 dnl check for hardware timestamp support
1727 AC_CHECK_HEADERS([linux/net_tstamp.h])
1730 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1734 dnl The packet ring capture facility of Linux, described in
1735 dnl Documentation/networking/packet_mmap.txt, is not 32/64-bit compatible before
1736 dnl version 2.6.27. A 32-bit kernel requires a 32-bit userland, and likewise for
1737 dnl 64-bit. The effect of this is that a 32-bit libpcap binary will not run
1738 dnl correctly on a 64-bit kernel (the binary will use the wrong offsets into a
1739 dnl kernel struct). This problem was solved in Linux 2.6.27. Use
1740 dnl --disable-packet-ring whenever a 32-bit application must run on a 64-bit
1741 dnl target host, and either the build host or the target host run Linux 2.6.26
1743 AC_ARG_ENABLE([packet-ring],
1744 [AC_HELP_STRING([--enable-packet-ring],[enable Linux packet ring support @<:@default=yes@:>@])],
1745 ,enable_packet_ring=yes)
1747 if test "x$enable_packet_ring" != "xno" ; then
1748 AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use Linux packet ring capture if available])
1749 AC_SUBST(PCAP_SUPPORT_PACKET_RING)
1754 AC_CONFIG_HEADER(config.h)
1756 AC_OUTPUT_COMMANDS([if test -f .devel; then
1757 echo timestamp > stamp-h
1758 cat Makefile-devel-adds >> Makefile
1761 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1762 pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
1763 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
1764 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
1765 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
1766 pcap_open_offline.3pcap pcap_set_tstamp_precision.3pcap
1767 pcap_set_tstamp_type.3pcap)