1 dnl @(#) Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.7 2005/09/21 16:50:01 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.
9 AC_REVISION(Revision: 1.188.2.7)
15 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
18 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
19 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
20 #include <sys/socket.h>])
21 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
23 # The simple test didn't work.
24 # Do we need to include <net/if.h> first?
25 # Unset ac_cv_header_netinet_if_ether_h so we don't
26 # treat the previous failure as a cached value and
27 # suppress the next test.
29 AC_MSG_NOTICE([Rechecking with some additional includes])
30 unset ac_cv_header_netinet_if_ether_h
31 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
32 #include <sys/socket.h>
33 #include <netinet/in.h>
44 AC_MSG_CHECKING(Linux kernel version)
45 if test "$cross_compiling" = yes; then
46 AC_CACHE_VAL(ac_cv_linux_vers,
47 ac_cv_linux_vers=unknown)
49 AC_CACHE_VAL(ac_cv_linux_vers,
50 ac_cv_linux_vers=`uname -r 2>&1 | \
51 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
53 AC_MSG_RESULT($ac_cv_linux_vers)
54 if test $ac_cv_linux_vers = unknown ; then
55 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
57 if test $ac_cv_linux_vers -lt 2 ; then
58 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
67 AC_CHECK_HEADERS(smi.h)
68 AC_CHECK_LIB(smi, smiInit)
69 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
71 AC_MSG_CHECKING([whether to enable libsmi])
72 AC_TRY_RUN([ /* libsmi available check */
76 int current, revision, age, n;
77 const int required = 2;
80 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
82 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
85 if (required < current - age || required > current)
93 dnl autoconf documentation says that $? contains the exit value.
94 dnl reality is that it does not. We leave this in just in case
95 dnl autoconf ever comes back to match the documentation.
97 1) AC_MSG_RESULT(no - smiInit failed) ;;
98 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
99 3) AC_MSG_RESULT(no - can't determine library version) ;;
100 4) AC_MSG_RESULT(no - too old) ;;
101 *) AC_MSG_RESULT(no) ;;
104 [ AC_MSG_RESULT(not when cross-compiling)
109 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
111 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
112 --disable-smb disable possibly-buggy SMB printer],,
115 yes) AC_MSG_RESULT(yes)
116 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
117 AC_DEFINE(TCPDUMP_DO_SMB)
118 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
124 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
125 AC_MSG_CHECKING([whether to drop root privileges by default])
126 if test ! -z "$with_user" ; then
127 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
128 AC_MSG_RESULT(to \"$withval\")
133 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
134 AC_MSG_CHECKING([whether to chroot])
135 if test ! -z "$with_chroot" ; then
136 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
137 AC_MSG_RESULT(to \"$withval\")
142 AC_MSG_CHECKING([whether to enable ipv6])
144 [ --enable-ipv6 enable ipv6 (with ipv4) support
145 --disable-ipv6 disable ipv6 support],
146 [ case "$enableval" in
147 yes) AC_MSG_RESULT(yes)
148 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"
158 AC_TRY_RUN([ /* AF_INET6 available check */
159 #include <sys/types.h>
160 #include <sys/socket.h>
163 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
170 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 if test "$ipv6" = "yes"; then
184 AC_MSG_CHECKING([ipv6 stack type])
185 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
188 dnl http://www.kame.net/
190 [#include <netinet/in.h>
191 #ifdef IPV6_INRIA_VERSION
195 CFLAGS="-DINET6 $CFLAGS"])
198 dnl http://www.kame.net/
200 [#include <netinet/in.h>
206 ipv6libdir=/usr/local/v6/lib;
208 CFLAGS="-DINET6 $CFLAGS"])
211 dnl http://www.v6.linux.or.jp/
213 [#include <features.h>
214 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
218 CFLAGS="-DINET6 $CFLAGS"])
221 dnl http://www.v6.linux.or.jp/
223 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
224 dnl and possibly other versions of those OSes
226 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
229 ipv6libdir=/usr/inet6/lib
231 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
236 [#include <sys/param.h>
237 #ifdef _TOSHIBA_INET6
242 ipv6libdir=/usr/local/v6/lib;
243 CFLAGS="-DINET6 $CFLAGS"])
247 [#include </usr/local/v6/include/sys/v6config.h>
253 ipv6libdir=/usr/local/v6/lib;
254 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
258 [#include <sys/param.h>
259 #ifdef _ZETA_MINAMI_INET6
264 ipv6libdir=/usr/local/v6/lib;
265 CFLAGS="-DINET6 $CFLAGS"])
268 if test "$ipv6type" != "unknown"; then
272 AC_MSG_RESULT($ipv6type)
275 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
276 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
277 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
278 echo "You have $ipv6lib library, using it"
280 if test "$ipv6trylibc" = "yes"; then
281 echo "You do not have $ipv6lib library, using libc"
283 echo 'Fatal: no $ipv6lib library found. cannot continue.'
284 echo "You need to fetch lib$ipv6lib.a from appropriate"
285 echo 'ipv6 kit and compile beforehand.'
292 if test "$ipv6" = "yes"; then
294 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
295 # function in libc; there are "ngetaddrinfo()" and
296 # "ogetaddrinfo()" functions, and <netdb.h> #defines
297 # "getaddrinfo" to be either "ngetaddrinfo" or
298 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
299 # or _XOPEN_SOURCE_EXTENDED are defined or not.
301 # So this test doesn't work on Tru64 5.1, and possibly
302 # on other 5.x releases. This causes the configure
303 # script to become confused, and results in libpcap
306 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
307 AC_MSG_CHECKING(getaddrinfo bug)
308 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
309 #include <sys/types.h>
312 #include <sys/socket.h>
313 #include <netinet/in.h>
317 int passive, gaierr, inet4 = 0, inet6 = 0;
318 struct addrinfo hints, *ai, *aitop;
319 char straddr[INET6_ADDRSTRLEN], strport[16];
321 for (passive = 0; passive <= 1; passive++) {
322 memset(&hints, 0, sizeof(hints));
323 hints.ai_family = AF_UNSPEC;
324 hints.ai_flags = passive ? AI_PASSIVE : 0;
325 hints.ai_socktype = SOCK_STREAM;
326 hints.ai_protocol = IPPROTO_TCP;
327 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
328 (void)gai_strerror(gaierr);
331 for (ai = aitop; ai; ai = ai->ai_next) {
332 if (ai->ai_addr == NULL ||
333 ai->ai_addrlen == 0 ||
334 getnameinfo(ai->ai_addr, ai->ai_addrlen,
335 straddr, sizeof(straddr), strport, sizeof(strport),
336 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
339 switch (ai->ai_family) {
341 if (strcmp(strport, "54321") != 0) {
345 if (strcmp(straddr, "0.0.0.0") != 0) {
349 if (strcmp(straddr, "127.0.0.1") != 0) {
356 if (strcmp(strport, "54321") != 0) {
360 if (strcmp(straddr, "::") != 0) {
364 if (strcmp(straddr, "::1") != 0) {
381 /* another family support? */
387 /* supported family should be 2, unsupported family should be 0 */
388 if (!(inet4 == 0 || inet4 == 2))
390 if (!(inet6 == 0 || inet6 == 2))
403 td_cv_buggygetaddrinfo=no,
404 td_cv_buggygetaddrinfo=yes,
405 td_cv_buggygetaddrinfo=yes)])
406 if test "$td_cv_buggygetaddrinfo" = no; then
412 if test "$td_cv_buggygetaddrinfo" = "yes"; then
414 # XXX - it doesn't appear that "ipv6type" can ever be
415 # set to "linux". Should this be testing for
416 # "linux-glibc", or for that *or* "linux-libinet6"?
417 # If the latter, note that "linux-libinet6" is also
418 # the type given to some non-Linux OSes.
420 if test "$ipv6type" != "linux"; then
421 echo 'Fatal: You must get working getaddrinfo() function.'
422 echo ' or you can specify "--disable-ipv6"'.
425 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
426 echo ' Better upgrade your system library to newest version'
427 echo ' of GNU C library (aka glibc).'
431 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
434 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
435 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
436 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
437 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
438 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
439 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
440 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
444 dnl check sizeof basic types.
445 dnl They're very likely to be wrong for cross-compiling.
446 AC_CHECK_SIZEOF(char, 1)
447 AC_CHECK_SIZEOF(short, 2)
448 AC_CHECK_SIZEOF(int, 4)
449 AC_CHECK_SIZEOF(long, 4)
450 AC_CHECK_SIZEOF(long long, 8)
453 dnl Checks for u_intXX_t
454 dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
455 dnl if test "$ac_cv_bittypes" = no; then
456 dnl missing_includes=yes
460 dnl Checks for addrinfo structure
461 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
462 if test "$ac_cv_addrinfo" = no; then
467 dnl Checks for NI_MAXSERV
468 AC_NI_MAXSERV(ac_cv_maxserv)
469 if test "$ac_cv_maxserv" = no; then
474 dnl Checks for NI_NAMEREQD
475 AC_NI_NAMEREQD(ac_cv_namereqd)
476 if test "$ac_cv_namereqd" = no; then
481 dnl Checks for sockaddr_storage structure
482 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
483 if test "$ac_cv_sa_storage" = no; then
488 dnl Checks for IN[6]ADDRSZ
489 AC_CHECK_ADDRSZ(ac_cv_addrsz)
490 if test "$ac_cv_addrsz" = no; then
495 dnl Checks for RES_USE_INET6
496 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
497 if test "$ac_cv_res_inet6" = no; then
502 dnl Checks for res_state_ext structure
503 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
504 if test "$ac_cv_res_state_ext" = no; then
509 dnl Checks if res_state structure has nsort member.
510 AC_STRUCT_RES_STATE(ac_cv_res_state)
513 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
514 AC_CHECK_FUNCS(strftime)
515 AC_CHECK_FUNCS(setlinebuf alarm)
518 AC_CHECK_FUNCS(vsnprintf snprintf,,
520 if test $needsnprintf = yes; then
526 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
528 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
530 dnl Some platforms may need -lnsl for getrpcbynumber.
531 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
533 dnl AC_CHECK_LIB(z, uncompress)
534 dnl AC_CHECK_HEADERS(zlib.h)
536 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
539 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
540 # libraries (e.g., "-lsocket -lnsl" on Solaris).
542 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
543 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
544 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
545 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
546 # it does not ship with a libc symbol "inet_ntop()", it ships with
547 # "_inet_ntop()", and has a #define macro in one of the system headers
550 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
551 AC_MSG_CHECKING(for inet_ntop)
552 AC_TRY_LINK([#include <sys/types.h>
553 #include <sys/socket.h>
554 #include <netinet/in.h>
555 #include <arpa/inet.h>], [char src[4], dst[128];
556 inet_ntop(AF_INET, src, dst, sizeof(dst));],
557 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
558 AC_LIBOBJ(inet_ntop)])
559 AC_MSG_CHECKING(for inet_pton)
560 AC_TRY_LINK([#include <sys/types.h>
561 #include <sys/socket.h>
562 #include <netinet/in.h>
563 #include <arpa/inet.h>], [char src[128], dst[4];
564 inet_pton(AF_INET, src, dst);],
565 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
566 AC_LIBOBJ(inet_pton)])
567 AC_MSG_CHECKING(for inet_aton)
568 AC_TRY_LINK([#include <sys/types.h>
569 #include <netinet/in.h>
570 #include <arpa/inet.h>], [char src[128];
572 inet_aton(src, &dst);],
573 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
574 AC_LIBOBJ(inet_aton)])
577 # Check for these after AC_LBL_LIBPCAP, for the same reason.
579 # You are in a twisty little maze of UN*Xes, all different.
580 # Some might not have ether_ntohost().
581 # Some might have it, but not declare it in any header file.
582 # Some might have it, but declare it in <netinet/if_ether.h>.
583 # Some might have it, but declare it in <netinet/ether.h>
584 # (And some might have it but document it as something declared in
585 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
587 # Before you is a C compiler.
589 AC_CHECK_FUNCS(ether_ntohost, [
590 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
593 #include <sys/types.h>
594 #include <sys/param.h>
595 #include <sys/socket.h>
598 main(int argc, char **argv)
600 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
601 char name[MAXHOSTNAMELEN];
603 ether_ntohost(name, (struct ether_addr *)ea);
606 ], [ac_cv_buggy_ether_ntohost=no],
607 [ac_cv_buggy_ether_ntohost=yes],
608 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
609 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
610 AC_DEFINE(USE_ETHER_NTOHOST)
613 if test "$ac_cv_func_ether_ntohost" = yes -a \
614 "$ac_cv_buggy_ether_ntohost" = "no"; then
616 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
618 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
620 # Yes. Does it declare ether_ntohost()?
622 AC_CHECK_DECL(ether_ntohost,
624 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
625 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
628 #include <sys/types.h>
629 #include <sys/socket.h>
630 #include <netinet/in.h>
631 #include <arpa/inet.h>
635 #include <netinet/if_ether.h>
641 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
643 # No, how about <netinet/ether.h>, as on Linux?
645 AC_CHECK_HEADERS(netinet/ether.h)
646 if test "$ac_cv_header_netinet_ether_h" = yes; then
648 # We have it - does it declare ether_ntohost()?
649 # Unset ac_cv_have_decl_ether_ntohost so we don't
650 # treat the previous failure as a cached value and
651 # suppress the next test.
653 unset ac_cv_have_decl_ether_ntohost
654 AC_CHECK_DECL(ether_ntohost,
656 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
657 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
660 #include <netinet/ether.h>
665 # Is ether_ntohost() declared?
667 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
669 # No, we'll have to declare it ourselves.
670 # Do we have "struct ether_addr"?
672 AC_CHECK_TYPES(struct ether_addr,,,
674 #include <sys/types.h>
675 #include <sys/socket.h>
676 #include <netinet/in.h>
677 #include <arpa/inet.h>
681 #include <netinet/if_ether.h>
683 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
684 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
687 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
688 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
693 dnl portability macros for getaddrinfo/getnameinfo
696 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
697 if test "$ac_cv_sockaddr_has_sa_len" = no; then
701 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
702 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
703 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
704 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
706 savedcflags="$CFLAGS"
707 CFLAGS="$CFLAGS $V_INCLS"
708 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
709 CFLAGS="$savedcflags"
712 if test $ac_cv_func_pcap_lib_version = "no" ; then
713 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
716 extern char pcap_version[];
718 return (int)pcap_version;
720 ac_lbl_cv_pcap_version_defined=yes,
721 ac_lbl_cv_pcap_version_defined=no)
722 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
724 AC_DEFINE(HAVE_PCAP_VERSION)
729 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
732 extern int pcap_debug;
736 ac_lbl_cv_pcap_debug_defined=yes,
737 ac_lbl_cv_pcap_debug_defined=no)
738 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
740 AC_DEFINE(HAVE_PCAP_DEBUG)
744 # OK, what about "yydebug"?
746 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
753 ac_lbl_cv_yydebug_defined=yes,
754 ac_lbl_cv_yydebug_defined=no)
755 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
757 AC_DEFINE(HAVE_YYDEBUG)
762 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
765 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
771 dnl Workaround to enable certain features
788 if test -f /dev/bpf -o -f /dev/bpf0; then
792 AC_CHECK_HEADERS(sys/bitypes.h)
794 AC_CHECK_TYPE([int8_t], ,
795 [AC_DEFINE([int8_t], [signed char],
796 [Define to `signed char' if int8_t not defined.])])
797 AC_CHECK_TYPE([u_int8_t], ,
798 [AC_DEFINE([u_int8_t], [unsigned char],
799 [Define to `unsigned char' if u_int8_t not defined.])],
801 #ifdef HAVE_SYS_BITYPES_H
802 #include <sys/bitypes.h>
804 AC_CHECK_TYPE([int16_t], ,
805 [AC_DEFINE([int16_t], [short],
806 [Define to `short' if int16_t not defined.])])
807 AC_CHECK_TYPE([u_int16_t], ,
808 [AC_DEFINE([u_int16_t], [unsigned short],
809 [Define to `unsigned short' if u_int16_t not defined.])],
811 #ifdef HAVE_SYS_BITYPES_H
812 #include <sys/bitypes.h>
814 AC_CHECK_TYPE([int32_t], ,
815 [AC_DEFINE([int32_t], [int],
816 [Define to `int' if int32_t not defined.])])
817 AC_CHECK_TYPE([u_int32_t], ,
818 [AC_DEFINE([u_int32_t], [unsigned int],
819 [Define to `unsigned int' if u_int32_t not defined.])],
821 #ifdef HAVE_SYS_BITYPES_H
822 #include <sys/bitypes.h>
824 AC_CHECK_TYPE([int64_t], ,
825 [AC_DEFINE([int64_t], [long long],
826 [Define to `long long' if int64_t not defined.])])
827 AC_CHECK_TYPE([u_int64_t], ,
828 [AC_DEFINE([u_int64_t], [unsigned long long],
829 [Define to `unsigned long long' if u_int64_t not defined.])],
831 #ifdef HAVE_SYS_BITYPES_H
832 #include <sys/bitypes.h>
836 # We can't just check for <inttypes.h> - some systems have one that
837 # doesn't define all the PRI[doxu]64 macros.
839 AC_CHECK_HEADERS(inttypes.h,
842 # OK, we have inttypes.h, but does it define those macros?
844 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
849 #include <inttypes.h>
851 #include <sys/types.h>
852 #ifdef HAVE_SYS_BITYPES_H
853 #include <sys/bitypes.h>
858 printf("%" PRId64 "\n", (u_int64_t)1);
859 printf("%" PRIo64 "\n", (u_int64_t)1);
860 printf("%" PRIx64 "\n", (u_int64_t)1);
861 printf("%" PRIu64 "\n", (u_int64_t)1);
867 ac_lbl_inttypes_h_defines_formats=yes
871 ac_lbl_inttypes_h_defines_formats=no
876 # We don't have inttypes.h, so it obviously can't define those
879 ac_lbl_inttypes_h_defines_formats=no
881 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
882 AC_LBL_CHECK_64BIT_FORMAT(l,
884 AC_LBL_CHECK_64BIT_FORMAT(ll,
886 AC_LBL_CHECK_64BIT_FORMAT(L,
888 AC_LBL_CHECK_64BIT_FORMAT(q,
890 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
897 AC_LBL_DEVEL(V_CCOPT)
899 AC_LBL_SOCKADDR_SA_LEN
901 AC_LBL_UNALIGNED_ACCESS
905 AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
907 AC_MSG_CHECKING(for SSLeay)
912 # If Xprefix is set in the environment, use that value.
913 # XXX - this should arguably be done by having --with-crypto take an
914 # optional argument, and have that argument be used to set Xprefix
917 if test -z "$Xprefix"; then
918 Xprefix=`eval echo $prefix`
921 for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
923 # XXX - is there a better way to check if a given library is
924 # in a given directory than checking each of the possible
925 # shared library suffixes?
927 # Are there any other suffixes we need to look for? Do we have to
928 # worry about ".so.{version}"?
930 # Or should we just look for "libcrypto.*"?
932 if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \
933 -f $dir/lib/libcrypto.so -o \
934 -f $dir/lib/libcrypto.sl -o \
935 -f $dir/lib/libcrypto.dylib \); then
936 ac_cv_ssleay_path=$dir
938 if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
939 incdir="-I$dir/include"
941 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
948 AC_MSG_RESULT($ac_cv_ssleay_path)
949 if test "$ac_cv_ssleay_path" != no; then
950 V_INCLS="$V_INCLS $incdir"
951 LDFLAGS="-L$dir/lib $LDFLAGS"
952 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
953 LIBS="$LIBS -lRSAglue"
955 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
956 LIBS="$LIBS -lrsaref"
958 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
960 CPPFLAGS="$CPPFLAGS $V_INCLS"
961 AC_CHECK_HEADERS(openssl/evp.h)
966 dnl set additional include path if necessary
967 if test "$missing_includes" = "yes"; then
968 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
969 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
981 AC_CONFIG_HEADER(config.h)
983 AC_OUTPUT_COMMANDS([if test -f .devel; then
984 echo timestamp > stamp-h
985 cat Makefile-devel-adds >> Makefile