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(V_CCOPT, V_INCLS)
27 if test "$ac_cv___attribute__" = "yes"; then
28 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
30 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
31 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
32 #include <sys/socket.h>
34 if test "$ac_cv_header_net_pfvar_h" = yes; then
35 LOCALSRC="print-pflog.c $LOCALSRC"
37 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
38 #include <sys/socket.h>])
39 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
41 # The simple test didn't work.
42 # Do we need to include <net/if.h> first?
43 # Unset ac_cv_header_netinet_if_ether_h so we don't
44 # treat the previous failure as a cached value and
45 # suppress the next test.
47 AC_MSG_NOTICE([Rechecking with some additional includes])
48 unset ac_cv_header_netinet_if_ether_h
49 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
50 #include <sys/socket.h>
51 #include <netinet/in.h>
62 AC_MSG_CHECKING(Linux kernel version)
63 if test "$cross_compiling" = yes; then
64 AC_CACHE_VAL(ac_cv_linux_vers,
65 ac_cv_linux_vers=unknown)
67 AC_CACHE_VAL(ac_cv_linux_vers,
68 ac_cv_linux_vers=`uname -r 2>&1 | \
69 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
71 AC_MSG_RESULT($ac_cv_linux_vers)
72 if test $ac_cv_linux_vers = unknown ; then
73 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
75 if test $ac_cv_linux_vers -lt 2 ; then
76 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
86 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
87 --without-smi don't link with libsmi],,
90 if test "x$with_smi" != "xno" ; then
91 AC_CHECK_HEADERS(smi.h)
92 AC_CHECK_LIB(smi, smiInit)
93 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
95 AC_MSG_CHECKING([whether to enable libsmi])
96 AC_TRY_RUN([ /* libsmi available check */
100 int current, revision, age, n;
101 const int required = 2;
104 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
106 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
109 if (required < current - age || required > current)
117 dnl autoconf documentation says that $? contains the exit value.
118 dnl reality is that it does not. We leave this in just in case
119 dnl autoconf ever comes back to match the documentation.
121 1) AC_MSG_RESULT(no - smiInit failed) ;;
122 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
123 3) AC_MSG_RESULT(no - can't determine library version) ;;
124 4) AC_MSG_RESULT(no - too old) ;;
125 *) AC_MSG_RESULT(no) ;;
128 [ AC_MSG_RESULT(not when cross-compiling)
134 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
136 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
137 --disable-smb disable possibly-buggy SMB printer],,
140 yes) AC_MSG_RESULT(yes)
141 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
142 AC_DEFINE(TCPDUMP_DO_SMB)
143 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
149 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
150 AC_MSG_CHECKING([whether to drop root privileges by default])
151 if test ! -z "$with_user" ; then
152 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
153 AC_MSG_RESULT(to \"$withval\")
158 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
159 AC_MSG_CHECKING([whether to chroot])
160 if test ! -z "$with_chroot" ; then
161 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
162 AC_MSG_RESULT(to \"$withval\")
167 AC_MSG_CHECKING([whether to enable ipv6])
169 [ --enable-ipv6 enable ipv6 (with ipv4) support
170 --disable-ipv6 disable ipv6 support],
171 [ case "$enableval" in
172 yes) AC_MSG_RESULT(yes)
173 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"
183 AC_TRY_RUN([ /* AF_INET6 available check */
184 #include <sys/types.h>
185 #include <sys/socket.h>
188 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
195 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"
208 if test "$ipv6" = "yes"; then
209 AC_MSG_CHECKING([ipv6 stack type])
210 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
213 dnl http://www.kame.net/
215 [#include <netinet/in.h>
216 #ifdef IPV6_INRIA_VERSION
220 CFLAGS="-DINET6 $CFLAGS"])
223 dnl http://www.kame.net/
225 [#include <netinet/in.h>
231 ipv6libdir=/usr/local/v6/lib;
233 CFLAGS="-DINET6 $CFLAGS"])
236 dnl http://www.v6.linux.or.jp/
238 [#include <features.h>
239 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
243 CFLAGS="-DINET6 $CFLAGS"])
246 dnl http://www.v6.linux.or.jp/
248 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
249 dnl and possibly other versions of those OSes
251 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
254 ipv6libdir=/usr/inet6/lib
256 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
261 [#include <sys/param.h>
262 #ifdef _TOSHIBA_INET6
267 ipv6libdir=/usr/local/v6/lib;
268 CFLAGS="-DINET6 $CFLAGS"])
272 [#include </usr/local/v6/include/sys/v6config.h>
278 ipv6libdir=/usr/local/v6/lib;
279 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
283 [#include <sys/param.h>
284 #ifdef _ZETA_MINAMI_INET6
289 ipv6libdir=/usr/local/v6/lib;
290 CFLAGS="-DINET6 $CFLAGS"])
293 if test "$ipv6type" != "unknown"; then
297 AC_MSG_RESULT($ipv6type)
300 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
301 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
302 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
303 echo "You have $ipv6lib library, using it"
305 if test "$ipv6trylibc" = "yes"; then
306 echo "You do not have $ipv6lib library, using libc"
308 echo 'Fatal: no $ipv6lib library found. cannot continue.'
309 echo "You need to fetch lib$ipv6lib.a from appropriate"
310 echo 'ipv6 kit and compile beforehand.'
317 if test "$ipv6" = "yes"; then
319 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
320 # function in libc; there are "ngetaddrinfo()" and
321 # "ogetaddrinfo()" functions, and <netdb.h> #defines
322 # "getaddrinfo" to be either "ngetaddrinfo" or
323 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
324 # or _XOPEN_SOURCE_EXTENDED are defined or not.
326 # So this test doesn't work on Tru64 5.1, and possibly
327 # on other 5.x releases. This causes the configure
328 # script to become confused, and results in libpcap
331 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
332 AC_MSG_CHECKING(getaddrinfo bug)
333 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
334 #include <sys/types.h>
337 #include <sys/socket.h>
338 #include <netinet/in.h>
342 int passive, gaierr, inet4 = 0, inet6 = 0;
343 struct addrinfo hints, *ai, *aitop;
344 char straddr[INET6_ADDRSTRLEN], strport[16];
346 for (passive = 0; passive <= 1; passive++) {
347 memset(&hints, 0, sizeof(hints));
348 hints.ai_family = AF_UNSPEC;
349 hints.ai_flags = passive ? AI_PASSIVE : 0;
350 hints.ai_socktype = SOCK_STREAM;
351 hints.ai_protocol = IPPROTO_TCP;
352 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
353 (void)gai_strerror(gaierr);
356 for (ai = aitop; ai; ai = ai->ai_next) {
357 if (ai->ai_addr == NULL ||
358 ai->ai_addrlen == 0 ||
359 getnameinfo(ai->ai_addr, ai->ai_addrlen,
360 straddr, sizeof(straddr), strport, sizeof(strport),
361 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
364 switch (ai->ai_family) {
366 if (strcmp(strport, "54321") != 0) {
370 if (strcmp(straddr, "0.0.0.0") != 0) {
374 if (strcmp(straddr, "127.0.0.1") != 0) {
381 if (strcmp(strport, "54321") != 0) {
385 if (strcmp(straddr, "::") != 0) {
389 if (strcmp(straddr, "::1") != 0) {
406 /* another family support? */
412 /* supported family should be 2, unsupported family should be 0 */
413 if (!(inet4 == 0 || inet4 == 2))
415 if (!(inet6 == 0 || inet6 == 2))
428 td_cv_buggygetaddrinfo=no,
429 td_cv_buggygetaddrinfo=yes,
430 td_cv_buggygetaddrinfo=yes)])
431 if test "$td_cv_buggygetaddrinfo" = no; then
437 if test "$td_cv_buggygetaddrinfo" = "yes"; then
439 # XXX - it doesn't appear that "ipv6type" can ever be
440 # set to "linux". Should this be testing for
441 # "linux-glibc", or for that *or* "linux-libinet6"?
442 # If the latter, note that "linux-libinet6" is also
443 # the type given to some non-Linux OSes.
445 if test "$ipv6type" != "linux"; then
446 echo 'Fatal: You must get working getaddrinfo() function.'
447 echo ' or you can specify "--disable-ipv6"'.
450 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
451 echo ' Better upgrade your system library to newest version'
452 echo ' of GNU C library (aka glibc).'
456 AC_REPLACE_FUNCS(getnameinfo)
459 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
460 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
461 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
462 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
463 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
464 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
465 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
469 dnl check sizeof basic types.
470 dnl They're very likely to be wrong for cross-compiling.
471 AC_CHECK_SIZEOF(char, 1)
472 AC_CHECK_SIZEOF(short, 2)
473 AC_CHECK_SIZEOF(int, 4)
474 AC_CHECK_SIZEOF(long, 4)
475 AC_CHECK_SIZEOF(long long, 8)
478 dnl Checks for addrinfo structure
479 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
480 if test "$ac_cv_addrinfo" = no; then
485 dnl Checks for NI_MAXSERV
486 AC_NI_MAXSERV(ac_cv_maxserv)
487 if test "$ac_cv_maxserv" = no; then
492 dnl Checks for NI_NAMEREQD
493 AC_NI_NAMEREQD(ac_cv_namereqd)
494 if test "$ac_cv_namereqd" = no; then
499 dnl Checks for sockaddr_storage structure
500 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
501 if test "$ac_cv_sa_storage" = no; then
506 dnl Checks for IN[6]ADDRSZ
507 AC_CHECK_ADDRSZ(ac_cv_addrsz)
508 if test "$ac_cv_addrsz" = no; then
513 dnl Checks for RES_USE_INET6
514 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
515 if test "$ac_cv_res_inet6" = no; then
520 dnl Checks for res_state_ext structure
521 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
522 if test "$ac_cv_res_state_ext" = no; then
527 dnl Checks if res_state structure has nsort member.
528 AC_STRUCT_RES_STATE(ac_cv_res_state)
531 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
532 AC_CHECK_FUNCS(strftime)
533 AC_CHECK_FUNCS(setlinebuf alarm)
536 AC_CHECK_FUNCS(vsnprintf snprintf,,
538 if test $needsnprintf = yes; then
544 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
546 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
548 dnl Some platforms may need -lnsl for getrpcbynumber.
549 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
551 dnl AC_CHECK_LIB(z, uncompress)
552 dnl AC_CHECK_HEADERS(zlib.h)
554 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
557 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
558 # libraries (e.g., "-lsocket -lnsl" on Solaris).
560 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
561 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
562 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
563 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
564 # it does not ship with a libc symbol "inet_ntop()", it ships with
565 # "_inet_ntop()", and has a #define macro in one of the system headers
568 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
569 AC_MSG_CHECKING(for inet_ntop)
570 AC_TRY_LINK([#include <sys/types.h>
571 #include <sys/socket.h>
572 #include <netinet/in.h>
573 #include <arpa/inet.h>], [char src[4], dst[128];
574 inet_ntop(AF_INET, src, dst, sizeof(dst));],
575 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
576 AC_LIBOBJ(inet_ntop)])
577 AC_MSG_CHECKING(for inet_pton)
578 AC_TRY_LINK([#include <sys/types.h>
579 #include <sys/socket.h>
580 #include <netinet/in.h>
581 #include <arpa/inet.h>], [char src[128], dst[4];
582 inet_pton(AF_INET, src, dst);],
583 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
584 AC_LIBOBJ(inet_pton)])
585 AC_MSG_CHECKING(for inet_aton)
586 AC_TRY_LINK([#include <sys/types.h>
587 #include <netinet/in.h>
588 #include <arpa/inet.h>], [char src[128];
590 inet_aton(src, &dst);],
591 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
592 AC_LIBOBJ(inet_aton)])
595 # Check for these after AC_LBL_LIBPCAP, for the same reason.
597 # You are in a twisty little maze of UN*Xes, all different.
598 # Some might not have ether_ntohost().
599 # Some might have it, but not declare it in any header file.
600 # Some might have it, but declare it in <netinet/if_ether.h>.
601 # Some might have it, but declare it in <netinet/ether.h>
602 # (And some might have it but document it as something declared in
603 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
605 # Before you is a C compiler.
607 AC_CHECK_FUNCS(ether_ntohost, [
608 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
611 #include <sys/types.h>
612 #include <sys/param.h>
613 #include <sys/socket.h>
616 main(int argc, char **argv)
618 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
619 char name[MAXHOSTNAMELEN];
621 ether_ntohost(name, (struct ether_addr *)ea);
624 ], [ac_cv_buggy_ether_ntohost=no],
625 [ac_cv_buggy_ether_ntohost=yes],
626 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
627 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
628 AC_DEFINE(USE_ETHER_NTOHOST)
631 if test "$ac_cv_func_ether_ntohost" = yes -a \
632 "$ac_cv_buggy_ether_ntohost" = "no"; then
634 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
636 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
638 # Yes. Does it declare ether_ntohost()?
640 AC_CHECK_DECL(ether_ntohost,
642 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
643 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
646 #include <sys/types.h>
647 #include <sys/socket.h>
648 #include <netinet/in.h>
649 #include <arpa/inet.h>
653 #include <netinet/if_ether.h>
659 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
661 # No, how about <netinet/ether.h>, as on Linux?
663 AC_CHECK_HEADERS(netinet/ether.h)
664 if test "$ac_cv_header_netinet_ether_h" = yes; then
666 # We have it - does it declare ether_ntohost()?
667 # Unset ac_cv_have_decl_ether_ntohost so we don't
668 # treat the previous failure as a cached value and
669 # suppress the next test.
671 unset ac_cv_have_decl_ether_ntohost
672 AC_CHECK_DECL(ether_ntohost,
674 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
675 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
678 #include <netinet/ether.h>
683 # Is ether_ntohost() declared?
685 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
687 # No, we'll have to declare it ourselves.
688 # Do we have "struct ether_addr"?
690 AC_CHECK_TYPES(struct ether_addr,,,
692 #include <sys/types.h>
693 #include <sys/socket.h>
694 #include <netinet/in.h>
695 #include <arpa/inet.h>
699 #include <netinet/if_ether.h>
701 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
702 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
705 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
706 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
711 # libdlpi is needed for Solaris 11 and later.
712 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
714 dnl portability macros for getaddrinfo/getnameinfo
717 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
718 if test "$ac_cv_sockaddr_has_sa_len" = no; then
723 # Do we have the new open API? Check for pcap_create, and assume that,
724 # if we do, we also have pcap_activate() and the other new routines.
725 AC_CHECK_FUNCS(pcap_create)
727 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
728 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
729 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
730 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
732 savedppflags="$CPPLAGS"
733 CPPFLAGS="$CPPFLAGS $V_INCLS"
734 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
735 CPPFLAGS="$savedcppflags"
738 if test $ac_cv_func_pcap_lib_version = "no" ; then
739 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
742 extern char pcap_version[];
744 return (int)pcap_version;
746 ac_lbl_cv_pcap_version_defined=yes,
747 ac_lbl_cv_pcap_version_defined=no)
748 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
750 AC_DEFINE(HAVE_PCAP_VERSION)
755 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
758 extern int pcap_debug;
762 ac_lbl_cv_pcap_debug_defined=yes,
763 ac_lbl_cv_pcap_debug_defined=no)
764 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
766 AC_DEFINE(HAVE_PCAP_DEBUG)
770 # OK, what about "yydebug"?
772 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
779 ac_lbl_cv_yydebug_defined=yes,
780 ac_lbl_cv_yydebug_defined=no)
781 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
783 AC_DEFINE(HAVE_YYDEBUG)
788 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
791 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
795 # Assume V7/BSD convention for man pages (file formats in section 5,
796 # miscellaneous info in section 7).
803 dnl Workaround to enable certain features
809 # Use System V conventions for man pages.
819 # Use System V conventions for man pages.
829 # Use System V conventions for man pages.
839 # Use System V conventions for man pages.
846 if test -f /dev/bpf0 ; then
851 # Check for some headers introduced in later versions of libpcap
852 # and used by some printers.
854 savedcppflags="$CPPFLAGS"
855 CPPFLAGS="$CPPFLAGS $V_INCLS"
856 AC_CHECK_HEADERS(pcap/bluetooth.h)
857 AC_CHECK_HEADERS(pcap/usb.h)
858 CPPFLAGS="$savedcppflags"
860 AC_CHECK_HEADERS(sys/bitypes.h)
862 AC_CHECK_TYPE([int8_t], ,
863 [AC_DEFINE([int8_t], [signed char],
864 [Define to `signed char' if int8_t not defined.])],
866 #ifdef HAVE_SYS_BITYPES_H
867 #include <sys/bitypes.h>
869 AC_CHECK_TYPE([u_int8_t], ,
870 [AC_DEFINE([u_int8_t], [unsigned char],
871 [Define to `unsigned char' if u_int8_t not defined.])],
873 #ifdef HAVE_SYS_BITYPES_H
874 #include <sys/bitypes.h>
876 AC_CHECK_TYPE([int16_t], ,
877 [AC_DEFINE([int16_t], [short],
878 [Define to `short' if int16_t not defined.])]
880 #ifdef HAVE_SYS_BITYPES_H
881 #include <sys/bitypes.h>
883 AC_CHECK_TYPE([u_int16_t], ,
884 [AC_DEFINE([u_int16_t], [unsigned short],
885 [Define to `unsigned short' if u_int16_t not defined.])],
887 #ifdef HAVE_SYS_BITYPES_H
888 #include <sys/bitypes.h>
890 AC_CHECK_TYPE([int32_t], ,
891 [AC_DEFINE([int32_t], [int],
892 [Define to `int' if int32_t not defined.])],
894 #ifdef HAVE_SYS_BITYPES_H
895 #include <sys/bitypes.h>
897 AC_CHECK_TYPE([u_int32_t], ,
898 [AC_DEFINE([u_int32_t], [unsigned int],
899 [Define to `unsigned int' if u_int32_t not defined.])],
901 #ifdef HAVE_SYS_BITYPES_H
902 #include <sys/bitypes.h>
904 AC_CHECK_TYPE([int64_t], ,
905 [AC_DEFINE([int64_t], [long long],
906 [Define to `long long' if int64_t not defined.])],
908 #ifdef HAVE_SYS_BITYPES_H
909 #include <sys/bitypes.h>
911 AC_CHECK_TYPE([u_int64_t], ,
912 [AC_DEFINE([u_int64_t], [unsigned long long],
913 [Define to `unsigned long long' if u_int64_t not defined.])],
915 #ifdef HAVE_SYS_BITYPES_H
916 #include <sys/bitypes.h>
920 # We can't just check for <inttypes.h> - some systems have one that
921 # doesn't define all the PRI[doxu]64 macros.
923 AC_CHECK_HEADERS(inttypes.h,
926 # OK, we have inttypes.h, but does it define those macros?
928 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
933 #include <inttypes.h>
935 #include <sys/types.h>
936 #ifdef HAVE_SYS_BITYPES_H
937 #include <sys/bitypes.h>
942 printf("%" PRId64 "\n", (u_int64_t)1);
943 printf("%" PRIo64 "\n", (u_int64_t)1);
944 printf("%" PRIx64 "\n", (u_int64_t)1);
945 printf("%" PRIu64 "\n", (u_int64_t)1);
951 ac_lbl_inttypes_h_defines_formats=yes
955 ac_lbl_inttypes_h_defines_formats=no
960 # We don't have inttypes.h, so it obviously can't define those
963 ac_lbl_inttypes_h_defines_formats=no
965 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
966 AC_LBL_CHECK_64BIT_FORMAT(l,
968 AC_LBL_CHECK_64BIT_FORMAT(ll,
970 AC_LBL_CHECK_64BIT_FORMAT(L,
972 AC_LBL_CHECK_64BIT_FORMAT(q,
974 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
983 AC_LBL_DEVEL(V_CCOPT)
985 AC_LBL_SOCKADDR_SA_LEN
987 AC_LBL_UNALIGNED_ACCESS
992 AC_MSG_CHECKING(whether to use SSLeay libcrypto)
993 # Specify location for both includes and libraries.
994 want_libcrypto=youmama
996 AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
997 [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]),
999 if test $withval = no
1003 elif test $withval = yes
1014 # Use libcrypto if it's present, otherwise don't.
1016 want_libcrypto=ifavailable
1017 AC_MSG_RESULT([yes, if available])
1019 if test "$want_libcrypto" != "no"; then
1020 ac_cv_ssleay_path=no
1022 if test "x$crypto_dir" = x; then
1024 # Location not specified; check the default locations.
1026 AC_MSG_CHECKING(where SSLeay is located)
1027 dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1028 if test "x${host_alias}" != x; then
1029 dirs="/usr/${host_alias} $dirs"
1031 for dir in $dirs; do
1034 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1037 ac_cv_ssleay_path=no
1041 if test "$ac_cv_ssleay_path" != no; then
1042 AC_MSG_RESULT($ac_cv_ssleay_path)
1045 AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1046 AC_LBL_SSLEAY($crypto_dir)
1047 if test "$ac_cv_ssleay_path" != no; then
1048 AC_MSG_RESULT(found)
1051 if test "$ac_cv_ssleay_path" != no; then
1052 V_INCLS="$V_INCLS $incdir"
1053 if test "$dir" != "/usr"; then
1054 LDFLAGS="-L$dir/lib $LDFLAGS"
1056 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1057 LIBS="$LIBS -lRSAglue"
1059 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1060 LIBS="$LIBS -lrsaref"
1062 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1064 CPPFLAGS="$CPPFLAGS $V_INCLS"
1065 AC_CHECK_HEADERS(openssl/evp.h)
1068 # Not found. Did the user explicitly ask for it?
1070 AC_MSG_RESULT(not found)
1071 if test "$want_libcrypto" = yes; then
1072 AC_MSG_ERROR(SSLeay not found)
1078 dnl set additional include path if necessary
1079 if test "$missing_includes" = "yes"; then
1080 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
1081 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
1090 AC_SUBST(MAN_FILE_FORMATS)
1091 AC_SUBST(MAN_MISC_INFO)
1095 AC_CONFIG_HEADER(config.h)
1097 AC_OUTPUT_COMMANDS([if test -f .devel; then
1098 echo timestamp > stamp-h
1099 cat Makefile-devel-adds >> Makefile
1102 AC_OUTPUT(Makefile tcpdump.1)