1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 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
23 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
25 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
28 if test "$ac_cv___attribute__" = "yes"; then
29 AC_C___ATTRIBUTE___UNUSED
30 AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER
31 AC_C___ATTRIBUTE___FORMAT
32 if test "$ac_cv___attribute___format" = "yes"; then
33 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
36 AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.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
41 LOCALSRC="print-pflog.c $LOCALSRC"
43 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
44 #include <sys/socket.h>])
45 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
47 # The simple test didn't work.
48 # Do we need to include <net/if.h> first?
49 # Unset ac_cv_header_netinet_if_ether_h so we don't
50 # treat the previous failure as a cached value and
51 # suppress the next test.
53 AC_MSG_NOTICE([Rechecking with some additional includes])
54 unset ac_cv_header_netinet_if_ether_h
55 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
56 #include <sys/socket.h>
57 #include <netinet/in.h>
68 AC_ARG_ENABLE(universal,
69 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
70 if test "$enable_universal" != "no"; then
75 # Leopard. Build for x86 and 32-bit PowerPC, with
76 # x86 first. (That's what Apple does.)
78 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
79 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
84 # Snow Leopard. Build for x86-64 and x86, with
85 # x86-64 first. (That's what Apple does.)
87 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
88 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
95 AC_MSG_CHECKING(Linux kernel version)
96 if test "$cross_compiling" = yes; then
97 AC_CACHE_VAL(ac_cv_linux_vers,
98 ac_cv_linux_vers=unknown)
100 AC_CACHE_VAL(ac_cv_linux_vers,
101 ac_cv_linux_vers=`uname -r 2>&1 | \
102 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
104 AC_MSG_RESULT($ac_cv_linux_vers)
105 if test $ac_cv_linux_vers = unknown ; then
106 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
108 if test $ac_cv_linux_vers -lt 2 ; then
109 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
119 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
120 --without-smi don't link with libsmi],,
123 if test "x$with_smi" != "xno" ; then
124 AC_CHECK_HEADERS(smi.h)
125 AC_CHECK_LIB(smi, smiInit)
126 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
128 AC_MSG_CHECKING([whether to enable libsmi])
129 AC_TRY_RUN([ /* libsmi available check */
133 int current, revision, age, n;
134 const int required = 2;
137 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
139 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
142 if (required < current - age || required > current)
148 AC_DEFINE(LIBSMI, 1, [Define if you enable support for libsmi])
150 dnl autoconf documentation says that $? contains the exit value.
151 dnl reality is that it does not. We leave this in just in case
152 dnl autoconf ever comes back to match the documentation.
154 1) AC_MSG_RESULT(no - smiInit failed) ;;
155 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
156 3) AC_MSG_RESULT(no - can't determine library version) ;;
157 4) AC_MSG_RESULT(no - too old) ;;
158 *) AC_MSG_RESULT(no) ;;
161 [ AC_MSG_RESULT(not when cross-compiling)
167 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
169 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
170 --disable-smb disable possibly-buggy SMB printer],,
173 yes) AC_MSG_RESULT(yes)
174 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
175 AC_DEFINE(TCPDUMP_DO_SMB, 1,
176 [define if you want to build the possibly-buggy SMB printer])
177 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
183 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
184 AC_MSG_CHECKING([whether to drop root privileges by default])
185 if test ! -z "$with_user" ; then
186 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
187 [define if should drop privileges by default])
188 AC_MSG_RESULT(to \"$withval\")
193 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
194 AC_MSG_CHECKING([whether to chroot])
195 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
196 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
197 [define if should chroot when dropping privileges])
198 AC_MSG_RESULT(to \"$withval\")
204 # We must check this before checking whether to enable IPv6, because,
205 # on some platforms (such as SunOS 5.x), the test program requires
206 # the extra networking libraries.
210 AC_MSG_CHECKING([whether to enable ipv6])
212 [ --enable-ipv6 enable ipv6 (with ipv4) support
213 --disable-ipv6 disable ipv6 support],
214 [ case "$enableval" in
215 yes) AC_MSG_RESULT(yes)
216 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
217 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
226 AC_TRY_RUN([ /* AF_INET6 available check */
227 #include <sys/types.h>
228 #include <sys/socket.h>
231 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
238 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
239 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
251 if test "$ipv6" = "yes"; then
252 AC_MSG_CHECKING([ipv6 stack type])
253 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
256 dnl http://www.kame.net/
258 [#include <netinet/in.h>
259 #ifdef IPV6_INRIA_VERSION
263 CFLAGS="-DINET6 $CFLAGS"])
266 dnl http://www.kame.net/
268 [#include <netinet/in.h>
274 ipv6libdir=/usr/local/v6/lib;
276 CFLAGS="-DINET6 $CFLAGS"])
279 dnl http://www.v6.linux.or.jp/
281 [#include <features.h>
282 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
286 CFLAGS="-DINET6 $CFLAGS"])
289 dnl http://www.v6.linux.or.jp/
291 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
292 dnl and possibly other versions of those OSes
294 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
297 ipv6libdir=/usr/inet6/lib
299 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
304 [#include <sys/param.h>
305 #ifdef _TOSHIBA_INET6
310 ipv6libdir=/usr/local/v6/lib;
311 CFLAGS="-DINET6 $CFLAGS"])
315 [#include </usr/local/v6/include/sys/v6config.h>
321 ipv6libdir=/usr/local/v6/lib;
322 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
326 [#include <sys/param.h>
327 #ifdef _ZETA_MINAMI_INET6
332 ipv6libdir=/usr/local/v6/lib;
333 CFLAGS="-DINET6 $CFLAGS"])
336 if test "$ipv6type" != "unknown"; then
340 AC_MSG_RESULT($ipv6type)
343 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
344 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
345 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
346 echo "You have $ipv6lib library, using it"
348 if test "$ipv6trylibc" = "yes"; then
349 echo "You do not have $ipv6lib library, using libc"
351 echo 'Fatal: no $ipv6lib library found. cannot continue.'
352 echo "You need to fetch lib$ipv6lib.a from appropriate"
353 echo 'ipv6 kit and compile beforehand.'
360 if test "$ipv6" = "yes"; then
362 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
363 # function in libc; there are "ngetaddrinfo()" and
364 # "ogetaddrinfo()" functions, and <netdb.h> #defines
365 # "getaddrinfo" to be either "ngetaddrinfo" or
366 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
367 # or _XOPEN_SOURCE_EXTENDED are defined or not.
369 # So this test doesn't work on Tru64 5.1, and possibly
370 # on other 5.x releases. This causes the configure
371 # script to become confused, and results in libpcap
374 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
375 AC_MSG_CHECKING(getaddrinfo bug)
376 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
377 #include <sys/types.h>
380 #include <sys/socket.h>
381 #include <netinet/in.h>
385 int passive, gaierr, inet4 = 0, inet6 = 0;
386 struct addrinfo hints, *ai, *aitop;
387 char straddr[INET6_ADDRSTRLEN], strport[16];
389 for (passive = 0; passive <= 1; passive++) {
390 memset(&hints, 0, sizeof(hints));
391 hints.ai_family = AF_UNSPEC;
392 hints.ai_flags = passive ? AI_PASSIVE : 0;
393 hints.ai_socktype = SOCK_STREAM;
394 hints.ai_protocol = IPPROTO_TCP;
395 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
396 (void)gai_strerror(gaierr);
399 for (ai = aitop; ai; ai = ai->ai_next) {
400 if (ai->ai_addr == NULL ||
401 ai->ai_addrlen == 0 ||
402 getnameinfo(ai->ai_addr, ai->ai_addrlen,
403 straddr, sizeof(straddr), strport, sizeof(strport),
404 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
407 switch (ai->ai_family) {
409 if (strcmp(strport, "54321") != 0) {
413 if (strcmp(straddr, "0.0.0.0") != 0) {
417 if (strcmp(straddr, "127.0.0.1") != 0) {
424 if (strcmp(strport, "54321") != 0) {
428 if (strcmp(straddr, "::") != 0) {
432 if (strcmp(straddr, "::1") != 0) {
449 /* another family support? */
455 /* supported family should be 2, unsupported family should be 0 */
456 if (!(inet4 == 0 || inet4 == 2))
458 if (!(inet6 == 0 || inet6 == 2))
471 td_cv_buggygetaddrinfo=no,
472 td_cv_buggygetaddrinfo=yes,
473 td_cv_buggygetaddrinfo=yes)])
474 if test "$td_cv_buggygetaddrinfo" = no; then
480 if test "$td_cv_buggygetaddrinfo" = "yes"; then
482 # XXX - it doesn't appear that "ipv6type" can ever be
483 # set to "linux". Should this be testing for
484 # "linux-glibc", or for that *or* "linux-libinet6"?
485 # If the latter, note that "linux-libinet6" is also
486 # the type given to some non-Linux OSes.
488 if test "$ipv6type" != "linux"; then
489 echo 'Fatal: You must get working getaddrinfo() function.'
490 echo ' or you can specify "--disable-ipv6"'.
493 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
494 echo ' Better upgrade your system library to newest version'
495 echo ' of GNU C library (aka glibc).'
499 AC_REPLACE_FUNCS(getnameinfo)
502 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
503 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
504 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
505 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
506 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
507 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
508 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
509 [define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
513 dnl Checks for addrinfo structure
514 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
515 if test "$ac_cv_addrinfo" = no; then
520 dnl Checks for NI_MAXSERV
521 AC_NI_MAXSERV(ac_cv_maxserv)
522 if test "$ac_cv_maxserv" = no; then
527 dnl Checks for NI_NAMEREQD
528 AC_NI_NAMEREQD(ac_cv_namereqd)
529 if test "$ac_cv_namereqd" = no; then
534 dnl Checks for sockaddr_storage structure
535 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
536 if test "$ac_cv_sa_storage" = no; then
540 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
541 AC_CHECK_FUNCS(fork vfork strftime)
542 AC_CHECK_FUNCS(setlinebuf alarm)
545 AC_CHECK_FUNCS(vsnprintf snprintf,,
547 if test $needsnprintf = yes; then
553 AC_SEARCH_LIBS(dnet_htoa, dnet,
554 AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
556 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
558 dnl Some platforms may need -lnsl for getrpcbynumber.
559 AC_SEARCH_LIBS(getrpcbynumber, nsl,
560 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
562 dnl AC_CHECK_LIB(z, uncompress)
563 dnl AC_CHECK_HEADERS(zlib.h)
565 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
568 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
569 # libraries (e.g., "-lsocket -lnsl" on Solaris).
571 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
572 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
573 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
574 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
575 # it does not ship with a libc symbol "inet_ntop()", it ships with
576 # "_inet_ntop()", and has a #define macro in one of the system headers
579 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
580 AC_MSG_CHECKING(for inet_ntop)
581 AC_TRY_LINK([#include <sys/types.h>
582 #include <sys/socket.h>
583 #include <netinet/in.h>
584 #include <arpa/inet.h>], [char src[4], dst[128];
585 inet_ntop(AF_INET, src, dst, sizeof(dst));],
586 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
587 AC_LIBOBJ(inet_ntop)])
588 AC_MSG_CHECKING(for inet_pton)
589 AC_TRY_LINK([#include <sys/types.h>
590 #include <sys/socket.h>
591 #include <netinet/in.h>
592 #include <arpa/inet.h>], [char src[128], dst[4];
593 inet_pton(AF_INET, src, dst);],
594 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
595 AC_LIBOBJ(inet_pton)])
596 AC_MSG_CHECKING(for inet_aton)
597 AC_TRY_LINK([#include <sys/types.h>
598 #include <netinet/in.h>
599 #include <arpa/inet.h>], [char src[128];
601 inet_aton(src, &dst);],
602 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
603 AC_LIBOBJ(inet_aton)])
606 # Check for these after AC_LBL_LIBPCAP, for the same reason.
608 # You are in a twisty little maze of UN*Xes, all different.
609 # Some might not have ether_ntohost().
610 # Some might have it, but not declare it in any header file.
611 # Some might have it, but declare it in <netinet/if_ether.h>.
612 # Some might have it, but declare it in <netinet/ether.h>
613 # (And some might have it but document it as something declared in
614 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
616 # Before you is a C compiler.
618 AC_CHECK_FUNCS(ether_ntohost, [
619 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
622 #include <sys/types.h>
623 #include <sys/param.h>
624 #include <sys/socket.h>
627 main(int argc, char **argv)
629 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
630 char name[MAXHOSTNAMELEN];
632 ether_ntohost(name, (struct ether_addr *)ea);
635 ], [ac_cv_buggy_ether_ntohost=no],
636 [ac_cv_buggy_ether_ntohost=yes],
637 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
638 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
639 AC_DEFINE(USE_ETHER_NTOHOST, 1,
640 [define if you have ether_ntohost() and it works])
643 if test "$ac_cv_func_ether_ntohost" = yes -a \
644 "$ac_cv_buggy_ether_ntohost" = "no"; then
646 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
648 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
650 # Yes. Does it declare ether_ntohost()?
652 AC_CHECK_DECL(ether_ntohost,
654 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
655 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
658 #include <sys/types.h>
659 #include <sys/socket.h>
660 #include <netinet/in.h>
661 #include <arpa/inet.h>
665 #include <netinet/if_ether.h>
671 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
673 # No, how about <netinet/ether.h>, as on Linux?
675 AC_CHECK_HEADERS(netinet/ether.h)
676 if test "$ac_cv_header_netinet_ether_h" = yes; then
678 # We have it - does it declare ether_ntohost()?
679 # Unset ac_cv_have_decl_ether_ntohost so we don't
680 # treat the previous failure as a cached value and
681 # suppress the next test.
683 unset ac_cv_have_decl_ether_ntohost
684 AC_CHECK_DECL(ether_ntohost,
686 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
687 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
690 #include <netinet/ether.h>
695 # Is ether_ntohost() declared?
697 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
699 # No, we'll have to declare it ourselves.
700 # Do we have "struct ether_addr"?
702 AC_CHECK_TYPES(struct ether_addr,,,
704 #include <sys/types.h>
705 #include <sys/socket.h>
706 #include <netinet/in.h>
707 #include <arpa/inet.h>
711 #include <netinet/if_ether.h>
713 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
714 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
717 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
718 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
723 # libdlpi is needed for Solaris 11 and later.
724 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
726 dnl portability macros for getaddrinfo/getnameinfo
729 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
730 if test "$ac_cv_sockaddr_has_sa_len" = no; then
735 # Do we have the new open API? Check for pcap_create, and assume that,
736 # if we do, we also have pcap_activate() and the other new routines
737 # introduced in libpcap 1.0.0.
739 AC_CHECK_FUNCS(pcap_create)
740 if test $ac_cv_func_pcap_create = "yes" ; then
742 # OK, do we have pcap_set_tstamp_type? If so, assume we have
743 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
745 AC_CHECK_FUNCS(pcap_set_tstamp_type)
748 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
749 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
750 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
751 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
753 savedcppflags="$CPPFLAGS"
754 CPPFLAGS="$CPPFLAGS $V_INCLS"
755 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
756 CPPFLAGS="$savedcppflags"
759 if test $ac_cv_func_pcap_lib_version = "no" ; then
760 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
763 extern char pcap_version[];
765 return (int)pcap_version;
767 ac_lbl_cv_pcap_version_defined=yes,
768 ac_lbl_cv_pcap_version_defined=no)
769 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
771 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
776 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
779 extern int pcap_debug;
783 ac_lbl_cv_pcap_debug_defined=yes,
784 ac_lbl_cv_pcap_debug_defined=no)
785 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
787 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
791 # OK, what about "yydebug"?
793 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
800 ac_lbl_cv_yydebug_defined=yes,
801 ac_lbl_cv_yydebug_defined=no)
802 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
804 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
809 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
812 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
816 # Assume V7/BSD convention for man pages (file formats in section 5,
817 # miscellaneous info in section 7).
824 dnl Workaround to enable certain features
825 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
830 # Use System V conventions for man pages.
840 # Use System V conventions for man pages.
850 # Use System V conventions for man pages.
860 # Use System V conventions for man pages.
867 if test -f /dev/bpf0 ; then
872 # Make sure we have definitions for all the C99 specified-width types
873 # (regardless of whether the environment is a C99 environment or not).
884 # For now, we're using the old BSD-style u_intXX_t types, so check for
887 # We should probably migrate to the standard C uintXX_t types.
889 AC_CHECK_HEADERS(sys/bitypes.h)
891 AC_CHECK_TYPE([u_int8_t], ,
892 [AC_DEFINE([u_int8_t], [unsigned char],
893 [Define to `unsigned char' if u_int8_t not defined.])],
895 #ifdef HAVE_SYS_BITYPES_H
896 #include <sys/bitypes.h>
898 AC_CHECK_TYPE([u_int16_t], ,
899 [AC_DEFINE([u_int16_t], [unsigned short],
900 [Define to `unsigned short' if u_int16_t not defined.])],
902 #ifdef HAVE_SYS_BITYPES_H
903 #include <sys/bitypes.h>
905 AC_CHECK_TYPE([u_int32_t], ,
906 [AC_DEFINE([u_int32_t], [unsigned int],
907 [Define to `unsigned int' if u_int32_t not defined.])],
909 #ifdef HAVE_SYS_BITYPES_H
910 #include <sys/bitypes.h>
912 AC_CHECK_TYPE([u_int64_t], ,
913 [AC_DEFINE([u_int64_t], [unsigned long long],
914 [Define to `unsigned long long' if u_int64_t not defined.])],
916 #ifdef HAVE_SYS_BITYPES_H
917 #include <sys/bitypes.h>
921 # Check for <inttypes.h>
923 AC_CHECK_HEADERS(inttypes.h,
926 # OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
927 # Some systems have an inttypes.h that doesn't define all of them.
929 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
934 #include <inttypes.h>
936 #include <sys/types.h>
937 #ifdef HAVE_SYS_BITYPES_H
938 #include <sys/bitypes.h>
943 printf("%" PRId64 "\n", (u_int64_t)1);
944 printf("%" PRIo64 "\n", (u_int64_t)1);
945 printf("%" PRIx64 "\n", (u_int64_t)1);
946 printf("%" PRIu64 "\n", (u_int64_t)1);
952 ac_lbl_inttypes_h_defines_formats=yes
956 ac_lbl_inttypes_h_defines_formats=no
961 # We don't have inttypes.h, so it obviously can't define those
964 ac_lbl_inttypes_h_defines_formats=no
966 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
967 AC_LBL_CHECK_64BIT_FORMAT(l,
969 AC_LBL_CHECK_64BIT_FORMAT(ll,
971 AC_LBL_CHECK_64BIT_FORMAT(L,
973 AC_LBL_CHECK_64BIT_FORMAT(q,
975 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
983 # Check for some headers introduced in later versions of libpcap
984 # and used by some printers.
986 # Those headers use the {u_}intN_t types, so we must do this after
987 # we check for what's needed to get them defined.
989 savedcppflags="$CPPFLAGS"
990 CPPFLAGS="$CPPFLAGS $V_INCLS"
991 AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
992 AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
993 CPPFLAGS="$savedcppflags"
997 AC_LBL_DEVEL(V_CCOPT)
999 AC_LBL_SOCKADDR_SA_LEN
1001 AC_LBL_UNALIGNED_ACCESS
1005 # Check for OpenSSL libcrypto
1006 AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
1007 # Specify location for both includes and libraries.
1008 want_libcrypto=ifavailable
1010 AS_HELP_STRING([--with-crypto],
1011 [use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
1013 if test $withval = no
1017 elif test $withval = yes
1024 # Use libcrypto if it's present, otherwise don't.
1026 want_libcrypto=ifavailable
1027 AC_MSG_RESULT([yes, if available])
1029 if test "$want_libcrypto" != "no"; then
1030 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1031 AC_CHECK_HEADERS(openssl/evp.h)
1035 dnl set additional include path if necessary
1036 if test "$missing_includes" = "yes"; then
1037 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1038 V_INCLS="$V_INCLS -I$srcdir/missing"
1047 AC_SUBST(MAN_FILE_FORMATS)
1048 AC_SUBST(MAN_MISC_INFO)
1052 AC_CONFIG_HEADER(config.h)
1054 AC_OUTPUT_COMMANDS([if test -f .devel; then
1055 echo timestamp > stamp-h
1056 cat Makefile-devel-adds >> Makefile
1059 AC_OUTPUT(Makefile tcpdump.1)