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_MSG_CHECKING(Linux kernel version)
65 if test "$cross_compiling" = yes; then
66 AC_CACHE_VAL(ac_cv_linux_vers,
67 ac_cv_linux_vers=unknown)
69 AC_CACHE_VAL(ac_cv_linux_vers,
70 ac_cv_linux_vers=`uname -r 2>&1 | \
71 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
73 AC_MSG_RESULT($ac_cv_linux_vers)
74 if test $ac_cv_linux_vers = unknown ; then
75 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
77 if test $ac_cv_linux_vers -lt 2 ; then
78 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
88 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
89 --without-smi don't link with libsmi],,
92 if test "x$with_smi" != "xno" ; then
93 AC_CHECK_HEADERS(smi.h)
94 AC_CHECK_LIB(smi, smiInit)
95 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
97 AC_MSG_CHECKING([whether to enable libsmi])
98 AC_TRY_RUN([ /* libsmi available check */
102 int current, revision, age, n;
103 const int required = 2;
106 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
108 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
111 if (required < current - age || required > current)
119 dnl autoconf documentation says that $? contains the exit value.
120 dnl reality is that it does not. We leave this in just in case
121 dnl autoconf ever comes back to match the documentation.
123 1) AC_MSG_RESULT(no - smiInit failed) ;;
124 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
125 3) AC_MSG_RESULT(no - can't determine library version) ;;
126 4) AC_MSG_RESULT(no - too old) ;;
127 *) AC_MSG_RESULT(no) ;;
130 [ AC_MSG_RESULT(not when cross-compiling)
136 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
138 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
139 --disable-smb disable possibly-buggy SMB printer],,
142 yes) AC_MSG_RESULT(yes)
143 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
144 AC_DEFINE(TCPDUMP_DO_SMB)
145 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
151 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
152 AC_MSG_CHECKING([whether to drop root privileges by default])
153 if test ! -z "$with_user" ; then
154 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
155 AC_MSG_RESULT(to \"$withval\")
160 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
161 AC_MSG_CHECKING([whether to chroot])
162 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
163 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
164 AC_MSG_RESULT(to \"$withval\")
169 AC_MSG_CHECKING([whether to enable ipv6])
171 [ --enable-ipv6 enable ipv6 (with ipv4) support
172 --disable-ipv6 disable ipv6 support],
173 [ case "$enableval" in
174 yes) AC_MSG_RESULT(yes)
175 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"
185 AC_TRY_RUN([ /* AF_INET6 available check */
186 #include <sys/types.h>
187 #include <sys/socket.h>
190 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
197 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"
210 if test "$ipv6" = "yes"; then
211 AC_MSG_CHECKING([ipv6 stack type])
212 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
215 dnl http://www.kame.net/
217 [#include <netinet/in.h>
218 #ifdef IPV6_INRIA_VERSION
222 CFLAGS="-DINET6 $CFLAGS"])
225 dnl http://www.kame.net/
227 [#include <netinet/in.h>
233 ipv6libdir=/usr/local/v6/lib;
235 CFLAGS="-DINET6 $CFLAGS"])
238 dnl http://www.v6.linux.or.jp/
240 [#include <features.h>
241 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
245 CFLAGS="-DINET6 $CFLAGS"])
248 dnl http://www.v6.linux.or.jp/
250 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
251 dnl and possibly other versions of those OSes
253 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
256 ipv6libdir=/usr/inet6/lib
258 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
263 [#include <sys/param.h>
264 #ifdef _TOSHIBA_INET6
269 ipv6libdir=/usr/local/v6/lib;
270 CFLAGS="-DINET6 $CFLAGS"])
274 [#include </usr/local/v6/include/sys/v6config.h>
280 ipv6libdir=/usr/local/v6/lib;
281 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
285 [#include <sys/param.h>
286 #ifdef _ZETA_MINAMI_INET6
291 ipv6libdir=/usr/local/v6/lib;
292 CFLAGS="-DINET6 $CFLAGS"])
295 if test "$ipv6type" != "unknown"; then
299 AC_MSG_RESULT($ipv6type)
302 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
303 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
304 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
305 echo "You have $ipv6lib library, using it"
307 if test "$ipv6trylibc" = "yes"; then
308 echo "You do not have $ipv6lib library, using libc"
310 echo 'Fatal: no $ipv6lib library found. cannot continue.'
311 echo "You need to fetch lib$ipv6lib.a from appropriate"
312 echo 'ipv6 kit and compile beforehand.'
319 if test "$ipv6" = "yes"; then
321 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
322 # function in libc; there are "ngetaddrinfo()" and
323 # "ogetaddrinfo()" functions, and <netdb.h> #defines
324 # "getaddrinfo" to be either "ngetaddrinfo" or
325 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
326 # or _XOPEN_SOURCE_EXTENDED are defined or not.
328 # So this test doesn't work on Tru64 5.1, and possibly
329 # on other 5.x releases. This causes the configure
330 # script to become confused, and results in libpcap
333 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
334 AC_MSG_CHECKING(getaddrinfo bug)
335 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
336 #include <sys/types.h>
339 #include <sys/socket.h>
340 #include <netinet/in.h>
344 int passive, gaierr, inet4 = 0, inet6 = 0;
345 struct addrinfo hints, *ai, *aitop;
346 char straddr[INET6_ADDRSTRLEN], strport[16];
348 for (passive = 0; passive <= 1; passive++) {
349 memset(&hints, 0, sizeof(hints));
350 hints.ai_family = AF_UNSPEC;
351 hints.ai_flags = passive ? AI_PASSIVE : 0;
352 hints.ai_socktype = SOCK_STREAM;
353 hints.ai_protocol = IPPROTO_TCP;
354 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
355 (void)gai_strerror(gaierr);
358 for (ai = aitop; ai; ai = ai->ai_next) {
359 if (ai->ai_addr == NULL ||
360 ai->ai_addrlen == 0 ||
361 getnameinfo(ai->ai_addr, ai->ai_addrlen,
362 straddr, sizeof(straddr), strport, sizeof(strport),
363 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
366 switch (ai->ai_family) {
368 if (strcmp(strport, "54321") != 0) {
372 if (strcmp(straddr, "0.0.0.0") != 0) {
376 if (strcmp(straddr, "127.0.0.1") != 0) {
383 if (strcmp(strport, "54321") != 0) {
387 if (strcmp(straddr, "::") != 0) {
391 if (strcmp(straddr, "::1") != 0) {
408 /* another family support? */
414 /* supported family should be 2, unsupported family should be 0 */
415 if (!(inet4 == 0 || inet4 == 2))
417 if (!(inet6 == 0 || inet6 == 2))
430 td_cv_buggygetaddrinfo=no,
431 td_cv_buggygetaddrinfo=yes,
432 td_cv_buggygetaddrinfo=yes)])
433 if test "$td_cv_buggygetaddrinfo" = no; then
439 if test "$td_cv_buggygetaddrinfo" = "yes"; then
441 # XXX - it doesn't appear that "ipv6type" can ever be
442 # set to "linux". Should this be testing for
443 # "linux-glibc", or for that *or* "linux-libinet6"?
444 # If the latter, note that "linux-libinet6" is also
445 # the type given to some non-Linux OSes.
447 if test "$ipv6type" != "linux"; then
448 echo 'Fatal: You must get working getaddrinfo() function.'
449 echo ' or you can specify "--disable-ipv6"'.
452 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
453 echo ' Better upgrade your system library to newest version'
454 echo ' of GNU C library (aka glibc).'
458 AC_REPLACE_FUNCS(getnameinfo)
461 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
462 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
463 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
464 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
465 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
466 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
467 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
471 dnl check sizeof basic types.
472 dnl They're very likely to be wrong for cross-compiling.
473 AC_CHECK_SIZEOF(char, 1)
474 AC_CHECK_SIZEOF(short, 2)
475 AC_CHECK_SIZEOF(int, 4)
476 AC_CHECK_SIZEOF(long, 4)
477 AC_CHECK_SIZEOF(long long, 8)
480 dnl Checks for addrinfo structure
481 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
482 if test "$ac_cv_addrinfo" = no; then
487 dnl Checks for NI_MAXSERV
488 AC_NI_MAXSERV(ac_cv_maxserv)
489 if test "$ac_cv_maxserv" = no; then
494 dnl Checks for NI_NAMEREQD
495 AC_NI_NAMEREQD(ac_cv_namereqd)
496 if test "$ac_cv_namereqd" = no; then
501 dnl Checks for sockaddr_storage structure
502 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
503 if test "$ac_cv_sa_storage" = no; then
508 dnl Checks for IN[6]ADDRSZ
509 AC_CHECK_ADDRSZ(ac_cv_addrsz)
510 if test "$ac_cv_addrsz" = no; then
515 dnl Checks for RES_USE_INET6
516 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
517 if test "$ac_cv_res_inet6" = no; then
522 dnl Checks for res_state_ext structure
523 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
524 if test "$ac_cv_res_state_ext" = no; then
529 dnl Checks if res_state structure has nsort member.
530 AC_STRUCT_RES_STATE(ac_cv_res_state)
533 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
534 AC_CHECK_FUNCS(strftime)
535 AC_CHECK_FUNCS(setlinebuf alarm)
538 AC_CHECK_FUNCS(vsnprintf snprintf,,
540 if test $needsnprintf = yes; then
546 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
548 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
550 dnl Some platforms may need -lnsl for getrpcbynumber.
551 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
553 dnl AC_CHECK_LIB(z, uncompress)
554 dnl AC_CHECK_HEADERS(zlib.h)
556 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
559 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
560 # libraries (e.g., "-lsocket -lnsl" on Solaris).
562 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
563 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
564 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
565 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
566 # it does not ship with a libc symbol "inet_ntop()", it ships with
567 # "_inet_ntop()", and has a #define macro in one of the system headers
570 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
571 AC_MSG_CHECKING(for inet_ntop)
572 AC_TRY_LINK([#include <sys/types.h>
573 #include <sys/socket.h>
574 #include <netinet/in.h>
575 #include <arpa/inet.h>], [char src[4], dst[128];
576 inet_ntop(AF_INET, src, dst, sizeof(dst));],
577 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
578 AC_LIBOBJ(inet_ntop)])
579 AC_MSG_CHECKING(for inet_pton)
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[128], dst[4];
584 inet_pton(AF_INET, src, dst);],
585 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
586 AC_LIBOBJ(inet_pton)])
587 AC_MSG_CHECKING(for inet_aton)
588 AC_TRY_LINK([#include <sys/types.h>
589 #include <netinet/in.h>
590 #include <arpa/inet.h>], [char src[128];
592 inet_aton(src, &dst);],
593 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
594 AC_LIBOBJ(inet_aton)])
597 # Check for these after AC_LBL_LIBPCAP, for the same reason.
599 # You are in a twisty little maze of UN*Xes, all different.
600 # Some might not have ether_ntohost().
601 # Some might have it, but not declare it in any header file.
602 # Some might have it, but declare it in <netinet/if_ether.h>.
603 # Some might have it, but declare it in <netinet/ether.h>
604 # (And some might have it but document it as something declared in
605 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
607 # Before you is a C compiler.
609 AC_CHECK_FUNCS(ether_ntohost, [
610 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
613 #include <sys/types.h>
614 #include <sys/param.h>
615 #include <sys/socket.h>
618 main(int argc, char **argv)
620 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
621 char name[MAXHOSTNAMELEN];
623 ether_ntohost(name, (struct ether_addr *)ea);
626 ], [ac_cv_buggy_ether_ntohost=no],
627 [ac_cv_buggy_ether_ntohost=yes],
628 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
629 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
630 AC_DEFINE(USE_ETHER_NTOHOST)
633 if test "$ac_cv_func_ether_ntohost" = yes -a \
634 "$ac_cv_buggy_ether_ntohost" = "no"; then
636 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
638 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
640 # Yes. Does it declare ether_ntohost()?
642 AC_CHECK_DECL(ether_ntohost,
644 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
645 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
648 #include <sys/types.h>
649 #include <sys/socket.h>
650 #include <netinet/in.h>
651 #include <arpa/inet.h>
655 #include <netinet/if_ether.h>
661 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
663 # No, how about <netinet/ether.h>, as on Linux?
665 AC_CHECK_HEADERS(netinet/ether.h)
666 if test "$ac_cv_header_netinet_ether_h" = yes; then
668 # We have it - does it declare ether_ntohost()?
669 # Unset ac_cv_have_decl_ether_ntohost so we don't
670 # treat the previous failure as a cached value and
671 # suppress the next test.
673 unset ac_cv_have_decl_ether_ntohost
674 AC_CHECK_DECL(ether_ntohost,
676 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
677 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
680 #include <netinet/ether.h>
685 # Is ether_ntohost() declared?
687 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
689 # No, we'll have to declare it ourselves.
690 # Do we have "struct ether_addr"?
692 AC_CHECK_TYPES(struct ether_addr,,,
694 #include <sys/types.h>
695 #include <sys/socket.h>
696 #include <netinet/in.h>
697 #include <arpa/inet.h>
701 #include <netinet/if_ether.h>
703 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
704 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
707 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
708 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
713 # libdlpi is needed for Solaris 11 and later.
714 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
716 dnl portability macros for getaddrinfo/getnameinfo
719 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
720 if test "$ac_cv_sockaddr_has_sa_len" = no; then
725 # Do we have the new open API? Check for pcap_create, and assume that,
726 # if we do, we also have pcap_activate() and the other new routines
727 # introduced in libpcap 1.0.0.
729 AC_CHECK_FUNCS(pcap_create)
730 if test $ac_cv_func_pcap_create = "yes" ; then
732 # OK, do we have pcap_set_tstamp_type? If so, assume we have
733 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
735 AC_CHECK_FUNCS(pcap_set_tstamp_type)
738 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
739 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
740 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
741 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
743 savedppflags="$CPPLAGS"
744 CPPFLAGS="$CPPFLAGS $V_INCLS"
745 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
746 CPPFLAGS="$savedcppflags"
749 if test $ac_cv_func_pcap_lib_version = "no" ; then
750 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
753 extern char pcap_version[];
755 return (int)pcap_version;
757 ac_lbl_cv_pcap_version_defined=yes,
758 ac_lbl_cv_pcap_version_defined=no)
759 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
761 AC_DEFINE(HAVE_PCAP_VERSION)
766 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
769 extern int pcap_debug;
773 ac_lbl_cv_pcap_debug_defined=yes,
774 ac_lbl_cv_pcap_debug_defined=no)
775 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
777 AC_DEFINE(HAVE_PCAP_DEBUG)
781 # OK, what about "yydebug"?
783 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
790 ac_lbl_cv_yydebug_defined=yes,
791 ac_lbl_cv_yydebug_defined=no)
792 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
794 AC_DEFINE(HAVE_YYDEBUG)
799 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
802 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
806 # Assume V7/BSD convention for man pages (file formats in section 5,
807 # miscellaneous info in section 7).
814 dnl Workaround to enable certain features
815 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
820 # Use System V conventions for man pages.
830 # Use System V conventions for man pages.
840 # Use System V conventions for man pages.
850 # Use System V conventions for man pages.
857 if test -f /dev/bpf0 ; then
862 # Check for some headers introduced in later versions of libpcap
863 # and used by some printers.
865 savedcppflags="$CPPFLAGS"
866 CPPFLAGS="$CPPFLAGS $V_INCLS"
867 AC_CHECK_HEADERS(pcap/bluetooth.h)
868 AC_CHECK_HEADERS(pcap/usb.h)
869 CPPFLAGS="$savedcppflags"
871 AC_CHECK_HEADERS(sys/bitypes.h)
873 AC_CHECK_TYPE([int8_t], ,
874 [AC_DEFINE([int8_t], [signed char],
875 [Define to `signed char' if int8_t not defined.])],
877 #ifdef HAVE_SYS_BITYPES_H
878 #include <sys/bitypes.h>
880 AC_CHECK_TYPE([u_int8_t], ,
881 [AC_DEFINE([u_int8_t], [unsigned char],
882 [Define to `unsigned char' if u_int8_t not defined.])],
884 #ifdef HAVE_SYS_BITYPES_H
885 #include <sys/bitypes.h>
887 AC_CHECK_TYPE([int16_t], ,
888 [AC_DEFINE([int16_t], [short],
889 [Define to `short' if int16_t not defined.])]
891 #ifdef HAVE_SYS_BITYPES_H
892 #include <sys/bitypes.h>
894 AC_CHECK_TYPE([u_int16_t], ,
895 [AC_DEFINE([u_int16_t], [unsigned short],
896 [Define to `unsigned short' if u_int16_t not defined.])],
898 #ifdef HAVE_SYS_BITYPES_H
899 #include <sys/bitypes.h>
901 AC_CHECK_TYPE([int32_t], ,
902 [AC_DEFINE([int32_t], [int],
903 [Define to `int' if int32_t not defined.])],
905 #ifdef HAVE_SYS_BITYPES_H
906 #include <sys/bitypes.h>
908 AC_CHECK_TYPE([u_int32_t], ,
909 [AC_DEFINE([u_int32_t], [unsigned int],
910 [Define to `unsigned int' if u_int32_t not defined.])],
912 #ifdef HAVE_SYS_BITYPES_H
913 #include <sys/bitypes.h>
915 AC_CHECK_TYPE([int64_t], ,
916 [AC_DEFINE([int64_t], [long long],
917 [Define to `long long' if int64_t not defined.])],
919 #ifdef HAVE_SYS_BITYPES_H
920 #include <sys/bitypes.h>
922 AC_CHECK_TYPE([u_int64_t], ,
923 [AC_DEFINE([u_int64_t], [unsigned long long],
924 [Define to `unsigned long long' if u_int64_t not defined.])],
926 #ifdef HAVE_SYS_BITYPES_H
927 #include <sys/bitypes.h>
931 # We can't just check for <inttypes.h> - some systems have one that
932 # doesn't define all the PRI[doxu]64 macros.
934 AC_CHECK_HEADERS(inttypes.h,
937 # OK, we have inttypes.h, but does it define those macros?
939 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
944 #include <inttypes.h>
946 #include <sys/types.h>
947 #ifdef HAVE_SYS_BITYPES_H
948 #include <sys/bitypes.h>
953 printf("%" PRId64 "\n", (u_int64_t)1);
954 printf("%" PRIo64 "\n", (u_int64_t)1);
955 printf("%" PRIx64 "\n", (u_int64_t)1);
956 printf("%" PRIu64 "\n", (u_int64_t)1);
962 ac_lbl_inttypes_h_defines_formats=yes
966 ac_lbl_inttypes_h_defines_formats=no
971 # We don't have inttypes.h, so it obviously can't define those
974 ac_lbl_inttypes_h_defines_formats=no
976 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
977 AC_LBL_CHECK_64BIT_FORMAT(l,
979 AC_LBL_CHECK_64BIT_FORMAT(ll,
981 AC_LBL_CHECK_64BIT_FORMAT(L,
983 AC_LBL_CHECK_64BIT_FORMAT(q,
985 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
994 AC_LBL_DEVEL(V_CCOPT)
996 AC_LBL_SOCKADDR_SA_LEN
998 AC_LBL_UNALIGNED_ACCESS
1003 AC_MSG_CHECKING(whether to use SSLeay libcrypto)
1004 # Specify location for both includes and libraries.
1005 want_libcrypto=youmama
1007 AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
1008 [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]),
1010 if test $withval = no
1014 elif test $withval = yes
1025 # Use libcrypto if it's present, otherwise don't.
1027 want_libcrypto=ifavailable
1028 AC_MSG_RESULT([yes, if available])
1030 if test "$want_libcrypto" != "no"; then
1031 ac_cv_ssleay_path=no
1033 if test "x$crypto_dir" = x; then
1035 # Location not specified; check the default locations.
1037 AC_MSG_CHECKING(where SSLeay is located)
1038 dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1039 if test "x${host_alias}" != x; then
1040 dirs="/usr/${host_alias} $dirs"
1042 for dir in $dirs; do
1045 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1048 ac_cv_ssleay_path=no
1052 if test "$ac_cv_ssleay_path" != no; then
1053 AC_MSG_RESULT($ac_cv_ssleay_path)
1056 AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1057 AC_LBL_SSLEAY($crypto_dir)
1058 if test "$ac_cv_ssleay_path" != no; then
1059 AC_MSG_RESULT(found)
1062 if test "$ac_cv_ssleay_path" != no; then
1063 V_INCLS="$V_INCLS $incdir"
1064 if test "$dir" != "/usr"; then
1065 LDFLAGS="-L$dir/lib $LDFLAGS"
1067 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1068 LIBS="$LIBS -lRSAglue"
1070 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1071 LIBS="$LIBS -lrsaref"
1073 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1075 CPPFLAGS="$CPPFLAGS $V_INCLS"
1076 AC_CHECK_HEADERS(openssl/evp.h)
1079 # Not found. Did the user explicitly ask for it?
1081 AC_MSG_RESULT(not found)
1082 if test "$want_libcrypto" = yes; then
1083 AC_MSG_ERROR(SSLeay not found)
1089 dnl set additional include path if necessary
1090 if test "$missing_includes" = "yes"; then
1091 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
1092 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
1101 AC_SUBST(MAN_FILE_FORMATS)
1102 AC_SUBST(MAN_MISC_INFO)
1106 AC_CONFIG_HEADER(config.h)
1108 AC_OUTPUT_COMMANDS([if test -f .devel; then
1109 echo timestamp > stamp-h
1110 cat Makefile-devel-adds >> Makefile
1113 AC_OUTPUT(Makefile tcpdump.1)