1 dnl Copyright (c) 1994, 1995, 1996, 1997
2 dnl The Regents of the University of California. All rights reserved.
4 dnl Process this file with autoconf to produce a configure script.
10 # http://ftp.gnu.org/gnu/config/README
12 # for the URLs to use to fetch new versions of config.guess and
21 AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
23 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
26 if test "$ac_cv___attribute__" = "yes"; then
27 AC_C___ATTRIBUTE___UNUSED
28 AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER
29 AC_C___ATTRIBUTE___FORMAT
30 if test "$ac_cv___attribute___format" = "yes"; then
31 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
35 AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
36 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
37 #include <sys/socket.h>
39 if test "$ac_cv_header_net_pfvar_h" = yes; then
40 LOCALSRC="print-pflog.c $LOCALSRC"
42 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
43 #include <sys/socket.h>])
44 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
46 # The simple test didn't work.
47 # Do we need to include <net/if.h> first?
48 # Unset ac_cv_header_netinet_if_ether_h so we don't
49 # treat the previous failure as a cached value and
50 # suppress the next test.
52 AC_MSG_NOTICE([Rechecking with some additional includes])
53 unset ac_cv_header_netinet_if_ether_h
54 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
55 #include <sys/socket.h>
56 #include <netinet/in.h>
67 AC_ARG_ENABLE(universal,
68 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
69 if test "$enable_universal" != "no"; then
74 # Leopard. Build for x86 and 32-bit PowerPC, with
75 # x86 first. (That's what Apple does.)
77 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
78 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
83 # Snow Leopard. Build for x86-64 and x86, with
84 # x86-64 first. (That's what Apple does.)
86 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
87 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
94 AC_MSG_CHECKING(Linux kernel version)
95 if test "$cross_compiling" = yes; then
96 AC_CACHE_VAL(ac_cv_linux_vers,
97 ac_cv_linux_vers=unknown)
99 AC_CACHE_VAL(ac_cv_linux_vers,
100 ac_cv_linux_vers=`uname -r 2>&1 | \
101 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
103 AC_MSG_RESULT($ac_cv_linux_vers)
104 if test $ac_cv_linux_vers = unknown ; then
105 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
107 if test $ac_cv_linux_vers -lt 2 ; then
108 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
118 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
119 --without-smi don't link with libsmi],,
122 if test "x$with_smi" != "xno" ; then
123 AC_CHECK_HEADERS(smi.h)
124 AC_CHECK_LIB(smi, smiInit)
125 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
127 AC_MSG_CHECKING([whether to enable libsmi])
128 AC_TRY_RUN([ /* libsmi available check */
132 int current, revision, age, n;
133 const int required = 2;
136 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
138 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
141 if (required < current - age || required > current)
147 AC_DEFINE(LIBSMI, 1, [Define if you enable support for libsmi])
149 dnl autoconf documentation says that $? contains the exit value.
150 dnl reality is that it does not. We leave this in just in case
151 dnl autoconf ever comes back to match the documentation.
153 1) AC_MSG_RESULT(no - smiInit failed) ;;
154 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
155 3) AC_MSG_RESULT(no - can't determine library version) ;;
156 4) AC_MSG_RESULT(no - too old) ;;
157 *) AC_MSG_RESULT(no) ;;
160 [ AC_MSG_RESULT(not when cross-compiling)
166 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
168 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
169 --disable-smb disable possibly-buggy SMB printer],,
172 yes) AC_MSG_RESULT(yes)
173 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
174 AC_DEFINE(TCPDUMP_DO_SMB, 1,
175 [define if you want to build the possibly-buggy SMB printer])
176 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
182 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
183 AC_MSG_CHECKING([whether to drop root privileges by default])
184 if test ! -z "$with_user" ; then
185 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
186 [define if should drop privileges by default])
187 AC_MSG_RESULT(to \"$withval\")
192 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
193 AC_MSG_CHECKING([whether to chroot])
194 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
195 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
196 [define if should chroot when dropping privileges])
197 AC_MSG_RESULT(to \"$withval\")
203 # We must check this before checking whether to enable IPv6, because,
204 # on some platforms (such as SunOS 5.x), the test program requires
205 # the extra networking libraries.
209 AC_MSG_CHECKING([whether to enable ipv6])
211 [ --enable-ipv6 enable ipv6 (with ipv4) support
212 --disable-ipv6 disable ipv6 support],
213 [ case "$enableval" in
214 yes) AC_MSG_RESULT(yes)
215 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"
216 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
228 [[/* AF_INET6 available check */
229 #include <sys/types.h>
230 #include <sys/socket.h>
231 #include <netinet/in.h>
234 foo(struct in6_addr *addr)
236 memset(addr, 0, sizeof (struct in6_addr));
239 #error "AF_INET6 not defined"
244 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"
245 AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
257 if test "$ipv6" = "yes"; then
258 AC_MSG_CHECKING([ipv6 stack type])
259 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
262 dnl http://www.kame.net/
264 [#include <netinet/in.h>
265 #ifdef IPV6_INRIA_VERSION
269 CFLAGS="-DINET6 $CFLAGS"])
272 dnl http://www.kame.net/
274 [#include <netinet/in.h>
280 ipv6libdir=/usr/local/v6/lib;
282 CFLAGS="-DINET6 $CFLAGS"])
285 dnl http://www.v6.linux.or.jp/
287 [#include <features.h>
288 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
292 CFLAGS="-DINET6 $CFLAGS"])
295 dnl http://www.v6.linux.or.jp/
297 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
298 dnl and possibly other versions of those OSes
300 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
303 ipv6libdir=/usr/inet6/lib
305 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
310 [#include <sys/param.h>
311 #ifdef _TOSHIBA_INET6
316 ipv6libdir=/usr/local/v6/lib;
317 CFLAGS="-DINET6 $CFLAGS"])
321 [#include </usr/local/v6/include/sys/v6config.h>
327 ipv6libdir=/usr/local/v6/lib;
328 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
332 [#include <sys/param.h>
333 #ifdef _ZETA_MINAMI_INET6
338 ipv6libdir=/usr/local/v6/lib;
339 CFLAGS="-DINET6 $CFLAGS"])
342 if test "$ipv6type" != "unknown"; then
346 AC_MSG_RESULT($ipv6type)
349 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
350 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
351 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
352 echo "You have $ipv6lib library, using it"
354 if test "$ipv6trylibc" = "yes"; then
355 echo "You do not have $ipv6lib library, using libc"
357 echo 'Fatal: no $ipv6lib library found. cannot continue.'
358 echo "You need to fetch lib$ipv6lib.a from appropriate"
359 echo 'ipv6 kit and compile beforehand.'
366 if test "$ipv6" = "yes"; then
368 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
369 # function in libc; there are "ngetaddrinfo()" and
370 # "ogetaddrinfo()" functions, and <netdb.h> #defines
371 # "getaddrinfo" to be either "ngetaddrinfo" or
372 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
373 # or _XOPEN_SOURCE_EXTENDED are defined or not.
375 # So this test doesn't work on Tru64 5.1, and possibly
376 # on other 5.x releases. This causes the configure
377 # script to become confused, and results in libpcap
380 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
381 AC_MSG_CHECKING(getaddrinfo bug)
382 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
383 #include <sys/types.h>
386 #include <sys/socket.h>
387 #include <netinet/in.h>
391 int passive, gaierr, inet4 = 0, inet6 = 0;
392 struct addrinfo hints, *ai, *aitop;
393 char straddr[INET6_ADDRSTRLEN], strport[16];
395 for (passive = 0; passive <= 1; passive++) {
396 memset(&hints, 0, sizeof(hints));
397 hints.ai_family = AF_UNSPEC;
398 hints.ai_flags = passive ? AI_PASSIVE : 0;
399 hints.ai_socktype = SOCK_STREAM;
400 hints.ai_protocol = IPPROTO_TCP;
401 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
402 (void)gai_strerror(gaierr);
405 for (ai = aitop; ai; ai = ai->ai_next) {
406 if (ai->ai_addr == NULL ||
407 ai->ai_addrlen == 0 ||
408 getnameinfo(ai->ai_addr, ai->ai_addrlen,
409 straddr, sizeof(straddr), strport, sizeof(strport),
410 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
413 switch (ai->ai_family) {
415 if (strcmp(strport, "54321") != 0) {
419 if (strcmp(straddr, "0.0.0.0") != 0) {
423 if (strcmp(straddr, "127.0.0.1") != 0) {
430 if (strcmp(strport, "54321") != 0) {
434 if (strcmp(straddr, "::") != 0) {
438 if (strcmp(straddr, "::1") != 0) {
455 /* another family support? */
461 /* supported family should be 2, unsupported family should be 0 */
462 if (!(inet4 == 0 || inet4 == 2))
464 if (!(inet6 == 0 || inet6 == 2))
477 td_cv_buggygetaddrinfo=no,
478 td_cv_buggygetaddrinfo=yes,
479 td_cv_buggygetaddrinfo=yes)])
480 if test "$td_cv_buggygetaddrinfo" = no; then
486 if test "$td_cv_buggygetaddrinfo" = "yes"; then
488 # XXX - it doesn't appear that "ipv6type" can ever be
489 # set to "linux". Should this be testing for
490 # "linux-glibc", or for that *or* "linux-libinet6"?
491 # If the latter, note that "linux-libinet6" is also
492 # the type given to some non-Linux OSes.
494 if test "$ipv6type" != "linux"; then
495 echo 'Fatal: You must get working getaddrinfo() function.'
496 echo ' or you can specify "--disable-ipv6"'.
499 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
500 echo ' Better upgrade your system library to newest version'
501 echo ' of GNU C library (aka glibc).'
505 AC_REPLACE_FUNCS(getnameinfo)
508 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
509 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
510 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
511 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
512 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
513 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
514 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
515 [define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
519 dnl Checks for addrinfo structure
520 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
521 if test "$ac_cv_addrinfo" = no; then
526 dnl Checks for NI_MAXSERV
527 AC_NI_MAXSERV(ac_cv_maxserv)
528 if test "$ac_cv_maxserv" = no; then
533 dnl Checks for NI_NAMEREQD
534 AC_NI_NAMEREQD(ac_cv_namereqd)
535 if test "$ac_cv_namereqd" = no; then
539 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep getopt_long)
540 AC_CHECK_FUNCS(fork vfork strftime)
541 AC_CHECK_FUNCS(setlinebuf alarm)
544 AC_CHECK_FUNCS(vsnprintf snprintf,,
546 if test $needsnprintf = yes; then
552 AC_SEARCH_LIBS(dnet_htoa, dnet,
553 AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
555 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
557 dnl Some platforms may need -lnsl for getrpcbynumber.
558 AC_SEARCH_LIBS(getrpcbynumber, nsl,
559 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
561 dnl AC_CHECK_LIB(z, uncompress)
562 dnl AC_CHECK_HEADERS(zlib.h)
564 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
567 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
568 # libraries (e.g., "-lsocket -lnsl" on Solaris).
570 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
571 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
572 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
573 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
574 # it does not ship with a libc symbol "inet_ntop()", it ships with
575 # "_inet_ntop()", and has a #define macro in one of the system headers
578 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
579 AC_MSG_CHECKING(for inet_ntop)
580 AC_TRY_LINK([#include <sys/types.h>
581 #include <sys/socket.h>
582 #include <netinet/in.h>
583 #include <arpa/inet.h>], [char src[4], dst[128];
584 inet_ntop(AF_INET, src, dst, sizeof(dst));],
585 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
586 AC_LIBOBJ(inet_ntop)])
587 AC_MSG_CHECKING(for inet_pton)
588 AC_TRY_LINK([#include <sys/types.h>
589 #include <sys/socket.h>
590 #include <netinet/in.h>
591 #include <arpa/inet.h>], [char src[128], dst[4];
592 inet_pton(AF_INET, src, dst);],
593 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
594 AC_LIBOBJ(inet_pton)])
595 AC_MSG_CHECKING(for inet_aton)
596 AC_TRY_LINK([#include <sys/types.h>
597 #include <netinet/in.h>
598 #include <arpa/inet.h>], [char src[128];
600 inet_aton(src, &dst);],
601 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
602 AC_LIBOBJ(inet_aton)])
605 # Check for these after AC_LBL_LIBPCAP, for the same reason.
607 # You are in a twisty little maze of UN*Xes, all different.
608 # Some might not have ether_ntohost().
609 # Some might have it, but not declare it in any header file.
610 # Some might have it, but declare it in <netinet/if_ether.h>.
611 # Some might have it, but declare it in <netinet/ether.h>
612 # (And some might have it but document it as something declared in
613 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
615 # Before you is a C compiler.
617 AC_CHECK_FUNCS(ether_ntohost, [
618 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
621 #include <sys/types.h>
622 #include <sys/param.h>
623 #include <sys/socket.h>
626 main(int argc, char **argv)
628 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
629 char name[MAXHOSTNAMELEN];
631 ether_ntohost(name, (struct ether_addr *)ea);
634 ], [ac_cv_buggy_ether_ntohost=no],
635 [ac_cv_buggy_ether_ntohost=yes],
636 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
637 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
638 AC_DEFINE(USE_ETHER_NTOHOST, 1,
639 [define if you have ether_ntohost() and it works])
642 if test "$ac_cv_func_ether_ntohost" = yes -a \
643 "$ac_cv_buggy_ether_ntohost" = "no"; then
645 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
647 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
649 # Yes. Does it declare ether_ntohost()?
651 AC_CHECK_DECL(ether_ntohost,
653 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
654 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
657 #include <sys/types.h>
658 #include <sys/socket.h>
659 #include <netinet/in.h>
660 #include <arpa/inet.h>
664 #include <netinet/if_ether.h>
670 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
672 # No, how about <netinet/ether.h>, as on Linux?
674 AC_CHECK_HEADERS(netinet/ether.h)
675 if test "$ac_cv_header_netinet_ether_h" = yes; then
677 # We have it - does it declare ether_ntohost()?
678 # Unset ac_cv_have_decl_ether_ntohost so we don't
679 # treat the previous failure as a cached value and
680 # suppress the next test.
682 unset ac_cv_have_decl_ether_ntohost
683 AC_CHECK_DECL(ether_ntohost,
685 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
686 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
689 #include <netinet/ether.h>
694 # Is ether_ntohost() declared?
696 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
698 # No, we'll have to declare it ourselves.
699 # Do we have "struct ether_addr"?
701 AC_CHECK_TYPES(struct ether_addr,,,
703 #include <sys/types.h>
704 #include <sys/socket.h>
705 #include <netinet/in.h>
706 #include <arpa/inet.h>
710 #include <netinet/if_ether.h>
712 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
713 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
716 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
717 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
722 # libdlpi is needed for Solaris 11 and later.
723 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
725 dnl portability macros for getaddrinfo/getnameinfo
728 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
729 if test "$ac_cv_sockaddr_has_sa_len" = no; then
734 # Do we have the new open API? Check for pcap_create, and assume that,
735 # if we do, we also have pcap_activate() and the other new routines
736 # introduced in libpcap 1.0.0.
738 AC_CHECK_FUNCS(pcap_create)
739 if test $ac_cv_func_pcap_create = "yes" ; then
741 # OK, do we have pcap_set_tstamp_type? If so, assume we have
742 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
744 AC_CHECK_FUNCS(pcap_set_tstamp_type)
747 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection)
748 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
749 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
750 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
752 savedcppflags="$CPPFLAGS"
753 CPPFLAGS="$CPPFLAGS $V_INCLS"
754 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
755 CPPFLAGS="$savedcppflags"
758 if test $ac_cv_func_pcap_lib_version = "no" ; then
759 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
762 extern char pcap_version[];
764 return (int)pcap_version;
766 ac_lbl_cv_pcap_version_defined=yes,
767 ac_lbl_cv_pcap_version_defined=no)
768 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
770 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
775 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
778 extern int pcap_debug;
782 ac_lbl_cv_pcap_debug_defined=yes,
783 ac_lbl_cv_pcap_debug_defined=no)
784 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
786 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
790 # OK, what about "yydebug"?
792 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
799 ac_lbl_cv_yydebug_defined=yes,
800 ac_lbl_cv_yydebug_defined=no)
801 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
803 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
808 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
811 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
815 # Assume V7/BSD convention for man pages (file formats in section 5,
816 # miscellaneous info in section 7).
823 dnl Workaround to enable certain features
824 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
829 # Use System V conventions for man pages.
839 # Use System V conventions for man pages.
849 # Use System V conventions for man pages.
859 # Use System V conventions for man pages.
866 if test -f /dev/bpf0 ; then
871 # Make sure we have definitions for all the C99 specified-width types
872 # (regardless of whether the environment is a C99 environment or not).
884 # Define the old BSD specified-width types in terms of the C99 types;
885 # we may need them with libpcap include files.
887 AC_CHECK_TYPE([u_int8_t], ,
888 [AC_DEFINE([u_int8_t], [uint8_t],
889 [Define to `uint8_t' if u_int8_t not defined.])],
891 #include <sys/types.h>
893 AC_CHECK_TYPE([u_int16_t], ,
894 [AC_DEFINE([u_int16_t], [uint16_t],
895 [Define to `uint16_t' if u_int16_t not defined.])],
897 #include <sys/types.h>
899 AC_CHECK_TYPE([u_int32_t], ,
900 [AC_DEFINE([u_int32_t], [uint32_t],
901 [Define to `uint32_t' if u_int32_t not defined.])],
903 #include <sys/types.h>
905 AC_CHECK_TYPE([u_int64_t], ,
906 [AC_DEFINE([u_int64_t], [uint64_t],
907 [Define to `uint64_t' if u_int64_t not defined.])],
909 #include <sys/types.h>
913 # Check for <inttypes.h>
915 AC_CHECK_HEADERS(inttypes.h,
918 # OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
919 # Some systems have an inttypes.h that doesn't define all of them.
921 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
926 #include <inttypes.h>
928 #include <sys/types.h>
932 printf("%" PRId64 "\n", (uint64_t)1);
933 printf("%" PRIo64 "\n", (uint64_t)1);
934 printf("%" PRIx64 "\n", (uint64_t)1);
935 printf("%" PRIu64 "\n", (uint64_t)1);
941 ac_lbl_inttypes_h_defines_formats=yes
945 ac_lbl_inttypes_h_defines_formats=no
950 # We don't have inttypes.h, so it obviously can't define those
953 ac_lbl_inttypes_h_defines_formats=no
955 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
956 AC_LBL_CHECK_64BIT_FORMAT(l,
958 AC_LBL_CHECK_64BIT_FORMAT(ll,
960 AC_LBL_CHECK_64BIT_FORMAT(L,
962 AC_LBL_CHECK_64BIT_FORMAT(q,
964 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
972 # Check for some headers introduced in later versions of libpcap
973 # and used by some printers.
975 # Those headers use the {u_}intN_t types, so we must do this after
976 # we check for what's needed to get them defined.
978 savedcppflags="$CPPFLAGS"
979 CPPFLAGS="$CPPFLAGS $V_INCLS"
980 AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "tcpdump-stdinc.h"])
981 AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "tcpdump-stdinc.h"])
982 AC_CHECK_HEADERS(pcap/usb.h,,,[#include "tcpdump-stdinc.h"])
983 CPPFLAGS="$savedcppflags"
986 AC_CHECK_TOOL([AR], [ar])
988 AC_LBL_DEVEL(V_CCOPT)
990 AC_LBL_SOCKADDR_SA_LEN
992 AC_LBL_UNALIGNED_ACCESS
996 # Check for OpenSSL libcrypto
997 AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
998 # Specify location for both includes and libraries.
999 want_libcrypto=ifavailable
1001 AS_HELP_STRING([--with-crypto],
1002 [use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
1004 if test $withval = no
1008 elif test $withval = yes
1015 # Use libcrypto if it's present, otherwise don't.
1017 want_libcrypto=ifavailable
1018 AC_MSG_RESULT([yes, if available])
1020 if test "$want_libcrypto" != "no"; then
1021 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1022 AC_CHECK_HEADERS(openssl/evp.h)
1026 dnl set additional include path if necessary
1027 if test "$missing_includes" = "yes"; then
1028 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1029 V_INCLS="$V_INCLS -I$srcdir/missing"
1038 AC_SUBST(MAN_FILE_FORMATS)
1039 AC_SUBST(MAN_MISC_INFO)
1043 AC_CONFIG_HEADER(config.h)
1045 AC_OUTPUT_COMMANDS([if test -f .devel; then
1046 echo timestamp > stamp-h
1047 cat Makefile-devel-adds >> Makefile
1050 AC_OUTPUT(Makefile tcpdump.1)