From 281e9d71408deb6e8c5046c746c2e97002b0e7fe Mon Sep 17 00:00:00 2001 From: bms Date: Wed, 31 Mar 2004 09:17:26 +0000 Subject: Import tcpdump 3.8.3, from http://www.tcpdump.org/releases/tcpdump-3.8.3.tar.gz --- contrib/tcpdump/configure.in | 304 +++++++++++++++++++++++++++++-------------- 1 file changed, 203 insertions(+), 101 deletions(-) (limited to 'contrib/tcpdump/configure.in') diff --git a/contrib/tcpdump/configure.in b/contrib/tcpdump/configure.in index 810608d..3479473 100755 --- a/contrib/tcpdump/configure.in +++ b/contrib/tcpdump/configure.in @@ -1,4 +1,4 @@ -dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.145.2.1 2002/06/28 10:48:31 guy Exp $ (LBL) +dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.169.2.3 2004/03/28 21:04:48 fenner Exp $ (LBL) dnl dnl Copyright (c) 1994, 1995, 1996, 1997 dnl The Regents of the University of California. All rights reserved. @@ -6,8 +6,8 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl -AC_REVISION($Revision: 1.145.2.1 $) -AC_PREREQ(2.13) +AC_REVISION($Revision: 1.169.2.3 $) +AC_PREREQ(2.50) AC_INIT(tcpdump.c) AC_CANONICAL_HOST @@ -16,7 +16,9 @@ AC_LBL_C_INIT(V_CCOPT, V_INCLS) AC_LBL_C_INLINE AC_C___ATTRIBUTE__ -AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netinet/if_ether.h) +AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h netinet/ether.h) +AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include +#include ]) AC_HEADER_TIME case "$host_os" in @@ -102,14 +104,13 @@ yes) AC_MSG_RESULT(yes) ;; esac -CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len" AC_MSG_CHECKING([whether to enable ipv6]) AC_ARG_ENABLE(ipv6, [ --enable-ipv6 enable ipv6 (with ipv4) support --disable-ipv6 disable ipv6 support], [ case "$enableval" in yes) AC_MSG_RESULT(yes) - LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC" + 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" AC_DEFINE(INET6) ipv6=yes ;; @@ -131,7 +132,7 @@ main() } ], [ AC_MSG_RESULT(yes) - LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC" + 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" AC_DEFINE(INET6) ipv6=yes], [ AC_MSG_RESULT(no) @@ -150,8 +151,8 @@ if test "$ipv6" = "yes"; then case $i in inria) dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #ifdef IPV6_INRIA_VERSION yes #endif], @@ -160,8 +161,8 @@ yes ;; kame) dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #ifdef __KAME__ yes #endif], @@ -173,8 +174,8 @@ yes ;; linux-glibc) dnl http://www.v6.linux.or.jp/ - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 yes #endif], @@ -183,6 +184,10 @@ yes ;; linux-libinet6) dnl http://www.v6.linux.or.jp/ + dnl + dnl This also matches Solaris 8 and Tru64 UNIX 5.1, + dnl and possibly other versions of those OSes + dnl if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then ipv6type=$i ipv6lib=inet6 @@ -192,8 +197,8 @@ yes fi ;; toshiba) - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #ifdef _TOSHIBA_INET6 yes #endif], @@ -203,8 +208,8 @@ yes CFLAGS="-DINET6 $CFLAGS"]) ;; v6d) - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #ifdef __V6D__ yes #endif], @@ -214,8 +219,8 @@ yes CFLAGS="-I/usr/local/v6/include $CFLAGS"]) ;; zeta) - AC_EGREP_CPP(yes, [dnl -#include + AC_EGREP_CPP(yes, +[#include #ifdef _ZETA_MINAMI_INET6 yes #endif], @@ -250,9 +255,22 @@ fi if test "$ipv6" = "yes"; then + # + # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()" + # function in libc; there are "ngetaddrinfo()" and + # "ogetaddrinfo()" functions, and #defines + # "getaddrinfo" to be either "ngetaddrinfo" or + # "ogetaddrinfo", depending on whether _SOCKADDR_LEN + # or _XOPEN_SOURCE_EXTENDED are defined or not. + # + # So this test doesn't work on Tru64 5.1, and possibly + # on other 5.x releases. This causes the configure + # script to become confused, and results in libpcap + # being unbuildable. + # AC_SEARCH_LIBS(getaddrinfo, socket, [dnl AC_MSG_CHECKING(getaddrinfo bug) - AC_TRY_RUN([ + AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([ #include #include #include @@ -270,6 +288,7 @@ main() hints.ai_family = AF_UNSPEC; hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); goto bad; @@ -346,58 +365,44 @@ main() exit(1); } ], - AC_MSG_RESULT(good) - buggygetaddrinfo=no, - AC_MSG_RESULT(buggy) - buggygetaddrinfo=yes, - AC_MSG_RESULT(buggy) - buggygetaddrinfo=yes)], [buggygetaddrinfo=yes]) - - if test "$buggygetaddrinfo" = "yes"; then + td_cv_buggygetaddrinfo=no, + td_cv_buggygetaddrinfo=yes, + td_cv_buggygetaddrinfo=yes)]) + if test "$td_cv_buggygetaddrinfo" = no; then + AC_MSG_RESULT(good) + else + AC_MSG_RESULT(buggy) + fi + + if test "$td_cv_buggygetaddrinfo" = "yes"; then + # + # XXX - it doesn't appear that "ipv6type" can ever be + # set to "linux". Should this be testing for + # "linux-glibc", or for that *or* "linux-libinet6"? + # If the latter, note that "linux-libinet6" is also + # the type given to some non-Linux OSes. + # if test "$ipv6type" != "linux"; then echo 'Fatal: You must get working getaddrinfo() function.' echo ' or you can specify "--disable-ipv6"'. exit 1 else echo 'Warning: getaddrinfo() implementation on your system seems be buggy.' - echo ' Better upgreade your system library to newest version' + echo ' Better upgrade your system library to newest version' echo ' of GNU C library (aka glibc).' fi fi + ]) AC_REPLACE_FUNCS(getaddrinfo getnameinfo) fi -dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton) -AC_MSG_CHECKING(for inet_ntop) -AC_TRY_COMPILE([#include -#include -#include -#include ], [char src[4], dst[128]; -inet_ntop(AF_INET, src, dst, sizeof(dst));], - [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) - AC_REPLACE_FUNCS(inet_ntop)]) -AC_MSG_CHECKING(for inet_pton) -AC_TRY_COMPILE([#include -#include -#include -#include ], [char src[128], dst[4]; -inet_pton(AF_INET, src, dst);], - [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) - AC_REPLACE_FUNCS(inet_pton)]) -AC_MSG_CHECKING(for inet_aton) -AC_TRY_COMPILE([#include -#include -#include ], [char src[128]; -struct in_addr dst; -inet_aton(src, &dst);], - [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) - AC_REPLACE_FUNCS(inet_aton)]) -dnl portability macros for getaddrinfo/getnameinfo -dnl -dnl Check for sa_len -AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) -if test "$ac_cv_sockaddr_has_sa_len" = no; then - missing_includes=yes +AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h], +[td_cv_decl_netdnet_dnetdb_h_dnet_htoa], +[AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h, + td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes, + td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)]) +if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then + AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA) fi dnl @@ -476,7 +481,8 @@ if test "$missing_includes" = "yes"; then fi -AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup) +AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep) +AC_CHECK_FUNCS(strftime) AC_CHECK_FUNCS(ether_ntohost, [ AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [ AC_TRY_RUN([ @@ -496,7 +502,7 @@ AC_CHECK_FUNCS(ether_ntohost, [ } ], [ac_cv_buggy_ether_ntohost=no], [ac_cv_buggy_ether_ntohost=yes], - [ac_cv_buggy_ether_ntohost=not while cross-compiling])]) + [ac_cv_buggy_ether_ntohost="not while cross-compiling"])]) if test "$ac_cv_buggy_ether_ntohost" = "no"; then AC_DEFINE(USE_ETHER_NTOHOST) fi @@ -507,12 +513,12 @@ needsnprintf=no AC_CHECK_FUNCS(vsnprintf snprintf,, [needsnprintf=yes]) if test $needsnprintf = yes; then - LIBOBJS="$LIBOBJS snprintf.o" + AC_LIBOBJ(snprintf.o) fi AC_LBL_TYPE_SIGNAL -AC_CHECK_LIB(dnet, dnet_htoa) +AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA)) AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc @@ -524,6 +530,121 @@ dnl AC_CHECK_HEADERS(zlib.h) AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) +# +# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate +# libraries (e.g., "-lsocket -lnsl" on Solaris). +# +# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which +# use AC_CHECK_FUNC which doesn't let us specify the right #includes +# to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8 +# resolver, and the way it defines inet_{ntop,pton} is rather strange; +# it does not ship with a libc symbol "inet_ntop()", it ships with +# "_inet_ntop()", and has a #define macro in one of the system headers +# to rename it. +# +dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton) +AC_MSG_CHECKING(for inet_ntop) +AC_TRY_LINK([#include +#include +#include +#include ], [char src[4], dst[128]; +inet_ntop(AF_INET, src, dst, sizeof(dst));], + [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) + AC_LIBOBJ(inet_ntop.o)]) +AC_MSG_CHECKING(for inet_pton) +AC_TRY_LINK([#include +#include +#include +#include ], [char src[128], dst[4]; +inet_pton(AF_INET, src, dst);], + [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) + AC_LIBOBJ(inet_pton.o)]) +AC_MSG_CHECKING(for inet_aton) +AC_TRY_LINK([#include +#include +#include ], [char src[128]; +struct in_addr dst; +inet_aton(src, &dst);], + [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) + AC_LIBOBJ(inet_aton.o)]) + +dnl portability macros for getaddrinfo/getnameinfo +dnl +dnl Check for sa_len +AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) +if test "$ac_cv_sockaddr_has_sa_len" = no; then + missing_includes=yes +fi + +AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version) +if test $ac_cv_func_pcap_findalldevs = "yes" ; then +dnl Check for MacOS X, which may ship pcap.h from 0.6 but libpcap may +dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't +dnl have pcap_if_t. + AC_CHECK_TYPES(pcap_if_t, , , [#include ]) +fi +if test $ac_cv_func_pcap_lib_version = "no" ; then + AC_MSG_CHECKING(whether pcap_version is defined by libpcap) + AC_TRY_LINK([], + [ +char * +return_pcap_version(void) +{ + extern char pcap_version[]; + + return pcap_version; +} + ], + ac_lbl_cv_pcap_version_defined=yes, + ac_lbl_cv_pcap_version_defined=no) + if test "$ac_lbl_cv_pcap_version_defined" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PCAP_VERSION) + else + AC_MSG_RESULT(no) + fi +fi +AC_MSG_CHECKING(whether pcap_debug is defined by libpcap) +AC_TRY_LINK([], + [ +int +return_pcap_debug(void) +{ + extern int pcap_debug; + + return pcap_debug; +} + ], + ac_lbl_cv_pcap_debug_defined=yes, + ac_lbl_cv_pcap_debug_defined=no) +if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PCAP_DEBUG) +else + AC_MSG_RESULT(no) + # + # OK, what about "yydebug"? + # + AC_MSG_CHECKING(whether yydebug is defined by libpcap) + AC_TRY_LINK([], + [ + int + return_yydebug(void) + { + extern int yydebug; + + return yydebug; + } + ], + ac_lbl_cv_yydebug_defined=yes, + ac_lbl_cv_yydebug_defined=no) + if test "$ac_lbl_cv_yydebug_defined" = yes ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_YYDEBUG) + else + AC_MSG_RESULT(no) + fi +fi AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6 V_GROUP=0 @@ -554,6 +675,7 @@ if test -f /dev/bpf0 ; then V_GROUP=bpf fi +AC_LBL_CHECK_TYPE(int8_t, signed char) AC_LBL_CHECK_TYPE(u_int8_t, u_char) AC_LBL_CHECK_TYPE(int16_t, short) AC_LBL_CHECK_TYPE(u_int16_t, u_short) @@ -573,8 +695,21 @@ AC_ARG_WITH(crypto, [ --without-crypto disable crypto support], AC_MSG_CHECKING(for SSLeay) ac_cv_ssleay_path=no incdir=no -for dir in /usr /usr/local /usr/local/ssl /usr/pkg; do - if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then +for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do + # + # XXX - is there a better way to check if a given library is + # in a given directory than checking each of the possible + # shared library suffixes? + # + # Are there any other suffixes we need to look for? Do we have to + # worry about ".so.{version}"? + # + # Or should we just look for "libcrypto.*"? + # + if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \ + -f $dir/lib/libcrypto.so -o \ + -f $dir/lib/libcrypto.sl -o \ + -f $dir/lib/libcrypto.dylib \); then ac_cv_ssleay_path=$dir fi if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then @@ -599,46 +734,13 @@ if test "$ac_cv_ssleay_path" != no; then fi AC_CHECK_LIB(crypto, des_cbc_encrypt) - bak_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $V_INCLS" - AC_CHECK_HEADERS(cast.h) - - if test "$ac_cv_header_cast_h" = "yes"; then - AC_MSG_CHECKING(for buggy CAST128) - AC_TRY_RUN(dnl -[ -#include -main() -{ - unsigned char key[] = {0x01,0x23,0x45,0x67,0x12}; - unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF}; - unsigned char out[sizeof(in)]; - unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E}; - CAST_KEY ks; - CAST_set_key(&ks, sizeof(key), key); - CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT); - if (memcmp(out, ok, sizeof(ok)) != 0) - return 0; - else - return 1; -}], - [buggy_cast128=yes], - [buggy_cast128=no], - [buggy_cast128="cross-compiling, assume yes"]) - AC_MSG_RESULT($buggy_cast128) - if test "$buggy_cast128" != no; then - echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine." - echo "disabling CAST128 support." - AC_DEFINE(HAVE_BUGGY_CAST128) - fi - fi - - CPPFLAGS=$bak_CPPFLAGS + AC_CHECK_HEADERS(openssl/evp.h) fi ]) -AC_CHECK_HEADERS(rc5.h) AC_SUBST(V_CCOPT) +AC_SUBST(V_DEFS) AC_SUBST(V_GROUP) AC_SUBST(V_INCLS) AC_SUBST(V_PCAPDEP) -- cgit v1.1