1 dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.138.2.22 2008-10-24 07:30:18 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.22 $)
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)
268 # Do capture-mechanism-dependent tests.
273 # Checks to see if Solaris has the public libdlpi(3LIB) library.
274 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
275 # public libdlpi(3LIB) version. Before libdlpi was made public, a
276 # private version also existed, which did not have the same APIs.
277 # Due to a gcc bug, the default search path for 32-bit libraries does
278 # not include /lib, we add it explicitly here.
279 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
280 # Also, due to the bug above applications that link to libpcap with
281 # libdlpi will have to add "-L/lib" option to "configure".
283 saved_ldflags=$LDFLAGS
284 LDFLAGS="$LIBS -L/lib"
285 AC_CHECK_LIB(dlpi, dlpi_walk,
288 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists]),
290 LDFLAGS=$saved_ldflags
293 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
296 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
297 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
300 #include <sys/types.h>
301 #include <sys/time.h>
302 #include <sys/dlpi.h>
304 [int i = DL_PROMISC_PHYS;],
305 ac_cv_sys_dlpi_usable=yes,
306 ac_cv_sys_dlpi_usable=no))
307 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
308 if test $ac_cv_sys_dlpi_usable = no ; then
309 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
313 # Check whether we have a /dev/dlpi device or have multiple devices.
315 AC_MSG_CHECKING(for /dev/dlpi device)
316 if test -c /dev/dlpi ; then
318 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
322 AC_MSG_CHECKING(for $dir directory)
323 if test -d $dir ; then
325 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
332 # This check is for Solaris with DLPI support for passive modes.
333 # See dlpi(7P) for more details.
335 AC_LBL_DL_PASSIVE_REQ_T
339 AC_MSG_CHECKING(Linux kernel version)
340 if test "$cross_compiling" = yes; then
341 AC_CACHE_VAL(ac_cv_linux_vers,
342 ac_cv_linux_vers=unknown)
344 AC_CACHE_VAL(ac_cv_linux_vers,
345 ac_cv_linux_vers=`uname -r 2>&1 | \
346 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
348 AC_MSG_RESULT($ac_cv_linux_vers)
349 if test $ac_cv_linux_vers = unknown ; then
350 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
352 if test $ac_cv_linux_vers -lt 2 ; then
353 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
355 AC_CHECK_HEADERS(linux/wireless.h, [], [],
357 #include <sys/socket.h>
359 #include <linux/types.h>
363 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
368 # Check whether we have the *BSD-style ioctls.
370 AC_CHECK_HEADERS(net/if_media.h)
372 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
374 [#include <sys/socket.h>
375 #include <sys/ioctl.h>
377 #include <net/bpf.h>],
378 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
381 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
382 [define if the system supports zerocopy BPF])
388 V_DEFS="$V_DEFS -DDAG_ONLY"
392 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
396 AC_MSG_WARN(cannot determine packet capture interface)
397 AC_MSG_WARN((see the INSTALL doc for more info))
402 dnl Now figure out how we get a list of interfaces and addresses,
403 dnl if we support capturing. Don't bother if we don't support
406 if test "$V_PCAP" = null
409 # We can't capture, so we can't open any capture
410 # devices, so we won't return any interfaces.
414 AC_CHECK_FUNC(getifaddrs,[
416 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
417 # as well, just in case some platform is really weird.
419 AC_CHECK_HEADER(ifaddrs.h,[
421 # We have the header, so we use "getifaddrs()" to
422 # get the list of interfaces.
427 # We don't have the header - give up.
428 # XXX - we could also fall back on some other
429 # mechanism, but, for now, this'll catch this
430 # problem so that we can at least try to figure
431 # out something to do on systems with "getifaddrs()"
432 # but without "ifaddrs.h", if there is something
433 # we can do on those systems.
435 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
439 # Well, we don't have "getifaddrs()", so we have to use
440 # some other mechanism; determine what that mechanism is.
442 # The first thing we use is the type of capture mechanism,
443 # which is somewhat of a proxy for the OS we're using.
448 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
450 # This might be Solaris 8 or later, with
451 # SIOCGLIFCONF, or it might be some other OS
452 # or some older version of Solaris, with
455 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
456 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
458 [#include <sys/param.h>
459 #include <sys/file.h>
460 #include <sys/ioctl.h>
461 #include <sys/socket.h>
462 #include <sys/sockio.h>],
463 [ioctl(0, SIOCGLIFCONF, (char *)0);],
464 ac_cv_lbl_have_siocglifconf=yes,
465 ac_cv_lbl_have_siocglifconf=no))
466 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
467 if test $ac_cv_lbl_have_siocglifconf = yes ; then
473 # Needed for common functions used by pcap-[dlpi,libdlpi].c
480 # Assume we just have SIOCGIFCONF.
481 # (XXX - on at least later Linux kernels, there's
482 # another mechanism, and we should be using that
491 AC_MSG_CHECKING(for socklen_t)
493 #include <sys/types.h>
494 #include <sys/socket.h>
499 if test "x$have_socklen_t" = "xyes"; then
500 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
502 AC_MSG_RESULT($have_socklen_t)
504 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@],
506 [enable_ipv6=ifavailable])
507 if test "$enable_ipv6" != "no"; then
508 AC_CHECK_FUNC(getaddrinfo,
510 AC_DEFINE(INET6,1,[IPv6])
513 if test "$enable_ipv6" != "ifavailable"; then
514 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
519 AC_MSG_CHECKING(whether to build optimizer debugging code)
520 AC_ARG_ENABLE(optimizer-dbg, [ --enable-optimizer-dbg build optimizer debugging code])
521 if test "$enable_optimizer_dbg" = "yes"; then
522 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
524 AC_MSG_RESULT(${enable_optimizer_dbg-no})
526 AC_MSG_CHECKING(whether to build parser debugging code)
527 AC_ARG_ENABLE(yydebug, [ --enable-yydebug build parser debugging code])
528 if test "$enable_yydebug" = "yes"; then
529 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
531 AC_MSG_RESULT(${enable_yydebug-no})
533 AC_MSG_CHECKING(whether we have /proc/net/dev)
534 if test -r /proc/net/dev ; then
535 ac_cv_lbl_proc_net_dev=yes
537 ac_cv_lbl_proc_net_dev=no
539 if test $ac_cv_lbl_proc_net_dev = yes; then
540 AC_DEFINE(HAVE_PROC_NET_DEV, 1, [define if you have a /proc/net/dev])
542 AC_MSG_RESULT($ac_cv_lbl_proc_net_dev)
544 # Check for Endace DAG card support.
545 AC_ARG_WITH([dag], [ --with-dag[[=DIR]] include Endace DAG support ("yes", "no" or DIR; default="yes" on BSD and Linux if present)],
547 if test "$withval" = no
549 # User doesn't want DAG support.
551 elif test "$withval" = yes
553 # User wants DAG support but hasn't specified a directory.
556 # User wants DAG support and has specified a directory, so use the provided value.
562 # Use DAG API if present, otherwise don't
567 AC_ARG_WITH([dag-includes], [ --with-dag-includes=DIR Endace DAG include directory],
569 # User wants DAG support and has specified a header directory, so use the provided value.
571 dag_include_dir=$withval
574 AC_ARG_WITH([dag-libraries], [ --with-dag-libraries=DIR Endace DAG library directory],
576 # User wants DAG support and has specified a library directory, so use the provided value.
584 # We support the DAG API if we're on Linux or BSD, or if we're
585 # building a DAG-only libpcap.
590 # If the user explicitly requested DAG, tell them it's not
593 # If they expressed no preference, don't include it.
595 if test $want_dag = yes; then
596 AC_MSG_ERROR([DAG support is only available with 'linux' 'bpf' and 'dag' packet capture types])
597 elif test $want_dag = yes; then
604 if test "$want_dag" != no; then
606 AC_MSG_CHECKING([whether we have DAG API headers])
608 # If necessary, set default paths for DAG API headers and libraries.
609 if test -z "$dag_root"; then
613 if test -z "$dag_include_dir"; then
614 dag_include_dir="$dag_root/include"
617 if test -z "$dag_lib_dir"; then
618 dag_lib_dir="$dag_root/lib"
621 if test -z "$dag_tools_dir"; then
622 dag_tools_dir="$dag_root/tools"
625 if test -r $dag_include_dir/dagapi.h; then
626 ac_cv_lbl_dag_api=yes
628 AC_MSG_RESULT([$ac_cv_lbl_dag_api ($dag_include_dir)])
631 if test $ac_cv_lbl_dag_api = yes; then
633 AC_MSG_CHECKING([dagapi.o])
635 if test -r $dag_tools_dir/dagapi.o; then
637 dagapi_obj=$dag_tools_dir/dagapi.o
638 elif test -r $dag_lib_dir/dagapi.o; then
640 dagapi_obj=$dag_lib_dir/dagapi.o
641 elif test -r $dag_lib_dir/libdag.a; then
643 ar x $dag_lib_dir/libdag.a dagapi.o 2>/dev/null
644 if test -r ./dagapi.o; then
645 dagapi_obj=./dagapi.o
647 ar x $dag_lib_dir/libdag.a libdag_la-dagapi.o 2>/dev/null
648 if test -r ./libdag_la-dagapi.o; then
649 dagapi_obj=./libdag_la-dagapi.o
654 if test $dagapi_obj = no; then
655 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
658 AC_MSG_RESULT([yes ($dagapi_obj)])
662 if test $ac_cv_lbl_dag_api = yes; then
664 AC_MSG_CHECKING([dagopts.o])
666 if test -r $dag_tools_dir/dagopts.o; then
668 dagopts_obj=$dag_tools_dir/dagopts.o
669 elif test -r $dag_lib_dir/dagopts.o; then
671 dagopts_obj=$dag_lib_dir/dagopts.o
672 elif test -r $dag_lib_dir/libdag.a; then
674 ar x $dag_lib_dir/libdag.a dagopts.o 2>/dev/null
675 if test -r ./dagopts.o; then
676 dagopts_obj=./dagopts.o
678 ar x $dag_lib_dir/libdag.a libdag_la-dagopts.o 2>/dev/null
679 if test -r ./libdag_la-dagopts.o; then
680 dagopts_obj=./libdag_la-dagopts.o
685 if test $dagopts_obj = no; then
686 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_tools_dir $dag_lib_dir/libdag.a)])
689 AC_MSG_RESULT([yes ($dagopts_obj)])
693 if test $ac_cv_lbl_dag_api = yes; then
694 # Under 2.5.x only we need to add dagreg.o.
695 if test -r $dag_include_dir/dagreg.h; then
696 AC_MSG_CHECKING([dagreg.o])
698 if test -r $dag_lib_dir/dagreg.o; then
699 # Object file is ready and waiting.
700 dagreg_obj=$dag_lib_dir/dagreg.o
701 elif test -r $dag_lib_dir/libdag.a; then
702 # Extract from libdag.a.
703 ar x $dag_lib_dir/libdag.a dagreg.o 2>/dev/null
704 if test -r ./dagreg.o; then
705 dagreg_obj=./dagreg.o
707 ar x $dag_lib_dir/libdag.a libdag_la-dagreg.o 2>/dev/null
708 if test -r ./libdag_la-dagreg.o; then
709 dagreg_obj=./libdag_la-dagreg.o
714 if test $dagreg_obj = no; then
715 AC_MSG_RESULT([no (checked $dag_lib_dir $dag_lib_dir/libdag.a)])
718 AC_MSG_RESULT([yes ($dagreg_obj)])
723 if test $ac_cv_lbl_dag_api = yes; then
724 V_INCLS="$V_INCLS -I$dag_include_dir"
725 V_LIBS="$V_LIBS $dagapi_obj $dagopts_obj $dagreg_obj"
726 if test $V_PCAP != dag ; then
730 # See if we can find a general version string.
731 # Don't need to save and restore LIBS to prevent -ldag being
732 # included if there's a found-action (arg 3).
733 saved_ldflags=$LDFLAGS
734 LDFLAGS="-L$dag_lib_dir"
735 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
736 AC_CHECK_LIB([dag],[dag_get_erf_types], [
737 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
738 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
739 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
740 LDFLAGS=$saved_ldflags
742 if test "$dag_streams" = 1; then
743 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
747 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
750 AC_MSG_CHECKING(whether we have the DAG API)
752 if test $ac_cv_lbl_dag_api = no; then
754 if test "$want_dag" = yes; then
755 # User wanted DAG support but we couldn't find it.
756 AC_MSG_ERROR([DAG API requested, but not found at $dag_root: use --without-dag])
759 if test "$V_PCAP" = dag; then
760 # User requested "dag" capture type but the DAG API wasn't
762 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.)])
768 AC_ARG_WITH(septel, [ --with-septel[[=DIR]] include Septel support (located in directory DIR, if supplied). [default=yes, on Linux, if present]],
770 if test "$withval" = no
773 elif test "$withval" = yes
783 # Use Septel API if present, otherwise don't
785 want_septel=ifpresent
786 septel_root=./../septel
788 ac_cv_lbl_septel_api=no
792 # We support the Septel API if we're on Linux, or if we're building
793 # a Septel-only libpcap.
798 # If the user explicitly requested Septel, tell them it's not
801 # If they expressed no preference, don't include it.
803 if test $want_septel = yes; then
804 AC_MSG_ERROR(Septel support only available with 'linux' and 'septel' packet capture types)
805 elif test $want_septel = yes; then
811 if test "$with_septel" != no; then
812 AC_MSG_CHECKING(whether we have Septel API)
814 if test -z "$septel_root"; then
815 septel_root=$srcdir/../septel
819 septel_tools_dir="$septel_root"
820 septel_include_dir="$septel_root/INC"
821 DEF="-DHAVE_SEPTEL_API"
823 ac_cv_lbl_septel_api=no
824 if test -r "$septel_include_dir/msg.h"; then
825 V_INCLS="$V_INCLS -I$septel_include_dir"
826 V_DEFS="$V_DEFS $DEF"
827 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 "
829 if test "$V_PCAP" != septel ; then
833 ac_cv_lbl_septel_api=yes
836 AC_MSG_RESULT($ac_cv_lbl_septel_api)
837 if test $ac_cv_lbl_septel_api = no; then
838 if test "$want_septel" = yes; then
839 AC_MSG_ERROR(Septel API not found under directory $septel_root; use --without-septel)
842 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have a Septel API])
846 if test "$V_PCAP" = septel -a "$ac_cv_lbl_septel_api" = no; then
847 AC_MSG_ERROR(Specifying the capture type as 'septel' requires the Septel API to be present; use --with-septel=DIR)
851 AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
852 if test "$V_LEX" = lex ; then
853 # Some versions of lex can't handle the definitions section of scanner.l .
854 # Try lexing it and complain if it can't deal.
855 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
856 if lex -t scanner.l > /dev/null 2>&1; then
857 tcpdump_cv_capable_lex=yes
859 tcpdump_cv_capable_lex=insufficient
861 if test $tcpdump_cv_capable_lex = insufficient ; then
862 AC_MSG_ERROR([Your operating system's lex is insufficient to compile
863 libpcap. flex is a lex replacement that has many advantages, including
864 being able to compile libpcap. For more information, see
865 http://www.gnu.org/software/flex/flex.html .])
870 # Assume a.out/ELF convention for shared library names (".so"), and
871 # V7/BSD convention for man pages (file formats in section 5,
872 # miscellaneous info in section 7).
880 dnl Workaround to enable certain features
881 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
883 # We need "-lodm" and "-lcfg", as libpcap requires them on
885 DEPLIBS="-lodm -lcfg"
890 V_CCOPT="$V_CCOPT -fno-common"
894 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
897 # Use System V conventions for man pages.
906 # Use System V conventions for man pages.
915 # Use System V conventions for man pages.
922 dnl HPUX 10.20 and above is similar to HPUX 9, but
925 dnl XXX - DYEXT should be set to "sl" if this is building
926 dnl for 32-bit PA-RISC, but should be left as "so" for
927 dnl 64-bit PA-RISC or, I suspect, IA-64.
928 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
931 # Use System V conventions for man pages.
939 # Use System V conventions for man pages.
946 V_CCOPT="$V_CCOPT -fPIC"
951 # Use System V conventions for man pages.
958 AC_MSG_CHECKING(if SINIX compiler defines sinix)
959 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
963 ac_cv_cc_sinix_defined=yes,
964 ac_cv_cc_sinix_defined=no))
965 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
966 if test $ac_cv_cc_sinix_defined = no ; then
967 AC_DEFINE(sinix,1,[on sinix])
972 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
975 # Use System V conventions for man pages.
984 AC_LBL_DEVEL(V_CCOPT)
986 AC_LBL_SOCKADDR_SA_LEN
988 AC_LBL_SOCKADDR_STORAGE
990 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
992 AC_LBL_UNALIGNED_ACCESS
995 # Makefile.in includes rules to generate version.h, so we assume
996 # that it will be generated if autoconf is used.
998 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1001 ln -s ${srcdir}/bpf/net net
1009 AC_SUBST(V_FINDALLDEVS)
1015 AC_SUBST(MAN_FILE_FORMATS)
1016 AC_SUBST(MAN_MISC_INFO)
1018 dnl check for USB sniffing support
1019 AC_MSG_CHECKING(for USB sniffing support)
1022 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1023 USB_SRC=pcap-usb-linux.c
1025 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1026 if test $? -ne 0 ; then
1027 ac_usb_dev_name="usbmon"
1029 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1030 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1036 AC_SUBST(PCAP_SUPPORT_USB)
1039 dnl check for bluetooth sniffing support
1042 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1044 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1045 BT_SRC=pcap-bt-linux.c
1046 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1048 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1052 AC_MSG_NOTICE(no Bluetooth sniffing support)
1055 AC_SUBST(PCAP_SUPPORT_BT)
1060 AC_CONFIG_HEADER(config.h)
1062 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1063 pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap
1064 pcap_datalink.3pcap pcap_dump_open.3pcap
1065 pcap_list_datalinks.3pcap pcap_open_dead.3pcap
1066 pcap_open_offline.3pcap)
1068 if test -f .devel ; then