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.
9 AC_REVISION($Revision: 1.204 $)
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(net/pfvar.h, , , [#include <sys/types.h>
20 #include <sys/socket.h>
22 if test "$ac_cv_header_net_pfvar_h" = yes; then
23 LOCALSRC="print-pflog.c $LOCALSRC"
25 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
26 #include <sys/socket.h>])
27 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
29 # The simple test didn't work.
30 # Do we need to include <net/if.h> first?
31 # Unset ac_cv_header_netinet_if_ether_h so we don't
32 # treat the previous failure as a cached value and
33 # suppress the next test.
35 AC_MSG_NOTICE([Rechecking with some additional includes])
36 unset ac_cv_header_netinet_if_ether_h
37 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
38 #include <sys/socket.h>
39 #include <netinet/in.h>
50 AC_MSG_CHECKING(Linux kernel version)
51 if test "$cross_compiling" = yes; then
52 AC_CACHE_VAL(ac_cv_linux_vers,
53 ac_cv_linux_vers=unknown)
55 AC_CACHE_VAL(ac_cv_linux_vers,
56 ac_cv_linux_vers=`uname -r 2>&1 | \
57 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
59 AC_MSG_RESULT($ac_cv_linux_vers)
60 if test $ac_cv_linux_vers = unknown ; then
61 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
63 if test $ac_cv_linux_vers -lt 2 ; then
64 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
74 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
75 --without-smi don't link with libsmi],,
78 if test "x$with_smi" != "xno" ; then
79 AC_CHECK_HEADERS(smi.h)
80 AC_CHECK_LIB(smi, smiInit)
81 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
83 AC_MSG_CHECKING([whether to enable libsmi])
84 AC_TRY_RUN([ /* libsmi available check */
88 int current, revision, age, n;
89 const int required = 2;
92 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
94 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
97 if (required < current - age || required > current)
105 dnl autoconf documentation says that $? contains the exit value.
106 dnl reality is that it does not. We leave this in just in case
107 dnl autoconf ever comes back to match the documentation.
109 1) AC_MSG_RESULT(no - smiInit failed) ;;
110 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
111 3) AC_MSG_RESULT(no - can't determine library version) ;;
112 4) AC_MSG_RESULT(no - too old) ;;
113 *) AC_MSG_RESULT(no) ;;
116 [ AC_MSG_RESULT(not when cross-compiling)
122 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
124 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
125 --disable-smb disable possibly-buggy SMB printer],,
128 yes) AC_MSG_RESULT(yes)
129 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
130 AC_DEFINE(TCPDUMP_DO_SMB)
131 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
137 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
138 AC_MSG_CHECKING([whether to drop root privileges by default])
139 if test ! -z "$with_user" ; then
140 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
141 AC_MSG_RESULT(to \"$withval\")
146 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
147 AC_MSG_CHECKING([whether to chroot])
148 if test ! -z "$with_chroot" ; then
149 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
150 AC_MSG_RESULT(to \"$withval\")
155 AC_MSG_CHECKING([whether to enable ipv6])
157 [ --enable-ipv6 enable ipv6 (with ipv4) support
158 --disable-ipv6 disable ipv6 support],
159 [ case "$enableval" in
160 yes) AC_MSG_RESULT(yes)
161 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"
171 AC_TRY_RUN([ /* AF_INET6 available check */
172 #include <sys/types.h>
173 #include <sys/socket.h>
176 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
183 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"
196 if test "$ipv6" = "yes"; then
197 AC_MSG_CHECKING([ipv6 stack type])
198 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
201 dnl http://www.kame.net/
203 [#include <netinet/in.h>
204 #ifdef IPV6_INRIA_VERSION
208 CFLAGS="-DINET6 $CFLAGS"])
211 dnl http://www.kame.net/
213 [#include <netinet/in.h>
219 ipv6libdir=/usr/local/v6/lib;
221 CFLAGS="-DINET6 $CFLAGS"])
224 dnl http://www.v6.linux.or.jp/
226 [#include <features.h>
227 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
231 CFLAGS="-DINET6 $CFLAGS"])
234 dnl http://www.v6.linux.or.jp/
236 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
237 dnl and possibly other versions of those OSes
239 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
242 ipv6libdir=/usr/inet6/lib
244 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
249 [#include <sys/param.h>
250 #ifdef _TOSHIBA_INET6
255 ipv6libdir=/usr/local/v6/lib;
256 CFLAGS="-DINET6 $CFLAGS"])
260 [#include </usr/local/v6/include/sys/v6config.h>
266 ipv6libdir=/usr/local/v6/lib;
267 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
271 [#include <sys/param.h>
272 #ifdef _ZETA_MINAMI_INET6
277 ipv6libdir=/usr/local/v6/lib;
278 CFLAGS="-DINET6 $CFLAGS"])
281 if test "$ipv6type" != "unknown"; then
285 AC_MSG_RESULT($ipv6type)
288 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
289 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
290 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
291 echo "You have $ipv6lib library, using it"
293 if test "$ipv6trylibc" = "yes"; then
294 echo "You do not have $ipv6lib library, using libc"
296 echo 'Fatal: no $ipv6lib library found. cannot continue.'
297 echo "You need to fetch lib$ipv6lib.a from appropriate"
298 echo 'ipv6 kit and compile beforehand.'
305 if test "$ipv6" = "yes"; then
307 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
308 # function in libc; there are "ngetaddrinfo()" and
309 # "ogetaddrinfo()" functions, and <netdb.h> #defines
310 # "getaddrinfo" to be either "ngetaddrinfo" or
311 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
312 # or _XOPEN_SOURCE_EXTENDED are defined or not.
314 # So this test doesn't work on Tru64 5.1, and possibly
315 # on other 5.x releases. This causes the configure
316 # script to become confused, and results in libpcap
319 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
320 AC_MSG_CHECKING(getaddrinfo bug)
321 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
322 #include <sys/types.h>
325 #include <sys/socket.h>
326 #include <netinet/in.h>
330 int passive, gaierr, inet4 = 0, inet6 = 0;
331 struct addrinfo hints, *ai, *aitop;
332 char straddr[INET6_ADDRSTRLEN], strport[16];
334 for (passive = 0; passive <= 1; passive++) {
335 memset(&hints, 0, sizeof(hints));
336 hints.ai_family = AF_UNSPEC;
337 hints.ai_flags = passive ? AI_PASSIVE : 0;
338 hints.ai_socktype = SOCK_STREAM;
339 hints.ai_protocol = IPPROTO_TCP;
340 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
341 (void)gai_strerror(gaierr);
344 for (ai = aitop; ai; ai = ai->ai_next) {
345 if (ai->ai_addr == NULL ||
346 ai->ai_addrlen == 0 ||
347 getnameinfo(ai->ai_addr, ai->ai_addrlen,
348 straddr, sizeof(straddr), strport, sizeof(strport),
349 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
352 switch (ai->ai_family) {
354 if (strcmp(strport, "54321") != 0) {
358 if (strcmp(straddr, "0.0.0.0") != 0) {
362 if (strcmp(straddr, "127.0.0.1") != 0) {
369 if (strcmp(strport, "54321") != 0) {
373 if (strcmp(straddr, "::") != 0) {
377 if (strcmp(straddr, "::1") != 0) {
394 /* another family support? */
400 /* supported family should be 2, unsupported family should be 0 */
401 if (!(inet4 == 0 || inet4 == 2))
403 if (!(inet6 == 0 || inet6 == 2))
416 td_cv_buggygetaddrinfo=no,
417 td_cv_buggygetaddrinfo=yes,
418 td_cv_buggygetaddrinfo=yes)])
419 if test "$td_cv_buggygetaddrinfo" = no; then
425 if test "$td_cv_buggygetaddrinfo" = "yes"; then
427 # XXX - it doesn't appear that "ipv6type" can ever be
428 # set to "linux". Should this be testing for
429 # "linux-glibc", or for that *or* "linux-libinet6"?
430 # If the latter, note that "linux-libinet6" is also
431 # the type given to some non-Linux OSes.
433 if test "$ipv6type" != "linux"; then
434 echo 'Fatal: You must get working getaddrinfo() function.'
435 echo ' or you can specify "--disable-ipv6"'.
438 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
439 echo ' Better upgrade your system library to newest version'
440 echo ' of GNU C library (aka glibc).'
444 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
447 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
448 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
449 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
450 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
451 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
452 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
453 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
457 dnl check sizeof basic types.
458 dnl They're very likely to be wrong for cross-compiling.
459 AC_CHECK_SIZEOF(char, 1)
460 AC_CHECK_SIZEOF(short, 2)
461 AC_CHECK_SIZEOF(int, 4)
462 AC_CHECK_SIZEOF(long, 4)
463 AC_CHECK_SIZEOF(long long, 8)
466 dnl Checks for u_intXX_t
467 dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
468 dnl if test "$ac_cv_bittypes" = no; then
469 dnl missing_includes=yes
473 dnl Checks for addrinfo structure
474 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
475 if test "$ac_cv_addrinfo" = no; then
480 dnl Checks for NI_MAXSERV
481 AC_NI_MAXSERV(ac_cv_maxserv)
482 if test "$ac_cv_maxserv" = no; then
487 dnl Checks for NI_NAMEREQD
488 AC_NI_NAMEREQD(ac_cv_namereqd)
489 if test "$ac_cv_namereqd" = no; then
494 dnl Checks for sockaddr_storage structure
495 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
496 if test "$ac_cv_sa_storage" = no; then
501 dnl Checks for IN[6]ADDRSZ
502 AC_CHECK_ADDRSZ(ac_cv_addrsz)
503 if test "$ac_cv_addrsz" = no; then
508 dnl Checks for RES_USE_INET6
509 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
510 if test "$ac_cv_res_inet6" = no; then
515 dnl Checks for res_state_ext structure
516 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
517 if test "$ac_cv_res_state_ext" = no; then
522 dnl Checks if res_state structure has nsort member.
523 AC_STRUCT_RES_STATE(ac_cv_res_state)
526 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
527 AC_CHECK_FUNCS(strftime)
528 AC_CHECK_FUNCS(setlinebuf alarm)
531 AC_CHECK_FUNCS(vsnprintf snprintf,,
533 if test $needsnprintf = yes; then
539 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
541 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
543 dnl Some platforms may need -lnsl for getrpcbynumber.
544 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
546 dnl AC_CHECK_LIB(z, uncompress)
547 dnl AC_CHECK_HEADERS(zlib.h)
549 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
552 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
553 # libraries (e.g., "-lsocket -lnsl" on Solaris).
555 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
556 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
557 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
558 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
559 # it does not ship with a libc symbol "inet_ntop()", it ships with
560 # "_inet_ntop()", and has a #define macro in one of the system headers
563 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
564 AC_MSG_CHECKING(for inet_ntop)
565 AC_TRY_LINK([#include <sys/types.h>
566 #include <sys/socket.h>
567 #include <netinet/in.h>
568 #include <arpa/inet.h>], [char src[4], dst[128];
569 inet_ntop(AF_INET, src, dst, sizeof(dst));],
570 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
571 AC_LIBOBJ(inet_ntop)])
572 AC_MSG_CHECKING(for inet_pton)
573 AC_TRY_LINK([#include <sys/types.h>
574 #include <sys/socket.h>
575 #include <netinet/in.h>
576 #include <arpa/inet.h>], [char src[128], dst[4];
577 inet_pton(AF_INET, src, dst);],
578 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
579 AC_LIBOBJ(inet_pton)])
580 AC_MSG_CHECKING(for inet_aton)
581 AC_TRY_LINK([#include <sys/types.h>
582 #include <netinet/in.h>
583 #include <arpa/inet.h>], [char src[128];
585 inet_aton(src, &dst);],
586 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
587 AC_LIBOBJ(inet_aton)])
590 # Check for these after AC_LBL_LIBPCAP, for the same reason.
592 # You are in a twisty little maze of UN*Xes, all different.
593 # Some might not have ether_ntohost().
594 # Some might have it, but not declare it in any header file.
595 # Some might have it, but declare it in <netinet/if_ether.h>.
596 # Some might have it, but declare it in <netinet/ether.h>
597 # (And some might have it but document it as something declared in
598 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
600 # Before you is a C compiler.
602 AC_CHECK_FUNCS(ether_ntohost, [
603 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
606 #include <sys/types.h>
607 #include <sys/param.h>
608 #include <sys/socket.h>
611 main(int argc, char **argv)
613 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
614 char name[MAXHOSTNAMELEN];
616 ether_ntohost(name, (struct ether_addr *)ea);
619 ], [ac_cv_buggy_ether_ntohost=no],
620 [ac_cv_buggy_ether_ntohost=yes],
621 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
622 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
623 AC_DEFINE(USE_ETHER_NTOHOST)
626 if test "$ac_cv_func_ether_ntohost" = yes -a \
627 "$ac_cv_buggy_ether_ntohost" = "no"; then
629 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
631 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
633 # Yes. Does it declare ether_ntohost()?
635 AC_CHECK_DECL(ether_ntohost,
637 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
638 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
641 #include <sys/types.h>
642 #include <sys/socket.h>
643 #include <netinet/in.h>
644 #include <arpa/inet.h>
648 #include <netinet/if_ether.h>
654 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
656 # No, how about <netinet/ether.h>, as on Linux?
658 AC_CHECK_HEADERS(netinet/ether.h)
659 if test "$ac_cv_header_netinet_ether_h" = yes; then
661 # We have it - does it declare ether_ntohost()?
662 # Unset ac_cv_have_decl_ether_ntohost so we don't
663 # treat the previous failure as a cached value and
664 # suppress the next test.
666 unset ac_cv_have_decl_ether_ntohost
667 AC_CHECK_DECL(ether_ntohost,
669 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
670 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
673 #include <netinet/ether.h>
678 # Is ether_ntohost() declared?
680 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
682 # No, we'll have to declare it ourselves.
683 # Do we have "struct ether_addr"?
685 AC_CHECK_TYPES(struct ether_addr,,,
687 #include <sys/types.h>
688 #include <sys/socket.h>
689 #include <netinet/in.h>
690 #include <arpa/inet.h>
694 #include <netinet/if_ether.h>
696 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
697 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
700 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
701 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
706 # libdlpi is needed for Solaris 11 and later.
707 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
709 dnl portability macros for getaddrinfo/getnameinfo
712 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
713 if test "$ac_cv_sockaddr_has_sa_len" = no; then
718 # Do we have the new open API? Check for pcap_create, and assume that,
719 # if we do, we also have pcap_activate() and the other new routines.
720 AC_CHECK_FUNCS(pcap_create)
722 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
723 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
724 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
725 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
727 savedppflags="$CPPLAGS"
728 CPPFLAGS="$CPPFLAGS $V_INCLS"
729 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
730 CPPFLAGS="$savedcppflags"
733 if test $ac_cv_func_pcap_lib_version = "no" ; then
734 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
737 extern char pcap_version[];
739 return (int)pcap_version;
741 ac_lbl_cv_pcap_version_defined=yes,
742 ac_lbl_cv_pcap_version_defined=no)
743 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
745 AC_DEFINE(HAVE_PCAP_VERSION)
750 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
753 extern int pcap_debug;
757 ac_lbl_cv_pcap_debug_defined=yes,
758 ac_lbl_cv_pcap_debug_defined=no)
759 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
761 AC_DEFINE(HAVE_PCAP_DEBUG)
765 # OK, what about "yydebug"?
767 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
774 ac_lbl_cv_yydebug_defined=yes,
775 ac_lbl_cv_yydebug_defined=no)
776 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
778 AC_DEFINE(HAVE_YYDEBUG)
783 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
786 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
790 # Assume V7/BSD convention for man pages (file formats in section 5,
791 # miscellaneous info in section 7).
798 dnl Workaround to enable certain features
804 # Use System V conventions for man pages.
814 # Use System V conventions for man pages.
824 # Use System V conventions for man pages.
834 # Use System V conventions for man pages.
841 if test -f /dev/bpf0 ; then
846 # Check for some headers introduced in later versions of libpcap
847 # and used by some printers.
849 savedcppflags="$CPPFLAGS"
850 CPPFLAGS="$CPPFLAGS $V_INCLS"
851 AC_CHECK_HEADERS(pcap/bluetooth.h)
852 AC_CHECK_HEADERS(pcap/usb.h)
853 CPPFLAGS="$savedcppflags"
855 AC_CHECK_HEADERS(sys/bitypes.h)
857 AC_CHECK_TYPE([int8_t], ,
858 [AC_DEFINE([int8_t], [signed char],
859 [Define to `signed char' if int8_t not defined.])])
860 AC_CHECK_TYPE([u_int8_t], ,
861 [AC_DEFINE([u_int8_t], [unsigned char],
862 [Define to `unsigned char' if u_int8_t not defined.])],
864 #ifdef HAVE_SYS_BITYPES_H
865 #include <sys/bitypes.h>
867 AC_CHECK_TYPE([int16_t], ,
868 [AC_DEFINE([int16_t], [short],
869 [Define to `short' if int16_t not defined.])])
870 AC_CHECK_TYPE([u_int16_t], ,
871 [AC_DEFINE([u_int16_t], [unsigned short],
872 [Define to `unsigned short' if u_int16_t not defined.])],
874 #ifdef HAVE_SYS_BITYPES_H
875 #include <sys/bitypes.h>
877 AC_CHECK_TYPE([int32_t], ,
878 [AC_DEFINE([int32_t], [int],
879 [Define to `int' if int32_t not defined.])])
880 AC_CHECK_TYPE([u_int32_t], ,
881 [AC_DEFINE([u_int32_t], [unsigned int],
882 [Define to `unsigned int' if u_int32_t not defined.])],
884 #ifdef HAVE_SYS_BITYPES_H
885 #include <sys/bitypes.h>
887 AC_CHECK_TYPE([int64_t], ,
888 [AC_DEFINE([int64_t], [long long],
889 [Define to `long long' if int64_t not defined.])])
890 AC_CHECK_TYPE([u_int64_t], ,
891 [AC_DEFINE([u_int64_t], [unsigned long long],
892 [Define to `unsigned long long' if u_int64_t not defined.])],
894 #ifdef HAVE_SYS_BITYPES_H
895 #include <sys/bitypes.h>
899 # We can't just check for <inttypes.h> - some systems have one that
900 # doesn't define all the PRI[doxu]64 macros.
902 AC_CHECK_HEADERS(inttypes.h,
905 # OK, we have inttypes.h, but does it define those macros?
907 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
912 #include <inttypes.h>
914 #include <sys/types.h>
915 #ifdef HAVE_SYS_BITYPES_H
916 #include <sys/bitypes.h>
921 printf("%" PRId64 "\n", (u_int64_t)1);
922 printf("%" PRIo64 "\n", (u_int64_t)1);
923 printf("%" PRIx64 "\n", (u_int64_t)1);
924 printf("%" PRIu64 "\n", (u_int64_t)1);
930 ac_lbl_inttypes_h_defines_formats=yes
934 ac_lbl_inttypes_h_defines_formats=no
939 # We don't have inttypes.h, so it obviously can't define those
942 ac_lbl_inttypes_h_defines_formats=no
944 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
945 AC_LBL_CHECK_64BIT_FORMAT(l,
947 AC_LBL_CHECK_64BIT_FORMAT(ll,
949 AC_LBL_CHECK_64BIT_FORMAT(L,
951 AC_LBL_CHECK_64BIT_FORMAT(q,
953 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
962 AC_LBL_DEVEL(V_CCOPT)
964 AC_LBL_SOCKADDR_SA_LEN
966 AC_LBL_UNALIGNED_ACCESS
971 AC_MSG_CHECKING(whether to use SSLeay libcrypto)
972 # Specify location for both includes and libraries.
973 want_libcrypto=youmama
975 AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
976 [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]),
978 if test $withval = no
982 elif test $withval = yes
993 # Use libcrypto if it's present, otherwise don't.
995 want_libcrypto=ifavailable
996 AC_MSG_RESULT([yes, if available])
998 if test "$want_libcrypto" != "no"; then
1001 if test "x$crypto_dir" = x; then
1003 # Location not specified; check the default locations.
1005 AC_MSG_CHECKING(where SSLeay is located)
1006 dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1007 if test "x${host_alias}" != x; then
1008 dirs="/usr/${host_alias} $dirs"
1010 for dir in $dirs; do
1013 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1016 ac_cv_ssleay_path=no
1020 if test "$ac_cv_ssleay_path" != no; then
1021 AC_MSG_RESULT($ac_cv_ssleay_path)
1024 AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1025 AC_LBL_SSLEAY($crypto_dir)
1026 if test "$ac_cv_ssleay_path" != no; then
1027 AC_MSG_RESULT(found)
1030 if test "$ac_cv_ssleay_path" != no; then
1031 V_INCLS="$V_INCLS $incdir"
1032 LDFLAGS="-L$dir/lib $LDFLAGS"
1033 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1034 LIBS="$LIBS -lRSAglue"
1036 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1037 LIBS="$LIBS -lrsaref"
1039 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1041 CPPFLAGS="$CPPFLAGS $V_INCLS"
1042 AC_CHECK_HEADERS(openssl/evp.h)
1045 # Not found. Did the user explicitly ask for it?
1047 AC_MSG_RESULT(not found)
1048 if test "$want_libcrypto" = yes; then
1049 AC_MSG_ERROR(SSLeay not found)
1055 dnl set additional include path if necessary
1056 if test "$missing_includes" = "yes"; then
1057 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
1058 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
1067 AC_SUBST(MAN_FILE_FORMATS)
1068 AC_SUBST(MAN_MISC_INFO)
1072 AC_CONFIG_HEADER(config.h)
1074 AC_OUTPUT_COMMANDS([if test -f .devel; then
1075 echo timestamp > stamp-h
1076 cat Makefile-devel-adds >> Makefile
1079 AC_OUTPUT(Makefile tcpdump.1)