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
18 AC_REVISION($Revision: 1.204 $)
24 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
26 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
29 if test "$ac_cv___attribute__" = "yes"; then
30 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
32 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
33 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
34 #include <sys/socket.h>
36 if test "$ac_cv_header_net_pfvar_h" = yes; then
37 LOCALSRC="print-pflog.c $LOCALSRC"
39 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
40 #include <sys/socket.h>])
41 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
43 # The simple test didn't work.
44 # Do we need to include <net/if.h> first?
45 # Unset ac_cv_header_netinet_if_ether_h so we don't
46 # treat the previous failure as a cached value and
47 # suppress the next test.
49 AC_MSG_NOTICE([Rechecking with some additional includes])
50 unset ac_cv_header_netinet_if_ether_h
51 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
52 #include <sys/socket.h>
53 #include <netinet/in.h>
64 AC_ARG_ENABLE(universal,
65 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
66 if test "$enable_universal" != "no"; then
71 # Leopard. Build for x86 and 32-bit PowerPC, with
72 # x86 first. (That's what Apple does.)
74 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
75 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
80 # Snow Leopard. Build for x86-64 and x86, with
81 # x86-64 first. (That's what Apple does.)
83 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
84 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
91 AC_MSG_CHECKING(Linux kernel version)
92 if test "$cross_compiling" = yes; then
93 AC_CACHE_VAL(ac_cv_linux_vers,
94 ac_cv_linux_vers=unknown)
96 AC_CACHE_VAL(ac_cv_linux_vers,
97 ac_cv_linux_vers=`uname -r 2>&1 | \
98 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
100 AC_MSG_RESULT($ac_cv_linux_vers)
101 if test $ac_cv_linux_vers = unknown ; then
102 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
104 if test $ac_cv_linux_vers -lt 2 ; then
105 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
115 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
116 --without-smi don't link with libsmi],,
119 if test "x$with_smi" != "xno" ; then
120 AC_CHECK_HEADERS(smi.h)
121 AC_CHECK_LIB(smi, smiInit)
122 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
124 AC_MSG_CHECKING([whether to enable libsmi])
125 AC_TRY_RUN([ /* libsmi available check */
129 int current, revision, age, n;
130 const int required = 2;
133 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
135 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
138 if (required < current - age || required > current)
146 dnl autoconf documentation says that $? contains the exit value.
147 dnl reality is that it does not. We leave this in just in case
148 dnl autoconf ever comes back to match the documentation.
150 1) AC_MSG_RESULT(no - smiInit failed) ;;
151 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
152 3) AC_MSG_RESULT(no - can't determine library version) ;;
153 4) AC_MSG_RESULT(no - too old) ;;
154 *) AC_MSG_RESULT(no) ;;
157 [ AC_MSG_RESULT(not when cross-compiling)
163 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
165 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
166 --disable-smb disable possibly-buggy SMB printer],,
169 yes) AC_MSG_RESULT(yes)
170 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
171 AC_DEFINE(TCPDUMP_DO_SMB)
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 AC_MSG_RESULT(to \"$withval\")
187 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
188 AC_MSG_CHECKING([whether to chroot])
189 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
190 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
191 AC_MSG_RESULT(to \"$withval\")
196 AC_MSG_CHECKING([whether to enable ipv6])
198 [ --enable-ipv6 enable ipv6 (with ipv4) support
199 --disable-ipv6 disable ipv6 support],
200 [ case "$enableval" in
201 yes) AC_MSG_RESULT(yes)
202 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 $LOCALSRC"
212 AC_TRY_RUN([ /* AF_INET6 available check */
213 #include <sys/types.h>
214 #include <sys/socket.h>
217 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
224 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 $LOCALSRC"
237 if test "$ipv6" = "yes"; then
238 AC_MSG_CHECKING([ipv6 stack type])
239 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
242 dnl http://www.kame.net/
244 [#include <netinet/in.h>
245 #ifdef IPV6_INRIA_VERSION
249 CFLAGS="-DINET6 $CFLAGS"])
252 dnl http://www.kame.net/
254 [#include <netinet/in.h>
260 ipv6libdir=/usr/local/v6/lib;
262 CFLAGS="-DINET6 $CFLAGS"])
265 dnl http://www.v6.linux.or.jp/
267 [#include <features.h>
268 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
272 CFLAGS="-DINET6 $CFLAGS"])
275 dnl http://www.v6.linux.or.jp/
277 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
278 dnl and possibly other versions of those OSes
280 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
283 ipv6libdir=/usr/inet6/lib
285 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
290 [#include <sys/param.h>
291 #ifdef _TOSHIBA_INET6
296 ipv6libdir=/usr/local/v6/lib;
297 CFLAGS="-DINET6 $CFLAGS"])
301 [#include </usr/local/v6/include/sys/v6config.h>
307 ipv6libdir=/usr/local/v6/lib;
308 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
312 [#include <sys/param.h>
313 #ifdef _ZETA_MINAMI_INET6
318 ipv6libdir=/usr/local/v6/lib;
319 CFLAGS="-DINET6 $CFLAGS"])
322 if test "$ipv6type" != "unknown"; then
326 AC_MSG_RESULT($ipv6type)
329 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
330 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
331 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
332 echo "You have $ipv6lib library, using it"
334 if test "$ipv6trylibc" = "yes"; then
335 echo "You do not have $ipv6lib library, using libc"
337 echo 'Fatal: no $ipv6lib library found. cannot continue.'
338 echo "You need to fetch lib$ipv6lib.a from appropriate"
339 echo 'ipv6 kit and compile beforehand.'
346 if test "$ipv6" = "yes"; then
348 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
349 # function in libc; there are "ngetaddrinfo()" and
350 # "ogetaddrinfo()" functions, and <netdb.h> #defines
351 # "getaddrinfo" to be either "ngetaddrinfo" or
352 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
353 # or _XOPEN_SOURCE_EXTENDED are defined or not.
355 # So this test doesn't work on Tru64 5.1, and possibly
356 # on other 5.x releases. This causes the configure
357 # script to become confused, and results in libpcap
360 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
361 AC_MSG_CHECKING(getaddrinfo bug)
362 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
363 #include <sys/types.h>
366 #include <sys/socket.h>
367 #include <netinet/in.h>
371 int passive, gaierr, inet4 = 0, inet6 = 0;
372 struct addrinfo hints, *ai, *aitop;
373 char straddr[INET6_ADDRSTRLEN], strport[16];
375 for (passive = 0; passive <= 1; passive++) {
376 memset(&hints, 0, sizeof(hints));
377 hints.ai_family = AF_UNSPEC;
378 hints.ai_flags = passive ? AI_PASSIVE : 0;
379 hints.ai_socktype = SOCK_STREAM;
380 hints.ai_protocol = IPPROTO_TCP;
381 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
382 (void)gai_strerror(gaierr);
385 for (ai = aitop; ai; ai = ai->ai_next) {
386 if (ai->ai_addr == NULL ||
387 ai->ai_addrlen == 0 ||
388 getnameinfo(ai->ai_addr, ai->ai_addrlen,
389 straddr, sizeof(straddr), strport, sizeof(strport),
390 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
393 switch (ai->ai_family) {
395 if (strcmp(strport, "54321") != 0) {
399 if (strcmp(straddr, "0.0.0.0") != 0) {
403 if (strcmp(straddr, "127.0.0.1") != 0) {
410 if (strcmp(strport, "54321") != 0) {
414 if (strcmp(straddr, "::") != 0) {
418 if (strcmp(straddr, "::1") != 0) {
435 /* another family support? */
441 /* supported family should be 2, unsupported family should be 0 */
442 if (!(inet4 == 0 || inet4 == 2))
444 if (!(inet6 == 0 || inet6 == 2))
457 td_cv_buggygetaddrinfo=no,
458 td_cv_buggygetaddrinfo=yes,
459 td_cv_buggygetaddrinfo=yes)])
460 if test "$td_cv_buggygetaddrinfo" = no; then
466 if test "$td_cv_buggygetaddrinfo" = "yes"; then
468 # XXX - it doesn't appear that "ipv6type" can ever be
469 # set to "linux". Should this be testing for
470 # "linux-glibc", or for that *or* "linux-libinet6"?
471 # If the latter, note that "linux-libinet6" is also
472 # the type given to some non-Linux OSes.
474 if test "$ipv6type" != "linux"; then
475 echo 'Fatal: You must get working getaddrinfo() function.'
476 echo ' or you can specify "--disable-ipv6"'.
479 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
480 echo ' Better upgrade your system library to newest version'
481 echo ' of GNU C library (aka glibc).'
485 AC_REPLACE_FUNCS(getnameinfo)
488 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
489 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
490 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
491 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
492 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
493 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
494 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
498 dnl Checks for addrinfo structure
499 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
500 if test "$ac_cv_addrinfo" = no; then
505 dnl Checks for NI_MAXSERV
506 AC_NI_MAXSERV(ac_cv_maxserv)
507 if test "$ac_cv_maxserv" = no; then
512 dnl Checks for NI_NAMEREQD
513 AC_NI_NAMEREQD(ac_cv_namereqd)
514 if test "$ac_cv_namereqd" = no; then
519 dnl Checks for sockaddr_storage structure
520 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
521 if test "$ac_cv_sa_storage" = no; then
526 dnl Checks for IN[6]ADDRSZ
527 AC_CHECK_ADDRSZ(ac_cv_addrsz)
528 if test "$ac_cv_addrsz" = no; then
533 dnl Checks for RES_USE_INET6
534 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
535 if test "$ac_cv_res_inet6" = no; then
540 dnl Checks for res_state_ext structure
541 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
542 if test "$ac_cv_res_state_ext" = no; then
547 dnl Checks if res_state structure has nsort member.
548 AC_STRUCT_RES_STATE(ac_cv_res_state)
551 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
552 AC_CHECK_FUNCS(strftime)
553 AC_CHECK_FUNCS(setlinebuf alarm)
556 AC_CHECK_FUNCS(vsnprintf snprintf,,
558 if test $needsnprintf = yes; then
564 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
566 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
568 dnl Some platforms may need -lnsl for getrpcbynumber.
569 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
571 dnl AC_CHECK_LIB(z, uncompress)
572 dnl AC_CHECK_HEADERS(zlib.h)
574 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
577 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
578 # libraries (e.g., "-lsocket -lnsl" on Solaris).
580 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
581 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
582 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
583 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
584 # it does not ship with a libc symbol "inet_ntop()", it ships with
585 # "_inet_ntop()", and has a #define macro in one of the system headers
588 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
589 AC_MSG_CHECKING(for inet_ntop)
590 AC_TRY_LINK([#include <sys/types.h>
591 #include <sys/socket.h>
592 #include <netinet/in.h>
593 #include <arpa/inet.h>], [char src[4], dst[128];
594 inet_ntop(AF_INET, src, dst, sizeof(dst));],
595 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
596 AC_LIBOBJ(inet_ntop)])
597 AC_MSG_CHECKING(for inet_pton)
598 AC_TRY_LINK([#include <sys/types.h>
599 #include <sys/socket.h>
600 #include <netinet/in.h>
601 #include <arpa/inet.h>], [char src[128], dst[4];
602 inet_pton(AF_INET, src, dst);],
603 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
604 AC_LIBOBJ(inet_pton)])
605 AC_MSG_CHECKING(for inet_aton)
606 AC_TRY_LINK([#include <sys/types.h>
607 #include <netinet/in.h>
608 #include <arpa/inet.h>], [char src[128];
610 inet_aton(src, &dst);],
611 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
612 AC_LIBOBJ(inet_aton)])
615 # Check for these after AC_LBL_LIBPCAP, for the same reason.
617 # You are in a twisty little maze of UN*Xes, all different.
618 # Some might not have ether_ntohost().
619 # Some might have it, but not declare it in any header file.
620 # Some might have it, but declare it in <netinet/if_ether.h>.
621 # Some might have it, but declare it in <netinet/ether.h>
622 # (And some might have it but document it as something declared in
623 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
625 # Before you is a C compiler.
627 AC_CHECK_FUNCS(ether_ntohost, [
628 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
631 #include <sys/types.h>
632 #include <sys/param.h>
633 #include <sys/socket.h>
636 main(int argc, char **argv)
638 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
639 char name[MAXHOSTNAMELEN];
641 ether_ntohost(name, (struct ether_addr *)ea);
644 ], [ac_cv_buggy_ether_ntohost=no],
645 [ac_cv_buggy_ether_ntohost=yes],
646 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
647 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
648 AC_DEFINE(USE_ETHER_NTOHOST)
651 if test "$ac_cv_func_ether_ntohost" = yes -a \
652 "$ac_cv_buggy_ether_ntohost" = "no"; then
654 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
656 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
658 # Yes. Does it declare ether_ntohost()?
660 AC_CHECK_DECL(ether_ntohost,
662 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
663 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
666 #include <sys/types.h>
667 #include <sys/socket.h>
668 #include <netinet/in.h>
669 #include <arpa/inet.h>
673 #include <netinet/if_ether.h>
679 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
681 # No, how about <netinet/ether.h>, as on Linux?
683 AC_CHECK_HEADERS(netinet/ether.h)
684 if test "$ac_cv_header_netinet_ether_h" = yes; then
686 # We have it - does it declare ether_ntohost()?
687 # Unset ac_cv_have_decl_ether_ntohost so we don't
688 # treat the previous failure as a cached value and
689 # suppress the next test.
691 unset ac_cv_have_decl_ether_ntohost
692 AC_CHECK_DECL(ether_ntohost,
694 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
695 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
698 #include <netinet/ether.h>
703 # Is ether_ntohost() declared?
705 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
707 # No, we'll have to declare it ourselves.
708 # Do we have "struct ether_addr"?
710 AC_CHECK_TYPES(struct ether_addr,,,
712 #include <sys/types.h>
713 #include <sys/socket.h>
714 #include <netinet/in.h>
715 #include <arpa/inet.h>
719 #include <netinet/if_ether.h>
721 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
722 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
725 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
726 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
731 # libdlpi is needed for Solaris 11 and later.
732 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
734 dnl portability macros for getaddrinfo/getnameinfo
737 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
738 if test "$ac_cv_sockaddr_has_sa_len" = no; then
743 # Do we have the new open API? Check for pcap_create, and assume that,
744 # if we do, we also have pcap_activate() and the other new routines.
745 AC_CHECK_FUNCS(pcap_create)
747 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
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 savedppflags="$CPPLAGS"
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)
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)
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)
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 # Check for some headers introduced in later versions of libpcap
872 # and used by some printers.
874 savedcppflags="$CPPFLAGS"
875 CPPFLAGS="$CPPFLAGS $V_INCLS"
876 AC_CHECK_HEADERS(pcap/bluetooth.h)
877 AC_CHECK_HEADERS(pcap/usb.h)
878 CPPFLAGS="$savedcppflags"
880 AC_CHECK_HEADERS(sys/bitypes.h)
882 AC_CHECK_TYPE([int8_t], ,
883 [AC_DEFINE([int8_t], [signed char],
884 [Define to `signed char' if int8_t not defined.])],
886 #ifdef HAVE_SYS_BITYPES_H
887 #include <sys/bitypes.h>
889 AC_CHECK_TYPE([u_int8_t], ,
890 [AC_DEFINE([u_int8_t], [unsigned char],
891 [Define to `unsigned char' if u_int8_t not defined.])],
893 #ifdef HAVE_SYS_BITYPES_H
894 #include <sys/bitypes.h>
896 AC_CHECK_TYPE([int16_t], ,
897 [AC_DEFINE([int16_t], [short],
898 [Define to `short' if int16_t not defined.])]
900 #ifdef HAVE_SYS_BITYPES_H
901 #include <sys/bitypes.h>
903 AC_CHECK_TYPE([u_int16_t], ,
904 [AC_DEFINE([u_int16_t], [unsigned short],
905 [Define to `unsigned short' if u_int16_t not defined.])],
907 #ifdef HAVE_SYS_BITYPES_H
908 #include <sys/bitypes.h>
910 AC_CHECK_TYPE([int32_t], ,
911 [AC_DEFINE([int32_t], [int],
912 [Define to `int' if int32_t not defined.])],
914 #ifdef HAVE_SYS_BITYPES_H
915 #include <sys/bitypes.h>
917 AC_CHECK_TYPE([u_int32_t], ,
918 [AC_DEFINE([u_int32_t], [unsigned int],
919 [Define to `unsigned int' if u_int32_t not defined.])],
921 #ifdef HAVE_SYS_BITYPES_H
922 #include <sys/bitypes.h>
924 AC_CHECK_TYPE([int64_t], ,
925 [AC_DEFINE([int64_t], [long long],
926 [Define to `long long' if int64_t not defined.])],
928 #ifdef HAVE_SYS_BITYPES_H
929 #include <sys/bitypes.h>
931 AC_CHECK_TYPE([u_int64_t], ,
932 [AC_DEFINE([u_int64_t], [unsigned long long],
933 [Define to `unsigned long long' if u_int64_t not defined.])],
935 #ifdef HAVE_SYS_BITYPES_H
936 #include <sys/bitypes.h>
940 # We can't just check for <inttypes.h> - some systems have one that
941 # doesn't define all the PRI[doxu]64 macros.
943 AC_CHECK_HEADERS(inttypes.h,
946 # OK, we have inttypes.h, but does it define those macros?
948 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
953 #include <inttypes.h>
955 #include <sys/types.h>
956 #ifdef HAVE_SYS_BITYPES_H
957 #include <sys/bitypes.h>
962 printf("%" PRId64 "\n", (u_int64_t)1);
963 printf("%" PRIo64 "\n", (u_int64_t)1);
964 printf("%" PRIx64 "\n", (u_int64_t)1);
965 printf("%" PRIu64 "\n", (u_int64_t)1);
971 ac_lbl_inttypes_h_defines_formats=yes
975 ac_lbl_inttypes_h_defines_formats=no
980 # We don't have inttypes.h, so it obviously can't define those
983 ac_lbl_inttypes_h_defines_formats=no
985 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
986 AC_LBL_CHECK_64BIT_FORMAT(l,
988 AC_LBL_CHECK_64BIT_FORMAT(ll,
990 AC_LBL_CHECK_64BIT_FORMAT(L,
992 AC_LBL_CHECK_64BIT_FORMAT(q,
994 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
1003 AC_LBL_DEVEL(V_CCOPT)
1005 AC_LBL_SOCKADDR_SA_LEN
1007 AC_LBL_UNALIGNED_ACCESS
1012 AC_MSG_CHECKING(whether to use SSLeay libcrypto)
1013 # Specify location for both includes and libraries.
1014 want_libcrypto=youmama
1016 AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
1017 [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]),
1019 if test $withval = no
1023 elif test $withval = yes
1034 # Use libcrypto if it's present, otherwise don't.
1036 want_libcrypto=ifavailable
1037 AC_MSG_RESULT([yes, if available])
1039 if test "$want_libcrypto" != "no"; then
1040 ac_cv_ssleay_path=no
1042 if test "x$crypto_dir" = x; then
1044 # Location not specified; check the default locations.
1046 AC_MSG_CHECKING(where SSLeay is located)
1047 dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1048 if test "x${host_alias}" != x; then
1049 dirs="/usr/${host_alias} $dirs"
1051 for dir in $dirs; do
1054 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1057 ac_cv_ssleay_path=no
1061 if test "$ac_cv_ssleay_path" != no; then
1062 AC_MSG_RESULT($ac_cv_ssleay_path)
1065 AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1066 AC_LBL_SSLEAY($crypto_dir)
1067 if test "$ac_cv_ssleay_path" != no; then
1068 AC_MSG_RESULT(found)
1071 if test "$ac_cv_ssleay_path" != no; then
1072 V_INCLS="$V_INCLS $incdir"
1073 if test "$dir" != "/usr"; then
1074 LDFLAGS="-L$dir/lib $LDFLAGS"
1076 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1077 LIBS="$LIBS -lRSAglue"
1079 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1080 LIBS="$LIBS -lrsaref"
1082 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1084 CPPFLAGS="$CPPFLAGS $V_INCLS"
1085 AC_CHECK_HEADERS(openssl/evp.h)
1088 # Not found. Did the user explicitly ask for it?
1090 AC_MSG_RESULT(not found)
1091 if test "$want_libcrypto" = yes; then
1092 AC_MSG_ERROR(SSLeay not found)
1098 dnl set additional include path if necessary
1099 if test "$missing_includes" = "yes"; then
1100 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
1101 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
1110 AC_SUBST(MAN_FILE_FORMATS)
1111 AC_SUBST(MAN_MISC_INFO)
1115 AC_CONFIG_HEADER(config.h)
1117 AC_OUTPUT_COMMANDS([if test -f .devel; then
1118 echo timestamp > stamp-h
1119 cat Makefile-devel-adds >> Makefile
1122 AC_OUTPUT(Makefile tcpdump.1)