1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.168 2008-12-23 20:49:26 guy Exp $ (LBL)
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
6 dnl Process this file with autoconf to produce a configure script.
12 # http://ftp.gnu.org/gnu/config/README
14 # for the URLs to use to fetch new versions of config.guess and
18 AC_REVISION($Revision: 1.168 $)
24 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
28 AC_CHECK_HEADERS(sys/bitypes.h)
30 AC_CHECK_TYPE([int8_t], ,
31 [AC_DEFINE([int8_t], [signed char],
32 [Define to `signed char' if int8_t not defined.])],
34 #ifdef HAVE_SYS_BITYPES_H
35 #include <sys/bitypes.h>
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.])],
41 #ifdef HAVE_SYS_BITYPES_H
42 #include <sys/bitypes.h>
44 AC_CHECK_TYPE([int16_t], ,
45 [AC_DEFINE([int16_t], [short],
46 [Define to `short' if int16_t not defined.])]
48 #ifdef HAVE_SYS_BITYPES_H
49 #include <sys/bitypes.h>
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.])],
55 #ifdef HAVE_SYS_BITYPES_H
56 #include <sys/bitypes.h>
58 AC_CHECK_TYPE([int32_t], ,
59 [AC_DEFINE([int32_t], [int],
60 [Define to `int' if int32_t not defined.])],
62 #ifdef HAVE_SYS_BITYPES_H
63 #include <sys/bitypes.h>
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.])],
69 #ifdef HAVE_SYS_BITYPES_H
70 #include <sys/bitypes.h>
72 AC_CHECK_TYPE([int64_t], ,
73 [AC_DEFINE([int64_t], [long long],
74 [Define to `long long' if int64_t not defined.])],
76 #ifdef HAVE_SYS_BITYPES_H
77 #include <sys/bitypes.h>
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.])],
83 #ifdef HAVE_SYS_BITYPES_H
84 #include <sys/bitypes.h>
88 # Try to arrange for large file support.
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.
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
108 # Check for various PF actions.
110 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
112 [#include <sys/types.h>
113 #include <sys/socket.h>
115 #include <net/pfvar.h>],
116 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
119 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
120 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
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
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.
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>
141 #include <net/if.h>])
146 AC_CHECK_FUNCS(strerror strlcpy)
149 AC_CHECK_FUNCS(vsnprintf snprintf,,
151 if test $needsnprintf = yes; then
156 # Do this before checking for ether_hostton(), as it's a
157 # "gethostbyname() -ish function".
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.)
170 # Before you is a C compiler.
172 AC_CHECK_FUNCS(ether_hostton)
173 if test "$ac_cv_func_ether_hostton" = yes; then
175 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
177 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
179 # Yes. Does it declare ether_hostton()?
181 AC_CHECK_DECL(ether_hostton,
183 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
184 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
187 #include <sys/types.h>
188 #include <sys/socket.h>
189 #include <netinet/in.h>
190 #include <arpa/inet.h>
194 #include <netinet/if_ether.h>
200 if test "$ac_cv_have_decl_ether_hostton" != yes; then
202 # No, how about <netinet/ether.h>, as on Linux?
204 AC_CHECK_HEADERS(netinet/ether.h)
205 if test "$ac_cv_header_netinet_ether_h" = yes; then
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.
212 unset ac_cv_have_decl_ether_hostton
213 AC_CHECK_DECL(ether_hostton,
215 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
216 [Define to 1 if netinet/ether.h declares `ether_hostton'])
219 #include <netinet/ether.h>
224 # Is ether_hostton() declared?
226 if test "$ac_cv_have_decl_ether_hostton" != yes; then
228 # No, we'll have to declare it ourselves.
229 # Do we have "struct ether_addr"?
231 AC_CHECK_TYPES(struct ether_addr,,,
233 #include <sys/types.h>
234 #include <sys/socket.h>
235 #include <netinet/in.h>
236 #include <arpa/inet.h>
240 #include <netinet/if_ether.h>
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
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
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 ;;
262 if test "$enable_protochain" = "disabled"; then
263 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
265 AC_MSG_RESULT(${enable_protochain})
268 # SITA support is mutually exclusive with native capture support;
269 # "--with-sita" selects SITA support.
272 AC_HELP_STRING([--with-sita],[include SITA support]),
274 if test ! "x$withval" = "xno" ; then
275 AC_DEFINE(SITA,1,[include ACN support])
276 AC_MSG_NOTICE(Enabling SITA ACN support)
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.
288 dnl XXX This could be done for cross-compiling, but for now it's not.
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=...)
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
298 elif test -r /dev/bpf ; then
300 # Cloning BPF device.
303 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
304 elif test -r /dev/bpf0 ; then
306 elif test -r /usr/include/net/pfilt.h ; then
308 elif test -r /dev/enet ; then
310 elif test -r /dev/nit ; then
312 elif test -r /usr/include/sys/net/nit.h ; then
314 elif test -r /usr/include/linux/socket.h ; then
316 elif test -r /usr/include/net/raw.h ; then
318 elif test -r /usr/include/odmi.h ; then
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.
325 elif test -c /dev/bpf0 ; then # check again in case not readable
327 elif test -r /usr/include/sys/dlpi.h ; then
329 elif test -c /dev/enet ; then # check again in case not readable
331 elif test -c /dev/nit ; then # check again in case not readable
336 AC_MSG_RESULT($V_PCAP)
339 # Do capture-mechanism-dependent tests.
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".
354 saved_ldflags=$LDFLAGS
355 LDFLAGS="$LIBS -L/lib"
356 AC_CHECK_LIB(dlpi, dlpi_walk,
359 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists]),
361 LDFLAGS=$saved_ldflags
364 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
367 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
368 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
371 #include <sys/types.h>
372 #include <sys/time.h>
373 #include <sys/dlpi.h>
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)
384 # Check whether we have a /dev/dlpi device or have multiple devices.
386 AC_MSG_CHECKING(for /dev/dlpi device)
387 if test -c /dev/dlpi ; then
389 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
393 AC_MSG_CHECKING(for $dir directory)
394 if test -d $dir ; then
396 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
403 # This check is for Solaris with DLPI support for passive modes.
404 # See dlpi(7P) for more details.
406 AC_LBL_DL_PASSIVE_REQ_T
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)
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'`)
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)
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)
428 # Do we have the wireless extensions?
430 AC_CHECK_HEADERS(linux/wireless.h, [], [],
432 #include <sys/socket.h>
433 #include <linux/if.h>
434 #include <linux/types.h>
441 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
442 with_libnl=$withval,,)
444 if test x$with_libnl != xno ; then
445 AC_CHECK_LIB(nl, nl_handle_alloc,
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])
455 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
460 # Check whether we have the *BSD-style ioctls.
462 AC_CHECK_HEADERS(net/if_media.h)
464 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
466 [#include <sys/socket.h>
467 #include <sys/ioctl.h>
469 #include <net/bpf.h>],
470 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
473 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
474 [define if the system supports zerocopy BPF])
480 V_DEFS="$V_DEFS -DDAG_ONLY"
484 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
488 AC_MSG_WARN(cannot determine packet capture interface)
489 AC_MSG_WARN((see the INSTALL doc for more info))
494 dnl Now figure out how we get a list of interfaces and addresses,
495 dnl if we support capturing. Don't bother if we don't support
498 if test "$V_PCAP" = null
501 # We can't capture, so we can't open any capture
502 # devices, so we won't return any interfaces.
506 AC_CHECK_FUNC(getifaddrs,[
508 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
509 # as well, just in case some platform is really weird.
511 AC_CHECK_HEADER(ifaddrs.h,[
513 # We have the header, so we use "getifaddrs()" to
514 # get the list of interfaces.
519 # We don't have the header - give up.
520 # XXX - we could also fall back on some other
521 # mechanism, but, for now, this'll catch this
522 # problem so that we can at least try to figure
523 # out something to do on systems with "getifaddrs()"
524 # but without "ifaddrs.h", if there is something
525 # we can do on those systems.
527 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
531 # Well, we don't have "getifaddrs()", so we have to use
532 # some other mechanism; determine what that mechanism is.
534 # The first thing we use is the type of capture mechanism,
535 # which is somewhat of a proxy for the OS we're using.
540 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
542 # This might be Solaris 8 or later, with
543 # SIOCGLIFCONF, or it might be some other OS
544 # or some older version of Solaris, with
547 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
548 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
550 [#include <sys/param.h>
551 #include <sys/file.h>
552 #include <sys/ioctl.h>
553 #include <sys/socket.h>
554 #include <sys/sockio.h>],
555 [ioctl(0, SIOCGLIFCONF, (char *)0);],
556 ac_cv_lbl_have_siocglifconf=yes,
557 ac_cv_lbl_have_siocglifconf=no))
558 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
559 if test $ac_cv_lbl_have_siocglifconf = yes ; then
565 # Needed for common functions used by pcap-[dlpi,libdlpi].c
572 # Assume we just have SIOCGIFCONF.
573 # (XXX - on at least later Linux kernels, there's
574 # another mechanism, and we should be using that
583 AC_MSG_CHECKING(for socklen_t)
585 #include <sys/types.h>
586 #include <sys/socket.h>
591 if test "x$have_socklen_t" = "xyes"; then
592 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
594 AC_MSG_RESULT($have_socklen_t)
597 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
599 [enable_ipv6=ifavailable])
600 if test "$enable_ipv6" != "no"; then
601 AC_CHECK_FUNC(getaddrinfo,
603 AC_DEFINE(INET6,1,[IPv6])
606 if test "$enable_ipv6" != "ifavailable"; then
607 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
612 AC_MSG_CHECKING(whether to build optimizer debugging code)
613 AC_ARG_ENABLE(optimizer-dbg,
614 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
615 if test "$enable_optimizer_dbg" = "yes"; then
616 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
618 AC_MSG_RESULT(${enable_optimizer_dbg-no})
620 AC_MSG_CHECKING(whether to build parser debugging code)
621 AC_ARG_ENABLE(yydebug,
622 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
623 if test "$enable_yydebug" = "yes"; then
624 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
626 AC_MSG_RESULT(${enable_yydebug-no})
628 AC_MSG_CHECKING(whether we have /proc/net/dev)
629 if test -r /proc/net/dev ; then
630 ac_cv_lbl_proc_net_dev=yes
632 ac_cv_lbl_proc_net_dev=no
634 if test $ac_cv_lbl_proc_net_dev = yes; then
635 AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev])
637 AC_MSG_RESULT($ac_cv_lbl_proc_net_dev)
639 # Check for Endace DAG card support.
641 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
643 if test "$withval" = no
645 # User doesn't want DAG support.
647 elif test "$withval" = yes
649 # User wants DAG support but hasn't specified a directory.
652 # User wants DAG support and has specified a directory, so use the provided value.
658 # Use DAG API if present, otherwise don't
663 AC_ARG_WITH([dag-includes],
664 AC_HELP_STRING([--with-dag-includes=DIR],[Endace DAG include directory]),
666 # User wants DAG support and has specified a header directory, so use the provided value.
668 dag_include_dir=$withval
671 AC_ARG_WITH([dag-libraries],
672 AC_HELP_STRING([--with-dag-libraries=DIR],[Endace DAG library directory]),
674 # User wants DAG support and has specified a library directory, so use the provided value.
682 # We support the DAG API if we're on Linux or BSD, or if we're
683 # building a DAG-only libpcap.
688 # If the user explicitly requested DAG, tell them it's not
691 # If they expressed no preference, don't include it.
693 if test $want_dag = yes; then
694 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
695 elif test $want_dag = yes; then
702 if test "$want_dag" != no; then
704 AC_MSG_CHECKING([whether we have DAG API headers])
706 # If necessary, set default paths for DAG API headers and libraries.
707 if test -z "$dag_root"; then
711 if test -z "$dag_include_dir"; then
712 dag_include_dir="$dag_root/include"
715 if test -z "$dag_lib_dir"; then
716 dag_lib_dir="$dag_root/lib"
719 if test -z "$dag_tools_dir"; then
720 dag_tools_dir="$dag_root/tools"
723 if test -r $dag_include_dir/dagapi.h; then
724 ac_cv_lbl_dag_api=yes
726 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
729 if test $ac_cv_lbl_dag_api = yes; then
731 AC_MSG_CHECKING([dagapi.o])
733 if test -r $dag_tools_dir/dagapi.o; then
735 dagapi_obj=$dag_tools_dir/dagapi.o
736 elif test -r $dag_lib_dir/dagapi.o; then
738 dagapi_obj=$dag_lib_dir/dagapi.o
739 elif test -r $dag_lib_dir/libdag.a; then
741 ar x $dag_lib_dir/libdag.a dagapi.o 2>/dev/null
742 if test -r ./dagapi.o; then
743 dagapi_obj=./dagapi.o
745 ar x $dag_lib_dir/libdag.a libdag_la-dagapi.o 2>/dev/null
746 if test -r ./libdag_la-dagapi.o; then
747 dagapi_obj=./libdag_la-dagapi.o
752 if test $dagapi_obj = no; then
753 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
756 AC_MSG_RESULT([yes ($dagapi_obj)])
760 if test $ac_cv_lbl_dag_api = yes; then
762 AC_MSG_CHECKING([dagopts.o])
764 if test -r $dag_tools_dir/dagopts.o; then
766 dagopts_obj=$dag_tools_dir/dagopts.o
767 elif test -r $dag_lib_dir/dagopts.o; then
769 dagopts_obj=$dag_lib_dir/dagopts.o
770 elif test -r $dag_lib_dir/libdag.a; then
772 ar x $dag_lib_dir/libdag.a dagopts.o 2>/dev/null
773 if test -r ./dagopts.o; then
774 dagopts_obj=./dagopts.o
776 ar x $dag_lib_dir/libdag.a libdag_la-dagopts.o 2>/dev/null
777 if test -r ./libdag_la-dagopts.o; then
778 dagopts_obj=./libdag_la-dagopts.o
783 if test $dagopts_obj = no; then
784 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
787 AC_MSG_RESULT([yes ($dagopts_obj)])
791 if test $ac_cv_lbl_dag_api = yes; then
792 # Under 2.5.x only we need to add dagreg.o.
793 if test -r $dag_include_dir/dagreg.h; then
794 AC_MSG_CHECKING([dagreg.o])
796 if test -r $dag_lib_dir/dagreg.o; then
797 # Object file is ready and waiting.
798 dagreg_obj=$dag_lib_dir/dagreg.o
799 elif test -r $dag_lib_dir/libdag.a; then
800 # Extract from libdag.a.
801 ar x $dag_lib_dir/libdag.a dagreg.o 2>/dev/null
802 if test -r ./dagreg.o; then
803 dagreg_obj=./dagreg.o
805 ar x $dag_lib_dir/libdag.a libdag_la-dagreg.o 2>/dev/null
806 if test -r ./libdag_la-dagreg.o; then
807 dagreg_obj=./libdag_la-dagreg.o
812 if test $dagreg_obj = no; then
813 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
816 AC_MSG_RESULT([yes ($dagreg_obj)])
821 if test $ac_cv_lbl_dag_api = yes; then
822 V_INCLS="$V_INCLS -I$dag_include_dir"
823 ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $dagapi_obj $dagopts_obj $dagreg_obj"
824 if test $V_PCAP != dag ; then
828 # See if we can find a general version string.
829 # Don't need to save and restore LIBS to prevent -ldag being
830 # included if there's a found-action (arg 3).
831 saved_ldflags=$LDFLAGS
832 LDFLAGS="-L$dag_lib_dir"
833 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
834 AC_CHECK_LIB([dag],[dag_get_erf_types], [
835 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
836 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
837 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
838 LDFLAGS=$saved_ldflags
840 if test "$dag_streams" = 1; then
841 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
845 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
848 AC_MSG_CHECKING(whether we have the DAG API)
850 if test $ac_cv_lbl_dag_api = no; then
852 if test "$want_dag" = yes; then
853 # User wanted DAG support but we couldn't find it.
854 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
857 if test "$V_PCAP" = dag; then
858 # User requested "dag" capture type but the DAG API wasn't
860 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.)])
867 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, on Linux, if present@:>@]),
869 if test "$withval" = no
872 elif test "$withval" = yes
882 # Use Septel API if present, otherwise don't
884 want_septel=ifpresent
885 septel_root=./../septel
887 ac_cv_lbl_septel_api=no
891 # We support the Septel API if we're on Linux, or if we're building
892 # a Septel-only libpcap.
897 # If the user explicitly requested Septel, tell them it's not
900 # If they expressed no preference, don't include it.
902 if test $want_septel = yes; then
903 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
904 elif test $want_septel = yes; then
910 if test "$with_septel" != no; then
911 AC_MSG_CHECKING(whether we have Septel API)
913 if test -z "$septel_root"; then
914 septel_root=$srcdir/../septel
917 septel_tools_dir="$septel_root"
918 septel_include_dir="$septel_root/INC"
920 ac_cv_lbl_septel_api=no
921 if test -r "$septel_include_dir/msg.h"; then
922 V_INCLS="$V_INCLS -I$septel_include_dir"
923 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"
924 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"
926 if test "$V_PCAP" != septel ; then
929 ac_cv_lbl_septel_api=yes
932 AC_MSG_RESULT($ac_cv_lbl_septel_api)
933 if test $ac_cv_lbl_septel_api = no; then
934 if test "$want_septel" = yes; then
935 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
938 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
942 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
943 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
947 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
948 if test "$V_LEX" = lex ; then
949 # Some versions of lex can't handle the definitions section of scanner.l .
950 # Try lexing it and complain if it can't deal.
951 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
952 if lex -t scanner.l > /dev/null 2>&1; then
953 tcpdump_cv_capable_lex=yes
955 tcpdump_cv_capable_lex=insufficient
957 if test $tcpdump_cv_capable_lex = insufficient ; then
958 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
959 libpcap. flex is a lex replacement that has many advantages, including
960 being able to compile libpcap. For more information, see
961 http://www.gnu.org/software/flex/flex.html .])
966 # Assume, by default, no support for shared libraries and V7/BSD convention
967 # for man pages (file formats in section 5, miscellaneous info in section 7).
968 # Individual cases can override this.
976 dnl Workaround to enable certain features
977 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
980 # AIX makes it fun to build shared and static libraries,
981 # because they're *both* ".a" archive libraries. We
982 # build the static library for the benefit of the traditional
983 # scheme of building libpcap and tcpdump in subdirectories of
984 # the same directory, with tcpdump statically linked with the
985 # libpcap in question, but we also build a shared library as
986 # "libpcap.shareda" and install *it*, rather than the static
987 # library, as "libpcap.a".
995 # If we're using DLPI, applications will need to
996 # use /lib/pse.exp if present, as we use the
999 pseexe="/lib/pse.exp"
1000 AC_MSG_CHECKING(for $pseexe)
1001 if test -f $pseexe ; then
1009 # If we're using BPF, we need "-lodm" and "-lcfg", as
1010 # we use them to load the BPF module.
1019 V_CCOPT="$V_CCOPT -fno-common"
1023 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1026 # Use System V conventions for man pages.
1035 # Use System V conventions for man pages.
1044 # Use System V conventions for man pages.
1051 dnl HPUX 10.20 and above is similar to HPUX 9, but
1052 dnl not the same....
1054 dnl XXX - DYEXT should be set to "sl" if this is building
1055 dnl for 32-bit PA-RISC, but should be left as "so" for
1056 dnl 64-bit PA-RISC or, I suspect, IA-64.
1057 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1058 if test "`uname -m`" = "ia64"; then
1065 # "-b" builds a shared library; "+h" sets the soname.
1071 # Use System V conventions for man pages.
1079 # Use System V conventions for man pages.
1085 linux*|freebsd*|netbsd*|openbsd*|dragonfly*)
1089 # Compiler assumed to be GCC; run-time linker may require a -R
1092 if test "$libdir" != "/usr/lib"; then
1093 V_RFLAGS=-Wl,-R$libdir
1101 # Use System V conventions for man pages.
1108 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1109 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1113 ac_cv_cc_sinix_defined=yes,
1114 ac_cv_cc_sinix_defined=no))
1115 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1116 if test $ac_cv_cc_sinix_defined = no ; then
1117 AC_DEFINE(sinix,1,[on sinix])
1122 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1126 # Use System V conventions for man pages.
1135 AC_LBL_DEVEL(V_CCOPT)
1137 AC_LBL_SOCKADDR_SA_LEN
1139 AC_LBL_SOCKADDR_STORAGE
1141 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1143 AC_LBL_UNALIGNED_ACCESS
1146 # Makefile.in includes rules to generate version.h, so we assume
1147 # that it will be generated if autoconf is used.
1149 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1152 ln -s ${srcdir}/bpf/net net
1156 AC_SUBST(V_FINDALLDEVS)
1160 AC_SUBST(V_SHLIB_CMD)
1161 AC_SUBST(V_SHLIB_OPT)
1162 AC_SUBST(V_SONAME_OPT)
1163 AC_SUBST(V_RPATH_OPT)
1166 AC_SUBST(ADDLARCHIVEOBJS)
1169 AC_SUBST(MAN_FILE_FORMATS)
1170 AC_SUBST(MAN_MISC_INFO)
1172 dnl check for USB sniffing support
1173 AC_MSG_CHECKING(for USB sniffing support)
1176 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1177 USB_SRC=pcap-usb-linux.c
1179 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1180 if test $? -ne 0 ; then
1181 ac_usb_dev_name="usbmon"
1183 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1184 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1185 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1186 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1188 # OK, does it define bRequestType? Older versions of the kernel
1189 # define fields with names like "requesttype, "request", and
1190 # "value", rather than "bRequestType", "bRequest", and
1193 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1194 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1197 #ifdef HAVE_SYS_BITYPES_H
1198 #include <sys/bitypes.h>
1200 # include <linux/usbdevice_fs.h>],
1201 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1202 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1203 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1204 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1205 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1206 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1207 [if struct usbdevfs_ctrltransfer has bRequestType])
1215 AC_SUBST(PCAP_SUPPORT_USB)
1218 AC_ARG_ENABLE([bluetooth],
1219 [AC_HELP_STRING([--enable-bluetooth],[enable bluetooth support @<:@default=yes, if support available@:>@])],
1220 ,enable_bluetooth=yes)
1222 if test "x$enable_bluetooth" != "xno" ; then
1223 dnl check for bluetooth sniffing support
1226 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1228 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1229 BT_SRC=pcap-bt-linux.c
1230 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1232 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1236 AC_MSG_NOTICE(no Bluetooth sniffing support)
1239 AC_SUBST(PCAP_SUPPORT_BT)
1245 AC_CONFIG_HEADER(config.h)
1247 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1248 pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap
1249 pcap_datalink.3pcap pcap_dump_open.3pcap
1250 pcap_list_datalinks.3pcap pcap_open_dead.3pcap
1251 pcap_open_offline.3pcap)
1253 if test -f .devel ; then