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___FORMAT_FUNCTION_POINTER
31 AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
32 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
33 #include <sys/socket.h>
35 if test "$ac_cv_header_net_pfvar_h" = yes; then
36 LOCALSRC="print-pflog.c $LOCALSRC"
38 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
39 #include <sys/socket.h>])
40 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
42 # The simple test didn't work.
43 # Do we need to include <net/if.h> first?
44 # Unset ac_cv_header_netinet_if_ether_h so we don't
45 # treat the previous failure as a cached value and
46 # suppress the next test.
48 AC_MSG_NOTICE([Rechecking with some additional includes])
49 unset ac_cv_header_netinet_if_ether_h
50 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
51 #include <sys/socket.h>
52 #include <netinet/in.h>
63 AC_ARG_ENABLE(universal,
64 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
65 if test "$enable_universal" != "no"; then
70 # Leopard. Build for x86 and 32-bit PowerPC, with
71 # x86 first. (That's what Apple does.)
73 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
74 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
79 # Snow Leopard. Build for x86-64 and x86, with
80 # x86-64 first. (That's what Apple does.)
82 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
83 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
90 AC_MSG_CHECKING(Linux kernel version)
91 if test "$cross_compiling" = yes; then
92 AC_CACHE_VAL(ac_cv_linux_vers,
93 ac_cv_linux_vers=unknown)
95 AC_CACHE_VAL(ac_cv_linux_vers,
96 ac_cv_linux_vers=`uname -r 2>&1 | \
97 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
99 AC_MSG_RESULT($ac_cv_linux_vers)
100 if test $ac_cv_linux_vers = unknown ; then
101 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
103 if test $ac_cv_linux_vers -lt 2 ; then
104 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
114 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
115 --without-smi don't link with libsmi],,
118 if test "x$with_smi" != "xno" ; then
119 AC_CHECK_HEADERS(smi.h)
120 AC_CHECK_LIB(smi, smiInit)
121 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
123 AC_MSG_CHECKING([whether to enable libsmi])
124 AC_TRY_RUN([ /* libsmi available check */
128 int current, revision, age, n;
129 const int required = 2;
132 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
134 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
137 if (required < current - age || required > current)
143 AC_DEFINE(LIBSMI, 1, [Define if you enable support for libsmi])
145 dnl autoconf documentation says that $? contains the exit value.
146 dnl reality is that it does not. We leave this in just in case
147 dnl autoconf ever comes back to match the documentation.
149 1) AC_MSG_RESULT(no - smiInit failed) ;;
150 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
151 3) AC_MSG_RESULT(no - can't determine library version) ;;
152 4) AC_MSG_RESULT(no - too old) ;;
153 *) AC_MSG_RESULT(no) ;;
156 [ AC_MSG_RESULT(not when cross-compiling)
162 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
164 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
165 --disable-smb disable possibly-buggy SMB printer],,
168 yes) AC_MSG_RESULT(yes)
169 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
170 AC_DEFINE(TCPDUMP_DO_SMB, 1,
171 [define if you want to build the possibly-buggy SMB printer])
172 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
178 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
179 AC_MSG_CHECKING([whether to drop root privileges by default])
180 if test ! -z "$with_user" ; then
181 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
182 [define if should drop privileges by default])
183 AC_MSG_RESULT(to \"$withval\")
188 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
189 AC_MSG_CHECKING([whether to chroot])
190 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
191 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
192 [define if should chroot when dropping privileges])
193 AC_MSG_RESULT(to \"$withval\")
199 # We must check this before checking whether to enable IPv6, because,
200 # on some platforms (such as SunOS 5.x), the test program requires
201 # the extra networking libraries.
205 AC_MSG_CHECKING([whether to enable ipv6])
207 [ --enable-ipv6 enable ipv6 (with ipv4) support
208 --disable-ipv6 disable ipv6 support],
209 [ case "$enableval" in
210 yes) AC_MSG_RESULT(yes)
211 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"
212 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
221 AC_TRY_RUN([ /* AF_INET6 available check */
222 #include <sys/types.h>
223 #include <sys/socket.h>
226 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
233 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"
234 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
246 if test "$ipv6" = "yes"; then
247 AC_MSG_CHECKING([ipv6 stack type])
248 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
251 dnl http://www.kame.net/
253 [#include <netinet/in.h>
254 #ifdef IPV6_INRIA_VERSION
258 CFLAGS="-DINET6 $CFLAGS"])
261 dnl http://www.kame.net/
263 [#include <netinet/in.h>
269 ipv6libdir=/usr/local/v6/lib;
271 CFLAGS="-DINET6 $CFLAGS"])
274 dnl http://www.v6.linux.or.jp/
276 [#include <features.h>
277 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
281 CFLAGS="-DINET6 $CFLAGS"])
284 dnl http://www.v6.linux.or.jp/
286 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
287 dnl and possibly other versions of those OSes
289 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
292 ipv6libdir=/usr/inet6/lib
294 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
299 [#include <sys/param.h>
300 #ifdef _TOSHIBA_INET6
305 ipv6libdir=/usr/local/v6/lib;
306 CFLAGS="-DINET6 $CFLAGS"])
310 [#include </usr/local/v6/include/sys/v6config.h>
316 ipv6libdir=/usr/local/v6/lib;
317 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
321 [#include <sys/param.h>
322 #ifdef _ZETA_MINAMI_INET6
327 ipv6libdir=/usr/local/v6/lib;
328 CFLAGS="-DINET6 $CFLAGS"])
331 if test "$ipv6type" != "unknown"; then
335 AC_MSG_RESULT($ipv6type)
338 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
339 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
340 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
341 echo "You have $ipv6lib library, using it"
343 if test "$ipv6trylibc" = "yes"; then
344 echo "You do not have $ipv6lib library, using libc"
346 echo 'Fatal: no $ipv6lib library found. cannot continue.'
347 echo "You need to fetch lib$ipv6lib.a from appropriate"
348 echo 'ipv6 kit and compile beforehand.'
355 if test "$ipv6" = "yes"; then
357 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
358 # function in libc; there are "ngetaddrinfo()" and
359 # "ogetaddrinfo()" functions, and <netdb.h> #defines
360 # "getaddrinfo" to be either "ngetaddrinfo" or
361 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
362 # or _XOPEN_SOURCE_EXTENDED are defined or not.
364 # So this test doesn't work on Tru64 5.1, and possibly
365 # on other 5.x releases. This causes the configure
366 # script to become confused, and results in libpcap
369 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
370 AC_MSG_CHECKING(getaddrinfo bug)
371 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
372 #include <sys/types.h>
375 #include <sys/socket.h>
376 #include <netinet/in.h>
380 int passive, gaierr, inet4 = 0, inet6 = 0;
381 struct addrinfo hints, *ai, *aitop;
382 char straddr[INET6_ADDRSTRLEN], strport[16];
384 for (passive = 0; passive <= 1; passive++) {
385 memset(&hints, 0, sizeof(hints));
386 hints.ai_family = AF_UNSPEC;
387 hints.ai_flags = passive ? AI_PASSIVE : 0;
388 hints.ai_socktype = SOCK_STREAM;
389 hints.ai_protocol = IPPROTO_TCP;
390 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
391 (void)gai_strerror(gaierr);
394 for (ai = aitop; ai; ai = ai->ai_next) {
395 if (ai->ai_addr == NULL ||
396 ai->ai_addrlen == 0 ||
397 getnameinfo(ai->ai_addr, ai->ai_addrlen,
398 straddr, sizeof(straddr), strport, sizeof(strport),
399 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
402 switch (ai->ai_family) {
404 if (strcmp(strport, "54321") != 0) {
408 if (strcmp(straddr, "0.0.0.0") != 0) {
412 if (strcmp(straddr, "127.0.0.1") != 0) {
419 if (strcmp(strport, "54321") != 0) {
423 if (strcmp(straddr, "::") != 0) {
427 if (strcmp(straddr, "::1") != 0) {
444 /* another family support? */
450 /* supported family should be 2, unsupported family should be 0 */
451 if (!(inet4 == 0 || inet4 == 2))
453 if (!(inet6 == 0 || inet6 == 2))
466 td_cv_buggygetaddrinfo=no,
467 td_cv_buggygetaddrinfo=yes,
468 td_cv_buggygetaddrinfo=yes)])
469 if test "$td_cv_buggygetaddrinfo" = no; then
475 if test "$td_cv_buggygetaddrinfo" = "yes"; then
477 # XXX - it doesn't appear that "ipv6type" can ever be
478 # set to "linux". Should this be testing for
479 # "linux-glibc", or for that *or* "linux-libinet6"?
480 # If the latter, note that "linux-libinet6" is also
481 # the type given to some non-Linux OSes.
483 if test "$ipv6type" != "linux"; then
484 echo 'Fatal: You must get working getaddrinfo() function.'
485 echo ' or you can specify "--disable-ipv6"'.
488 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
489 echo ' Better upgrade your system library to newest version'
490 echo ' of GNU C library (aka glibc).'
494 AC_REPLACE_FUNCS(getnameinfo)
497 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
498 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
499 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
500 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
501 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
502 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
503 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
504 [define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
508 dnl Checks for addrinfo structure
509 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
510 if test "$ac_cv_addrinfo" = no; then
515 dnl Checks for NI_MAXSERV
516 AC_NI_MAXSERV(ac_cv_maxserv)
517 if test "$ac_cv_maxserv" = no; then
522 dnl Checks for NI_NAMEREQD
523 AC_NI_NAMEREQD(ac_cv_namereqd)
524 if test "$ac_cv_namereqd" = no; then
529 dnl Checks for sockaddr_storage structure
530 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
531 if test "$ac_cv_sa_storage" = no; then
535 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
536 AC_CHECK_FUNCS(fork vfork strftime)
537 AC_CHECK_FUNCS(setlinebuf alarm)
540 AC_CHECK_FUNCS(vsnprintf snprintf,,
542 if test $needsnprintf = yes; then
548 AC_SEARCH_LIBS(dnet_htoa, dnet,
549 AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
551 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
553 dnl Some platforms may need -lnsl for getrpcbynumber.
554 AC_SEARCH_LIBS(getrpcbynumber, nsl,
555 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
557 dnl AC_CHECK_LIB(z, uncompress)
558 dnl AC_CHECK_HEADERS(zlib.h)
560 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
563 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
564 # libraries (e.g., "-lsocket -lnsl" on Solaris).
566 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
567 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
568 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
569 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
570 # it does not ship with a libc symbol "inet_ntop()", it ships with
571 # "_inet_ntop()", and has a #define macro in one of the system headers
574 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
575 AC_MSG_CHECKING(for inet_ntop)
576 AC_TRY_LINK([#include <sys/types.h>
577 #include <sys/socket.h>
578 #include <netinet/in.h>
579 #include <arpa/inet.h>], [char src[4], dst[128];
580 inet_ntop(AF_INET, src, dst, sizeof(dst));],
581 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
582 AC_LIBOBJ(inet_ntop)])
583 AC_MSG_CHECKING(for inet_pton)
584 AC_TRY_LINK([#include <sys/types.h>
585 #include <sys/socket.h>
586 #include <netinet/in.h>
587 #include <arpa/inet.h>], [char src[128], dst[4];
588 inet_pton(AF_INET, src, dst);],
589 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
590 AC_LIBOBJ(inet_pton)])
591 AC_MSG_CHECKING(for inet_aton)
592 AC_TRY_LINK([#include <sys/types.h>
593 #include <netinet/in.h>
594 #include <arpa/inet.h>], [char src[128];
596 inet_aton(src, &dst);],
597 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
598 AC_LIBOBJ(inet_aton)])
601 # Check for these after AC_LBL_LIBPCAP, for the same reason.
603 # You are in a twisty little maze of UN*Xes, all different.
604 # Some might not have ether_ntohost().
605 # Some might have it, but not declare it in any header file.
606 # Some might have it, but declare it in <netinet/if_ether.h>.
607 # Some might have it, but declare it in <netinet/ether.h>
608 # (And some might have it but document it as something declared in
609 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
611 # Before you is a C compiler.
613 AC_CHECK_FUNCS(ether_ntohost, [
614 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
617 #include <sys/types.h>
618 #include <sys/param.h>
619 #include <sys/socket.h>
622 main(int argc, char **argv)
624 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
625 char name[MAXHOSTNAMELEN];
627 ether_ntohost(name, (struct ether_addr *)ea);
630 ], [ac_cv_buggy_ether_ntohost=no],
631 [ac_cv_buggy_ether_ntohost=yes],
632 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
633 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
634 AC_DEFINE(USE_ETHER_NTOHOST, 1,
635 [define if you have ether_ntohost() and it works])
638 if test "$ac_cv_func_ether_ntohost" = yes -a \
639 "$ac_cv_buggy_ether_ntohost" = "no"; then
641 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
643 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
645 # Yes. Does it declare ether_ntohost()?
647 AC_CHECK_DECL(ether_ntohost,
649 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
650 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
653 #include <sys/types.h>
654 #include <sys/socket.h>
655 #include <netinet/in.h>
656 #include <arpa/inet.h>
660 #include <netinet/if_ether.h>
666 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
668 # No, how about <netinet/ether.h>, as on Linux?
670 AC_CHECK_HEADERS(netinet/ether.h)
671 if test "$ac_cv_header_netinet_ether_h" = yes; then
673 # We have it - does it declare ether_ntohost()?
674 # Unset ac_cv_have_decl_ether_ntohost so we don't
675 # treat the previous failure as a cached value and
676 # suppress the next test.
678 unset ac_cv_have_decl_ether_ntohost
679 AC_CHECK_DECL(ether_ntohost,
681 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
682 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
685 #include <netinet/ether.h>
690 # Is ether_ntohost() declared?
692 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
694 # No, we'll have to declare it ourselves.
695 # Do we have "struct ether_addr"?
697 AC_CHECK_TYPES(struct ether_addr,,,
699 #include <sys/types.h>
700 #include <sys/socket.h>
701 #include <netinet/in.h>
702 #include <arpa/inet.h>
706 #include <netinet/if_ether.h>
708 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
709 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
712 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
713 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
718 # libdlpi is needed for Solaris 11 and later.
719 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
721 dnl portability macros for getaddrinfo/getnameinfo
724 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
725 if test "$ac_cv_sockaddr_has_sa_len" = no; then
730 # Do we have the new open API? Check for pcap_create, and assume that,
731 # if we do, we also have pcap_activate() and the other new routines
732 # introduced in libpcap 1.0.0.
734 AC_CHECK_FUNCS(pcap_create)
735 if test $ac_cv_func_pcap_create = "yes" ; then
737 # OK, do we have pcap_set_tstamp_type? If so, assume we have
738 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
740 AC_CHECK_FUNCS(pcap_set_tstamp_type)
743 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
744 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
745 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
746 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
748 savedcppflags="$CPPFLAGS"
749 CPPFLAGS="$CPPFLAGS $V_INCLS"
750 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
751 CPPFLAGS="$savedcppflags"
754 if test $ac_cv_func_pcap_lib_version = "no" ; then
755 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
758 extern char pcap_version[];
760 return (int)pcap_version;
762 ac_lbl_cv_pcap_version_defined=yes,
763 ac_lbl_cv_pcap_version_defined=no)
764 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
766 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
771 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
774 extern int pcap_debug;
778 ac_lbl_cv_pcap_debug_defined=yes,
779 ac_lbl_cv_pcap_debug_defined=no)
780 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
782 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
786 # OK, what about "yydebug"?
788 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
795 ac_lbl_cv_yydebug_defined=yes,
796 ac_lbl_cv_yydebug_defined=no)
797 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
799 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
804 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
807 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
811 # Assume V7/BSD convention for man pages (file formats in section 5,
812 # miscellaneous info in section 7).
819 dnl Workaround to enable certain features
820 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
825 # Use System V conventions for man pages.
835 # Use System V conventions for man pages.
845 # Use System V conventions for man pages.
855 # Use System V conventions for man pages.
862 if test -f /dev/bpf0 ; then
866 AC_CHECK_HEADERS(sys/bitypes.h)
868 AC_CHECK_TYPE([int8_t], ,
869 [AC_DEFINE([int8_t], [signed char],
870 [Define to `signed char' if int8_t not defined.])],
872 #ifdef HAVE_SYS_BITYPES_H
873 #include <sys/bitypes.h>
875 AC_CHECK_TYPE([u_int8_t], ,
876 [AC_DEFINE([u_int8_t], [unsigned char],
877 [Define to `unsigned char' if u_int8_t not defined.])],
879 #ifdef HAVE_SYS_BITYPES_H
880 #include <sys/bitypes.h>
882 AC_CHECK_TYPE([int16_t], ,
883 [AC_DEFINE([int16_t], [short],
884 [Define to `short' if int16_t not defined.])]
886 #ifdef HAVE_SYS_BITYPES_H
887 #include <sys/bitypes.h>
889 AC_CHECK_TYPE([u_int16_t], ,
890 [AC_DEFINE([u_int16_t], [unsigned short],
891 [Define to `unsigned short' if u_int16_t not defined.])],
893 #ifdef HAVE_SYS_BITYPES_H
894 #include <sys/bitypes.h>
896 AC_CHECK_TYPE([int32_t], ,
897 [AC_DEFINE([int32_t], [int],
898 [Define to `int' if int32_t not defined.])],
900 #ifdef HAVE_SYS_BITYPES_H
901 #include <sys/bitypes.h>
903 AC_CHECK_TYPE([u_int32_t], ,
904 [AC_DEFINE([u_int32_t], [unsigned int],
905 [Define to `unsigned int' if u_int32_t not defined.])],
907 #ifdef HAVE_SYS_BITYPES_H
908 #include <sys/bitypes.h>
910 AC_CHECK_TYPE([int64_t], ,
911 [AC_DEFINE([int64_t], [long long],
912 [Define to `long long' if int64_t not defined.])],
914 #ifdef HAVE_SYS_BITYPES_H
915 #include <sys/bitypes.h>
917 AC_CHECK_TYPE([u_int64_t], ,
918 [AC_DEFINE([u_int64_t], [unsigned long long],
919 [Define to `unsigned long long' if u_int64_t not defined.])],
921 #ifdef HAVE_SYS_BITYPES_H
922 #include <sys/bitypes.h>
926 # We can't just check for <inttypes.h> - some systems have one that
927 # doesn't define all the PRI[doxu]64 macros.
929 AC_CHECK_HEADERS(inttypes.h,
932 # OK, we have inttypes.h, but does it define those macros?
934 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
939 #include <inttypes.h>
941 #include <sys/types.h>
942 #ifdef HAVE_SYS_BITYPES_H
943 #include <sys/bitypes.h>
948 printf("%" PRId64 "\n", (u_int64_t)1);
949 printf("%" PRIo64 "\n", (u_int64_t)1);
950 printf("%" PRIx64 "\n", (u_int64_t)1);
951 printf("%" PRIu64 "\n", (u_int64_t)1);
957 ac_lbl_inttypes_h_defines_formats=yes
961 ac_lbl_inttypes_h_defines_formats=no
966 # We don't have inttypes.h, so it obviously can't define those
969 ac_lbl_inttypes_h_defines_formats=no
971 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
972 AC_LBL_CHECK_64BIT_FORMAT(l,
974 AC_LBL_CHECK_64BIT_FORMAT(ll,
976 AC_LBL_CHECK_64BIT_FORMAT(L,
978 AC_LBL_CHECK_64BIT_FORMAT(q,
980 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
988 # Check for some headers introduced in later versions of libpcap
989 # and used by some printers.
991 # Those headers use the {u_}intN_t types, so we must do this after
992 # we check for what's needed to get them defined.
994 savedcppflags="$CPPFLAGS"
995 CPPFLAGS="$CPPFLAGS $V_INCLS"
996 AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
997 AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
998 CPPFLAGS="$savedcppflags"
1002 AC_LBL_DEVEL(V_CCOPT)
1004 AC_LBL_SOCKADDR_SA_LEN
1006 AC_LBL_UNALIGNED_ACCESS
1010 # Check for OpenSSL libcrypto
1011 AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
1012 # Specify location for both includes and libraries.
1013 want_libcrypto=ifavailable
1015 AS_HELP_STRING([--with-crypto],
1016 [use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
1018 if test $withval = no
1022 elif test $withval = yes
1029 # Use libcrypto if it's present, otherwise don't.
1031 want_libcrypto=ifavailable
1032 AC_MSG_RESULT([yes, if available])
1034 if test "$want_libcrypto" != "no"; then
1035 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1036 AC_CHECK_HEADERS(openssl/evp.h)
1040 dnl set additional include path if necessary
1041 if test "$missing_includes" = "yes"; then
1042 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1043 V_INCLS="$V_INCLS -I$srcdir/missing"
1052 AC_SUBST(MAN_FILE_FORMATS)
1053 AC_SUBST(MAN_MISC_INFO)
1057 AC_CONFIG_HEADER(config.h)
1059 AC_OUTPUT_COMMANDS([if test -f .devel; then
1060 echo timestamp > stamp-h
1061 cat Makefile-devel-adds >> Makefile
1064 AC_OUTPUT(Makefile tcpdump.1)