1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.138.2.12 2008-04-05 04:56:59 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.12 $)
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, [ --disable-protochain disable \"protochain\" insn])
189 case "x$enable_protochain" in
190 xyes) enable_protochain=enabled ;;
191 xno) enable_protochain=disabled ;;
192 x) enable_protochain=enabled ;;
195 if test "$enable_protochain" = "disabled"; then
196 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
198 AC_MSG_RESULT(${enable_protochain})
201 # SITA support is mutually exclusive with native capture support;
202 # "--with-sita" selects SITA support.
204 AC_ARG_WITH(sita, [ --with-sita include SITA support],
206 AC_DEFINE(SITA,1,[include ACN support])
207 AC_MSG_NOTICE(Enabling SITA ACN support)
213 dnl Not all versions of test support -c (character special) but it's a
214 dnl better way of testing since the device might be protected. So we
215 dnl check in our normal order using -r and then check the for the /dev
216 dnl guys again using -c.
218 dnl XXX This could be done for cross-compiling, but for now it's not.
220 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
221 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
223 AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
224 AC_MSG_CHECKING(packet capture type)
225 if test ! -z "$with_pcap" ; then
227 elif test -r /dev/bpf ; then
229 # Cloning BPF device.
232 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
233 elif test -r /dev/bpf0 ; then
235 elif test -r /usr/include/net/pfilt.h ; then
237 elif test -r /dev/enet ; then
239 elif test -r /dev/nit ; then
241 elif test -r /usr/include/sys/net/nit.h ; then
243 elif test -r /usr/include/linux/socket.h ; then
245 elif test -r /usr/include/net/raw.h ; then
247 elif test -r /usr/include/odmi.h ; then
249 # On AIX, the BPF devices might not yet be present - they're
250 # created the first time libpcap runs after booting.
251 # We check for odmi.h instead.
254 elif test -r /usr/include/sys/dlpi.h ; then
256 elif test -c /dev/bpf0 ; then # check again in case not readable
258 elif test -c /dev/enet ; then # check again in case not readable
260 elif test -c /dev/nit ; then # check again in case not readable
265 AC_MSG_RESULT($V_PCAP)
267 if test "$V_PCAP" = dlpi
270 # Checks to see if Solaris has the public libdlpi(3LIB) library.
271 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
272 # public libdlpi(3LIB) version. Before libdlpi was made public, a
273 # private version also existed, which did not have the same APIs.
274 # Due to a gcc bug, the default search path for 32-bit libraries does
275 # not include /lib, we add it explicitly here.
276 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
277 # Also, due to the bug above applications that link to libpcap with
278 # libdlpi will have to add "-L/lib" option to "configure".
280 saved_ldflags=$LDFLAGS
281 LDFLAGS="$LIBS -L/lib"
282 AC_CHECK_LIB(dlpi, dlpi_walk,
285 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists]),
287 LDFLAGS=$saved_ldflags
291 dnl Now figure out how we get a list of interfaces and addresses,
292 dnl if we support capturing. Don't bother if we don't support
295 if test "$V_PCAP" = null
298 # We can't capture, so we can't open any capture
299 # devices, so we won't return any interfaces.
303 AC_CHECK_FUNC(getifaddrs,[
305 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
306 # as well, just in case some platform is really weird.
308 AC_CHECK_HEADER(ifaddrs.h,[
310 # We have the header, so we use "getifaddrs()" to
311 # get the list of interfaces.
316 # We don't have the header - give up.
317 # XXX - we could also fall back on some other
318 # mechanism, but, for now, this'll catch this
319 # problem so that we can at least try to figure
320 # out something to do on systems with "getifaddrs()"
321 # but without "ifaddrs.h", if there is something
322 # we can do on those systems.
324 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
328 # Well, we don't have "getifaddrs()", so we have to use
329 # some other mechanism; determine what that mechanism is.
331 # The first thing we use is the type of capture mechanism,
332 # which is somewhat of a proxy for the OS we're using.
337 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
339 # This might be Solaris 8 or later, with
340 # SIOCGLIFCONF, or it might be some other OS
341 # or some older version of Solaris, with
344 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
345 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
347 [#include <sys/param.h>
348 #include <sys/file.h>
349 #include <sys/ioctl.h>
350 #include <sys/socket.h>
351 #include <sys/sockio.h>],
352 [ioctl(0, SIOCGLIFCONF, (char *)0);],
353 ac_cv_lbl_have_siocglifconf=yes,
354 ac_cv_lbl_have_siocglifconf=no))
355 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
356 if test $ac_cv_lbl_have_siocglifconf = yes ; then
362 # Needed for common functions used by pcap-[dlpi,libdlpi].c
369 # Assume we just have SIOCGIFCONF.
370 # (XXX - on at least later Linux kernels, there's
371 # another mechanism, and we should be using that
380 AC_MSG_CHECKING(for socklen_t)
382 #include <sys/types.h>
383 #include <sys/socket.h>
388 if test "x$have_socklen_t" = "xyes"; then
389 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
391 AC_MSG_RESULT($have_socklen_t)
393 AC_MSG_CHECKING(if --enable-ipv6 option is specified)
394 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version])
395 if test "$enable_ipv6" = "yes"; then
396 AC_DEFINE(INET6,1,[IPv6])
398 AC_MSG_RESULT(${enable_ipv6-no})
400 AC_MSG_CHECKING(whether to build optimizer debugging code)
401 AC_ARG_ENABLE(optimizer-dbg, [ --enable-optimizer-dbg build optimizer debugging code])
402 if test "$enable_optimizer_dbg" = "yes"; then
403 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
405 AC_MSG_RESULT(${enable_optimizer_dbg-no})
407 AC_MSG_CHECKING(whether to build parser debugging code)
408 AC_ARG_ENABLE(yydebug, [ --enable-yydebug build parser debugging code])
409 if test "$enable_yydebug" = "yes"; then
410 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
412 AC_MSG_RESULT(${enable_yydebug-no})
417 AC_MSG_CHECKING(for /dev/dlpi device)
418 if test -c /dev/dlpi ; then
420 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
424 AC_MSG_CHECKING(for $dir directory)
425 if test -d $dir ; then
427 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
433 # This check is for Solaris with DLPI support for passive modes.
434 # See dlpi(7P) for more details.
436 AC_LBL_DL_PASSIVE_REQ_T
440 AC_MSG_CHECKING(Linux kernel version)
441 if test "$cross_compiling" = yes; then
442 AC_CACHE_VAL(ac_cv_linux_vers,
443 ac_cv_linux_vers=unknown)
445 AC_CACHE_VAL(ac_cv_linux_vers,
446 ac_cv_linux_vers=`uname -r 2>&1 | \
447 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
449 AC_MSG_RESULT($ac_cv_linux_vers)
450 if test $ac_cv_linux_vers = unknown ; then
451 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
453 if test $ac_cv_linux_vers -lt 2 ; then
454 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
456 AC_CHECK_HEADERS(linux/wireless.h, [], [],
458 #include <sys/socket.h>
460 #include <linux/types.h>
468 # Check whether we have the *BSD-style ioctls.
470 AC_CHECK_HEADERS(net/if_media.h)
474 V_DEFS="$V_DEFS -DDAG_ONLY"
478 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
482 AC_MSG_WARN(cannot determine packet capture interface)
483 AC_MSG_WARN((see the INSTALL doc for more info))
488 AC_MSG_CHECKING(whether we have /proc/net/dev)
489 if test -r /proc/net/dev ; then
490 ac_cv_lbl_proc_net_dev=yes
492 ac_cv_lbl_proc_net_dev=no
494 if test $ac_cv_lbl_proc_net_dev = yes; then
495 AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev])
497 AC_MSG_RESULT($ac_cv_lbl_proc_net_dev)
499 # Check for Endace DAG card support.
500 AC_ARG_WITH([dag], [ --with-dag[[=DIR]] include Endace DAG support ("yes", "no" or DIR; default="yes" on BSD and Linux if present)],
502 if test "$withval" = no
504 # User doesn't want DAG support.
506 elif test "$withval" = yes
508 # User wants DAG support but hasn't specified a directory.
511 # User wants DAG support and has specified a directory, so use the provided value.
517 # Use DAG API if present, otherwise don't
522 AC_ARG_WITH([dag-includes], [ --with-dag-includes=DIR Endace DAG include directory],
524 # User wants DAG support and has specified a header directory, so use the provided value.
526 dag_include_dir=$withval
529 AC_ARG_WITH([dag-libraries], [ --with-dag-libraries=DIR Endace DAG library directory],
531 # User wants DAG support and has specified a library directory, so use the provided value.
539 # We support the DAG API if we're on Linux or BSD, or if we're
540 # building a DAG-only libpcap.
545 # If the user explicitly requested DAG, tell them it's not
548 # If they expressed no preference, don't include it.
550 if test $want_dag = yes; then
551 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
552 elif test $want_dag = yes; then
559 if test "$want_dag" != no; then
561 AC_MSG_CHECKING([whether we have DAG API headers])
563 # If necessary, set default paths for DAG API headers and libraries.
564 if test -z "$dag_root"; then
568 if test -z "$dag_include_dir"; then
569 dag_include_dir="$dag_root/include"
572 if test -z "$dag_lib_dir"; then
573 dag_lib_dir="$dag_root/lib"
576 if test -z "$dag_tools_dir"; then
577 dag_tools_dir="$dag_root/tools"
580 if test -r $dag_include_dir/dagapi.h; then
581 ac_cv_lbl_dag_api=yes
583 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
586 if test $ac_cv_lbl_dag_api = yes; then
588 AC_MSG_CHECKING([dagapi.o])
590 if test -r $dag_tools_dir/dagapi.o; then
592 dagapi_obj=$dag_tools_dir/dagapi.o
593 elif test -r $dag_lib_dir/dagapi.o; then
595 dagapi_obj=$dag_lib_dir/dagapi.o
596 elif test -r $dag_lib_dir/libdag.a; then
598 ar x $dag_lib_dir/libdag.a dagapi.o 2>/dev/null
599 if test -r ./dagapi.o; then
600 dagapi_obj=./dagapi.o
602 ar x $dag_lib_dir/libdag.a libdag_la-dagapi.o 2>/dev/null
603 if test -r ./libdag_la-dagapi.o; then
604 dagapi_obj=./libdag_la-dagapi.o
609 if test $dagapi_obj = no; then
610 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
613 AC_MSG_RESULT([yes ($dagapi_obj)])
617 if test $ac_cv_lbl_dag_api = yes; then
619 AC_MSG_CHECKING([dagopts.o])
621 if test -r $dag_tools_dir/dagopts.o; then
623 dagopts_obj=$dag_tools_dir/dagopts.o
624 elif test -r $dag_lib_dir/dagopts.o; then
626 dagopts_obj=$dag_lib_dir/dagopts.o
627 elif test -r $dag_lib_dir/libdag.a; then
629 ar x $dag_lib_dir/libdag.a dagopts.o 2>/dev/null
630 if test -r ./dagopts.o; then
631 dagopts_obj=./dagopts.o
633 ar x $dag_lib_dir/libdag.a libdag_la-dagopts.o 2>/dev/null
634 if test -r ./libdag_la-dagopts.o; then
635 dagopts_obj=./libdag_la-dagopts.o
640 if test $dagopts_obj = no; then
641 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
644 AC_MSG_RESULT([yes ($dagopts_obj)])
648 if test $ac_cv_lbl_dag_api = yes; then
649 # Under 2.5.x only we need to add dagreg.o.
650 if test -r $dag_include_dir/dagreg.h; then
651 AC_MSG_CHECKING([dagreg.o])
653 if test -r $dag_lib_dir/dagreg.o; then
654 # Object file is ready and waiting.
655 dagreg_obj=$dag_lib_dir/dagreg.o
656 elif test -r $dag_lib_dir/libdag.a; then
657 # Extract from libdag.a.
658 ar x $dag_lib_dir/libdag.a dagreg.o 2>/dev/null
659 if test -r ./dagreg.o; then
660 dagreg_obj=./dagreg.o
662 ar x $dag_lib_dir/libdag.a libdag_la-dagreg.o 2>/dev/null
663 if test -r ./libdag_la-dagreg.o; then
664 dagreg_obj=./libdag_la-dagreg.o
669 if test $dagreg_obj = no; then
670 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
673 AC_MSG_RESULT([yes ($dagreg_obj)])
678 if test $ac_cv_lbl_dag_api = yes; then
679 V_INCLS="$V_INCLS -I$dag_include_dir"
680 V_LIBS="$V_LIBS $dagapi_obj $dagopts_obj $dagreg_obj"
681 if test $V_PCAP != dag ; then
685 # See if we can find a general version string.
686 # Don't need to save and restore LIBS to prevent -ldag being
687 # included if there's a found-action (arg 3).
688 saved_ldflags=$LDFLAGS
689 LDFLAGS="-L$dag_lib_dir"
690 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
691 AC_CHECK_LIB([dag],[dag_get_erf_types], [
692 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
693 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
694 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
695 LDFLAGS=$saved_ldflags
697 if test "$dag_streams" = 1; then
698 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
702 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
705 AC_MSG_CHECKING(whether we have the DAG API)
707 if test $ac_cv_lbl_dag_api = no; then
709 if test "$want_dag" = yes; then
710 # User wanted DAG support but we couldn't find it.
711 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
714 if test "$V_PCAP" = dag; then
715 # User requested "dag" capture type but the DAG API wasn't
717 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.)])
723 AC_ARG_WITH(septel, [ --with-septel[[=DIR]] include Septel support (located in directory DIR, if supplied). [default=yes, on Linux, if present]],
725 if test "$withval" = no
728 elif test "$withval" = yes
738 # Use Septel API if present, otherwise don't
740 want_septel=ifpresent
741 septel_root=./../septel
743 ac_cv_lbl_septel_api=no
747 # We support the Septel API if we're on Linux, or if we're building
748 # a Septel-only libpcap.
753 # If the user explicitly requested Septel, tell them it's not
756 # If they expressed no preference, don't include it.
758 if test $want_septel = yes; then
759 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
760 elif test $want_septel = yes; then
766 if test "$with_septel" != no; then
767 AC_MSG_CHECKING(whether we have Septel API)
769 if test -z "$septel_root"; then
770 septel_root=$srcdir/../septel
774 septel_tools_dir="$septel_root"
775 septel_include_dir="$septel_root/INC"
776 DEF="-DHAVE_SEPTEL_API"
778 ac_cv_lbl_septel_api=no
779 if test -r "$septel_include_dir/msg.h"; then
780 V_INCLS="$V_INCLS -I$septel_include_dir"
781 V_DEFS="$V_DEFS $DEF"
782 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 "
784 if test "$V_PCAP" != septel ; then
788 ac_cv_lbl_septel_api=yes
791 AC_MSG_RESULT($ac_cv_lbl_septel_api)
792 if test $ac_cv_lbl_septel_api = no; then
793 if test "$want_septel" = yes; then
794 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
797 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
801 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
802 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
806 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
807 if test "$V_LEX" = lex ; then
808 # Some versions of lex can't handle the definitions section of scanner.l .
809 # Try lexing it and complain if it can't deal.
810 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
811 if lex -t scanner.l > /dev/null 2>&1; then
812 tcpdump_cv_capable_lex=yes
814 tcpdump_cv_capable_lex=insufficient
816 if test $tcpdump_cv_capable_lex = insufficient ; then
817 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
818 libpcap. flex is a lex replacement that has many advantages, including
819 being able to compile libpcap. For more information, see
820 http://www.gnu.org/software/flex/flex.html .])
828 dnl Workaround to enable certain features
829 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
833 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
843 dnl HPUX 10.20 and above is similar to HPUX 9, but
846 dnl XXX - DYEXT should be set to "sl" if this is building
847 dnl for 32-bit PA-RISC, but should be left as "so" for
848 dnl 64-bit PA-RISC or, I suspect, IA-64.
849 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
853 AC_MSG_CHECKING(if SINIX compiler defines sinix)
854 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
858 ac_cv_cc_sinix_defined=yes,
859 ac_cv_cc_sinix_defined=no))
860 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
861 if test $ac_cv_cc_sinix_defined = no ; then
862 AC_DEFINE(sinix,1,[on sinix])
867 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
872 V_CCOPT="$V_CCOPT -fno-common"
876 V_CCOPT="$V_CCOPT -fPIC"
883 AC_LBL_DEVEL(V_CCOPT)
885 AC_LBL_SOCKADDR_SA_LEN
887 AC_LBL_SOCKADDR_STORAGE
889 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
891 AC_LBL_UNALIGNED_ACCESS
894 # Makefile.in includes rules to generate version.h, so we assume
895 # that it will be generated if autoconf is used.
897 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
900 ln -s ${srcdir}/bpf/net net
908 AC_SUBST(V_FINDALLDEVS)
914 dnl check for USB sniffing support
915 AC_MSG_CHECKING(for USB sniffing support)
918 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
919 USB_SRC=pcap-usb-linux.c
921 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
922 if test $? -ne 0 ; then
923 ac_usb_dev_name="usbmon"
925 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
926 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
932 AC_SUBST(PCAP_SUPPORT_USB)
935 dnl check for bluetooth sniffing support
938 AC_CHECK_HEADER(bluetooth/bluetooth.h,
940 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
941 BT_SRC=pcap-bt-linux.c
942 AC_MSG_NOTICE(Bluetooth sniffing is supported)
944 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
948 AC_MSG_NOTICE(no Bluetooth sniffing support)
951 AC_SUBST(PCAP_SUPPORT_BT)
956 AC_CONFIG_HEADER(config.h)
960 if test -f .devel ; then