1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.138.2.30 2008-12-23 20:51:13 guy Exp $ (LBL)
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
6 dnl Process this file with autoconf to produce a configure script.
9 AC_REVISION($Revision: 1.138.2.30 $)
15 AC_LBL_C_INIT(V_CCOPT, V_INCLS, V_LIBS)
19 AC_LBL_CHECK_TYPE(u_int8_t, u_char)
20 AC_LBL_CHECK_TYPE(u_int16_t, u_short)
21 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
22 AC_LBL_CHECK_TYPE(u_int64_t, unsigned long long)
25 # Try to arrange for large file support.
31 dnl libpcap doesn't itself use <sys/ioccom.h>; however, the test program
32 dnl in "AC_LBL_FIXINCLUDES" in "aclocal.m4" uses it, so we have to
33 dnl test for it and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
34 dnl "AC_LBL_FIXINCLUDES" won't work on some platforms such as Solaris.
36 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h limits.h paths.h)
37 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
38 #include <sys/socket.h>
40 if test "$ac_cv_header_net_pfvar_h" = yes; then
42 # Check for various PF actions.
44 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
46 [#include <sys/types.h>
47 #include <sys/socket.h>
49 #include <net/pfvar.h>],
50 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
53 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
54 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
58 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
59 #include <sys/socket.h>])
60 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
62 # The simple test didn't work.
63 # Do we need to include <net/if.h> first?
64 # Unset ac_cv_header_netinet_if_ether_h so we don't
65 # treat the previous failure as a cached value and
66 # suppress the next test.
68 AC_MSG_NOTICE([Rechecking with some additional includes])
69 unset ac_cv_header_netinet_if_ether_h
70 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
71 #include <sys/socket.h>
72 #include <netinet/in.h>
80 AC_CHECK_FUNCS(strerror strlcpy)
83 AC_CHECK_FUNCS(vsnprintf snprintf,,
85 if test $needsnprintf = yes; then
90 # Do this before checking for ether_hostton(), as it's a
91 # "gethostbyname() -ish function".
96 # You are in a twisty little maze of UN*Xes, all different.
97 # Some might not have ether_hostton().
98 # Some might have it, but not declare it in any header file.
99 # Some might have it, but declare it in <netinet/if_ether.h>.
100 # Some might have it, but declare it in <netinet/ether.h>
101 # (And some might have it but document it as something declared in
102 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
104 # Before you is a C compiler.
106 AC_CHECK_FUNCS(ether_hostton)
107 if test "$ac_cv_func_ether_hostton" = yes; then
109 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
111 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
113 # Yes. Does it declare ether_hostton()?
115 AC_CHECK_DECL(ether_hostton,
117 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
118 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
121 #include <sys/types.h>
122 #include <sys/socket.h>
123 #include <netinet/in.h>
124 #include <arpa/inet.h>
128 #include <netinet/if_ether.h>
134 if test "$ac_cv_have_decl_ether_hostton" != yes; then
136 # No, how about <netinet/ether.h>, as on Linux?
138 AC_CHECK_HEADERS(netinet/ether.h)
139 if test "$ac_cv_header_netinet_ether_h" = yes; then
141 # We have it - does it declare ether_hostton()?
142 # Unset ac_cv_have_decl_ether_hostton so we don't
143 # treat the previous failure as a cached value and
144 # suppress the next test.
146 unset ac_cv_have_decl_ether_hostton
147 AC_CHECK_DECL(ether_hostton,
149 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
150 [Define to 1 if netinet/ether.h declares `ether_hostton'])
153 #include <netinet/ether.h>
158 # Is ether_hostton() declared?
160 if test "$ac_cv_have_decl_ether_hostton" != yes; then
162 # No, we'll have to declare it ourselves.
163 # Do we have "struct ether_addr"?
165 AC_CHECK_TYPES(struct ether_addr,,,
167 #include <sys/types.h>
168 #include <sys/socket.h>
169 #include <netinet/in.h>
170 #include <arpa/inet.h>
174 #include <netinet/if_ether.h>
176 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
177 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
180 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
181 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
186 dnl to pacify those who hate protochain insn
187 AC_MSG_CHECKING(if --disable-protochain option is specified)
188 AC_ARG_ENABLE(protochain,
189 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
190 case "x$enable_protochain" in
191 xyes) enable_protochain=enabled ;;
192 xno) enable_protochain=disabled ;;
193 x) enable_protochain=enabled ;;
196 if test "$enable_protochain" = "disabled"; then
197 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
199 AC_MSG_RESULT(${enable_protochain})
202 # SITA support is mutually exclusive with native capture support;
203 # "--with-sita" selects SITA support.
206 AC_HELP_STRING([--with-sita],[include SITA support]),
208 if test ! "x$withval" = "xno" ; then
209 AC_DEFINE(SITA,1,[include ACN support])
210 AC_MSG_NOTICE(Enabling SITA ACN support)
217 dnl Not all versions of test support -c (character special) but it's a
218 dnl better way of testing since the device might be protected. So we
219 dnl check in our normal order using -r and then check the for the /dev
220 dnl guys again using -c.
222 dnl XXX This could be done for cross-compiling, but for now it's not.
224 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
225 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
228 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
229 AC_MSG_CHECKING(packet capture type)
230 if test ! -z "$with_pcap" ; then
232 elif test -r /dev/bpf ; then
234 # Cloning BPF device.
237 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
238 elif test -r /dev/bpf0 ; then
240 elif test -r /usr/include/net/pfilt.h ; then
242 elif test -r /dev/enet ; then
244 elif test -r /dev/nit ; then
246 elif test -r /usr/include/sys/net/nit.h ; then
248 elif test -r /usr/include/linux/socket.h ; then
250 elif test -r /usr/include/net/raw.h ; then
252 elif test -r /usr/include/odmi.h ; then
254 # On AIX, the BPF devices might not yet be present - they're
255 # created the first time libpcap runs after booting.
256 # We check for odmi.h instead.
259 elif test -r /usr/include/sys/dlpi.h ; then
261 elif test -c /dev/bpf0 ; then # check again in case not readable
263 elif test -c /dev/enet ; then # check again in case not readable
265 elif test -c /dev/nit ; then # check again in case not readable
270 AC_MSG_RESULT($V_PCAP)
273 # Do capture-mechanism-dependent tests.
278 # Checks to see if Solaris has the public libdlpi(3LIB) library.
279 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
280 # public libdlpi(3LIB) version. Before libdlpi was made public, a
281 # private version also existed, which did not have the same APIs.
282 # Due to a gcc bug, the default search path for 32-bit libraries does
283 # not include /lib, we add it explicitly here.
284 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
285 # Also, due to the bug above applications that link to libpcap with
286 # libdlpi will have to add "-L/lib" option to "configure".
288 saved_ldflags=$LDFLAGS
289 LDFLAGS="$LIBS -L/lib"
290 AC_CHECK_LIB(dlpi, dlpi_walk,
293 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists]),
295 LDFLAGS=$saved_ldflags
298 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
301 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
302 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
305 #include <sys/types.h>
306 #include <sys/time.h>
307 #include <sys/dlpi.h>
309 [int i = DL_PROMISC_PHYS;],
310 ac_cv_sys_dlpi_usable=yes,
311 ac_cv_sys_dlpi_usable=no))
312 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
313 if test $ac_cv_sys_dlpi_usable = no ; then
314 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
318 # Check whether we have a /dev/dlpi device or have multiple devices.
320 AC_MSG_CHECKING(for /dev/dlpi device)
321 if test -c /dev/dlpi ; then
323 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
327 AC_MSG_CHECKING(for $dir directory)
328 if test -d $dir ; then
330 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
337 # This check is for Solaris with DLPI support for passive modes.
338 # See dlpi(7P) for more details.
340 AC_LBL_DL_PASSIVE_REQ_T
344 AC_MSG_CHECKING(Linux kernel version)
345 if test "$cross_compiling" = yes; then
346 AC_CACHE_VAL(ac_cv_linux_vers,
347 ac_cv_linux_vers=unknown)
349 AC_CACHE_VAL(ac_cv_linux_vers,
350 ac_cv_linux_vers=`uname -r 2>&1 | \
351 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
353 AC_MSG_RESULT($ac_cv_linux_vers)
354 if test $ac_cv_linux_vers = unknown ; then
355 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
357 if test $ac_cv_linux_vers -lt 2 ; then
358 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
360 AC_CHECK_HEADERS(linux/wireless.h, [], [],
362 #include <sys/socket.h>
363 #include <linux/if.h>
364 #include <linux/types.h>
367 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
372 # Check whether we have the *BSD-style ioctls.
374 AC_CHECK_HEADERS(net/if_media.h)
376 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
378 [#include <sys/socket.h>
379 #include <sys/ioctl.h>
381 #include <net/bpf.h>],
382 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
385 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
386 [define if the system supports zerocopy BPF])
392 V_DEFS="$V_DEFS -DDAG_ONLY"
396 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
400 AC_MSG_WARN(cannot determine packet capture interface)
401 AC_MSG_WARN((see the INSTALL doc for more info))
406 dnl Now figure out how we get a list of interfaces and addresses,
407 dnl if we support capturing. Don't bother if we don't support
410 if test "$V_PCAP" = null
413 # We can't capture, so we can't open any capture
414 # devices, so we won't return any interfaces.
418 AC_CHECK_FUNC(getifaddrs,[
420 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
421 # as well, just in case some platform is really weird.
423 AC_CHECK_HEADER(ifaddrs.h,[
425 # We have the header, so we use "getifaddrs()" to
426 # get the list of interfaces.
431 # We don't have the header - give up.
432 # XXX - we could also fall back on some other
433 # mechanism, but, for now, this'll catch this
434 # problem so that we can at least try to figure
435 # out something to do on systems with "getifaddrs()"
436 # but without "ifaddrs.h", if there is something
437 # we can do on those systems.
439 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
443 # Well, we don't have "getifaddrs()", so we have to use
444 # some other mechanism; determine what that mechanism is.
446 # The first thing we use is the type of capture mechanism,
447 # which is somewhat of a proxy for the OS we're using.
452 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
454 # This might be Solaris 8 or later, with
455 # SIOCGLIFCONF, or it might be some other OS
456 # or some older version of Solaris, with
459 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
460 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
462 [#include <sys/param.h>
463 #include <sys/file.h>
464 #include <sys/ioctl.h>
465 #include <sys/socket.h>
466 #include <sys/sockio.h>],
467 [ioctl(0, SIOCGLIFCONF, (char *)0);],
468 ac_cv_lbl_have_siocglifconf=yes,
469 ac_cv_lbl_have_siocglifconf=no))
470 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
471 if test $ac_cv_lbl_have_siocglifconf = yes ; then
477 # Needed for common functions used by pcap-[dlpi,libdlpi].c
484 # Assume we just have SIOCGIFCONF.
485 # (XXX - on at least later Linux kernels, there's
486 # another mechanism, and we should be using that
495 AC_MSG_CHECKING(for socklen_t)
497 #include <sys/types.h>
498 #include <sys/socket.h>
503 if test "x$have_socklen_t" = "xyes"; then
504 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
506 AC_MSG_RESULT($have_socklen_t)
509 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
511 [enable_ipv6=ifavailable])
512 if test "$enable_ipv6" != "no"; then
513 AC_CHECK_FUNC(getaddrinfo,
515 AC_DEFINE(INET6,1,[IPv6])
518 if test "$enable_ipv6" != "ifavailable"; then
519 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
524 AC_MSG_CHECKING(whether to build optimizer debugging code)
525 AC_ARG_ENABLE(optimizer-dbg,
526 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
527 if test "$enable_optimizer_dbg" = "yes"; then
528 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
530 AC_MSG_RESULT(${enable_optimizer_dbg-no})
532 AC_MSG_CHECKING(whether to build parser debugging code)
533 AC_ARG_ENABLE(yydebug,
534 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
535 if test "$enable_yydebug" = "yes"; then
536 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
538 AC_MSG_RESULT(${enable_yydebug-no})
540 AC_MSG_CHECKING(whether we have /proc/net/dev)
541 if test -r /proc/net/dev ; then
542 ac_cv_lbl_proc_net_dev=yes
544 ac_cv_lbl_proc_net_dev=no
546 if test $ac_cv_lbl_proc_net_dev = yes; then
547 AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev])
549 AC_MSG_RESULT($ac_cv_lbl_proc_net_dev)
551 # Check for Endace DAG card support.
553 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support @<:@"yes", "no" or DIR; default="yes" on BSD and Linux if present@:>@]),
555 if test "$withval" = no
557 # User doesn't want DAG support.
559 elif test "$withval" = yes
561 # User wants DAG support but hasn't specified a directory.
564 # User wants DAG support and has specified a directory, so use the provided value.
570 # Use DAG API if present, otherwise don't
575 AC_ARG_WITH([dag-includes],
576 AC_HELP_STRING([--with-dag-includes=DIR],[Endace DAG include directory]),
578 # User wants DAG support and has specified a header directory, so use the provided value.
580 dag_include_dir=$withval
583 AC_ARG_WITH([dag-libraries],
584 AC_HELP_STRING([--with-dag-libraries=DIR],[Endace DAG library directory]),
586 # User wants DAG support and has specified a library directory, so use the provided value.
594 # We support the DAG API if we're on Linux or BSD, or if we're
595 # building a DAG-only libpcap.
600 # If the user explicitly requested DAG, tell them it's not
603 # If they expressed no preference, don't include it.
605 if test $want_dag = yes; then
606 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
607 elif test $want_dag = yes; then
614 if test "$want_dag" != no; then
616 AC_MSG_CHECKING([whether we have DAG API headers])
618 # If necessary, set default paths for DAG API headers and libraries.
619 if test -z "$dag_root"; then
623 if test -z "$dag_include_dir"; then
624 dag_include_dir="$dag_root/include"
627 if test -z "$dag_lib_dir"; then
628 dag_lib_dir="$dag_root/lib"
631 if test -z "$dag_tools_dir"; then
632 dag_tools_dir="$dag_root/tools"
635 if test -r $dag_include_dir/dagapi.h; then
636 ac_cv_lbl_dag_api=yes
638 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
641 if test $ac_cv_lbl_dag_api = yes; then
643 AC_MSG_CHECKING([dagapi.o])
645 if test -r $dag_tools_dir/dagapi.o; then
647 dagapi_obj=$dag_tools_dir/dagapi.o
648 elif test -r $dag_lib_dir/dagapi.o; then
650 dagapi_obj=$dag_lib_dir/dagapi.o
651 elif test -r $dag_lib_dir/libdag.a; then
653 ar x $dag_lib_dir/libdag.a dagapi.o 2>/dev/null
654 if test -r ./dagapi.o; then
655 dagapi_obj=./dagapi.o
657 ar x $dag_lib_dir/libdag.a libdag_la-dagapi.o 2>/dev/null
658 if test -r ./libdag_la-dagapi.o; then
659 dagapi_obj=./libdag_la-dagapi.o
664 if test $dagapi_obj = no; then
665 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
668 AC_MSG_RESULT([yes ($dagapi_obj)])
672 if test $ac_cv_lbl_dag_api = yes; then
674 AC_MSG_CHECKING([dagopts.o])
676 if test -r $dag_tools_dir/dagopts.o; then
678 dagopts_obj=$dag_tools_dir/dagopts.o
679 elif test -r $dag_lib_dir/dagopts.o; then
681 dagopts_obj=$dag_lib_dir/dagopts.o
682 elif test -r $dag_lib_dir/libdag.a; then
684 ar x $dag_lib_dir/libdag.a dagopts.o 2>/dev/null
685 if test -r ./dagopts.o; then
686 dagopts_obj=./dagopts.o
688 ar x $dag_lib_dir/libdag.a libdag_la-dagopts.o 2>/dev/null
689 if test -r ./libdag_la-dagopts.o; then
690 dagopts_obj=./libdag_la-dagopts.o
695 if test $dagopts_obj = no; then
696 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
699 AC_MSG_RESULT([yes ($dagopts_obj)])
703 if test $ac_cv_lbl_dag_api = yes; then
704 # Under 2.5.x only we need to add dagreg.o.
705 if test -r $dag_include_dir/dagreg.h; then
706 AC_MSG_CHECKING([dagreg.o])
708 if test -r $dag_lib_dir/dagreg.o; then
709 # Object file is ready and waiting.
710 dagreg_obj=$dag_lib_dir/dagreg.o
711 elif test -r $dag_lib_dir/libdag.a; then
712 # Extract from libdag.a.
713 ar x $dag_lib_dir/libdag.a dagreg.o 2>/dev/null
714 if test -r ./dagreg.o; then
715 dagreg_obj=./dagreg.o
717 ar x $dag_lib_dir/libdag.a libdag_la-dagreg.o 2>/dev/null
718 if test -r ./libdag_la-dagreg.o; then
719 dagreg_obj=./libdag_la-dagreg.o
724 if test $dagreg_obj = no; then
725 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
728 AC_MSG_RESULT([yes ($dagreg_obj)])
733 if test $ac_cv_lbl_dag_api = yes; then
734 V_INCLS="$V_INCLS -I$dag_include_dir"
735 V_LIBS="$V_LIBS $dagapi_obj $dagopts_obj $dagreg_obj"
736 if test $V_PCAP != dag ; then
740 # See if we can find a general version string.
741 # Don't need to save and restore LIBS to prevent -ldag being
742 # included if there's a found-action (arg 3).
743 saved_ldflags=$LDFLAGS
744 LDFLAGS="-L$dag_lib_dir"
745 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
746 AC_CHECK_LIB([dag],[dag_get_erf_types], [
747 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
748 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
749 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
750 LDFLAGS=$saved_ldflags
752 if test "$dag_streams" = 1; then
753 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
757 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
760 AC_MSG_CHECKING(whether we have the DAG API)
762 if test $ac_cv_lbl_dag_api = no; then
764 if test "$want_dag" = yes; then
765 # User wanted DAG support but we couldn't find it.
766 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
769 if test "$V_PCAP" = dag; then
770 # User requested "dag" capture type but the DAG API wasn't
772 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.)])
779 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, on Linux, if present@:>@]),
781 if test "$withval" = no
784 elif test "$withval" = yes
794 # Use Septel API if present, otherwise don't
796 want_septel=ifpresent
797 septel_root=./../septel
799 ac_cv_lbl_septel_api=no
803 # We support the Septel API if we're on Linux, or if we're building
804 # a Septel-only libpcap.
809 # If the user explicitly requested Septel, tell them it's not
812 # If they expressed no preference, don't include it.
814 if test $want_septel = yes; then
815 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
816 elif test $want_septel = yes; then
822 if test "$with_septel" != no; then
823 AC_MSG_CHECKING(whether we have Septel API)
825 if test -z "$septel_root"; then
826 septel_root=$srcdir/../septel
830 septel_tools_dir="$septel_root"
831 septel_include_dir="$septel_root/INC"
832 DEF="-DHAVE_SEPTEL_API"
834 ac_cv_lbl_septel_api=no
835 if test -r "$septel_include_dir/msg.h"; then
836 V_INCLS="$V_INCLS -I$septel_include_dir"
837 V_DEFS="$V_DEFS $DEF"
838 V_LIBS="$V_LIBS $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 "
840 if test "$V_PCAP" != septel ; then
844 ac_cv_lbl_septel_api=yes
847 AC_MSG_RESULT($ac_cv_lbl_septel_api)
848 if test $ac_cv_lbl_septel_api = no; then
849 if test "$want_septel" = yes; then
850 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
853 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
857 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
858 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
862 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
863 if test "$V_LEX" = lex ; then
864 # Some versions of lex can't handle the definitions section of scanner.l .
865 # Try lexing it and complain if it can't deal.
866 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
867 if lex -t scanner.l > /dev/null 2>&1; then
868 tcpdump_cv_capable_lex=yes
870 tcpdump_cv_capable_lex=insufficient
872 if test $tcpdump_cv_capable_lex = insufficient ; then
873 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
874 libpcap. flex is a lex replacement that has many advantages, including
875 being able to compile libpcap. For more information, see
876 http://www.gnu.org/software/flex/flex.html .])
881 # Assume a.out/ELF convention for shared library names (".so"), and
882 # V7/BSD convention for man pages (file formats in section 5,
883 # miscellaneous info in section 7).
891 dnl Workaround to enable certain features
892 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
894 # We need "-lodm" and "-lcfg", as libpcap requires them on
896 DEPLIBS="-lodm -lcfg"
901 V_CCOPT="$V_CCOPT -fno-common"
905 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
908 # Use System V conventions for man pages.
917 # Use System V conventions for man pages.
926 # Use System V conventions for man pages.
933 dnl HPUX 10.20 and above is similar to HPUX 9, but
936 dnl XXX - DYEXT should be set to "sl" if this is building
937 dnl for 32-bit PA-RISC, but should be left as "so" for
938 dnl 64-bit PA-RISC or, I suspect, IA-64.
939 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
942 # Use System V conventions for man pages.
950 # Use System V conventions for man pages.
957 V_CCOPT="$V_CCOPT -fPIC"
962 # Use System V conventions for man pages.
969 AC_MSG_CHECKING(if SINIX compiler defines sinix)
970 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
974 ac_cv_cc_sinix_defined=yes,
975 ac_cv_cc_sinix_defined=no))
976 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
977 if test $ac_cv_cc_sinix_defined = no ; then
978 AC_DEFINE(sinix,1,[on sinix])
983 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
986 # Use System V conventions for man pages.
995 AC_LBL_DEVEL(V_CCOPT)
997 AC_LBL_SOCKADDR_SA_LEN
999 AC_LBL_SOCKADDR_STORAGE
1001 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1003 AC_LBL_UNALIGNED_ACCESS
1006 # Makefile.in includes rules to generate version.h, so we assume
1007 # that it will be generated if autoconf is used.
1009 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1012 ln -s ${srcdir}/bpf/net net
1020 AC_SUBST(V_FINDALLDEVS)
1026 AC_SUBST(MAN_FILE_FORMATS)
1027 AC_SUBST(MAN_MISC_INFO)
1029 dnl check for USB sniffing support
1030 AC_MSG_CHECKING(for USB sniffing support)
1033 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1034 USB_SRC=pcap-usb-linux.c
1036 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1037 if test $? -ne 0 ; then
1038 ac_usb_dev_name="usbmon"
1040 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1041 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1042 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1048 AC_SUBST(PCAP_SUPPORT_USB)
1051 AC_ARG_ENABLE([bluetooth],
1052 [AC_HELP_STRING([--enable-bluetooth],[enable bluetooth support @<:@default=yes, if support available@:>@])],
1053 ,enable_bluetooth=yes)
1055 if test "x$enable_bluetooth" != "xno" ; then
1056 dnl check for bluetooth sniffing support
1059 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1061 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1062 BT_SRC=pcap-bt-linux.c
1063 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1065 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1069 AC_MSG_NOTICE(no Bluetooth sniffing support)
1072 AC_SUBST(PCAP_SUPPORT_BT)
1078 AC_CONFIG_HEADER(config.h)
1080 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1081 pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap
1082 pcap_datalink.3pcap pcap_dump_open.3pcap
1083 pcap_list_datalinks.3pcap pcap_open_dead.3pcap
1084 pcap_open_offline.3pcap)
1086 if test -f .devel ; then