summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguy <guy>2004-04-17 08:44:49 +0000
committerguy <guy>2004-04-17 08:44:49 +0000
commitfaf8160c18545f4c508a1be179b89c39c6645c7e (patch)
tree3d08df2187ad10594a187d553ea0b19e75914e95
parent1875b8ffe1dd76012ee876094ffc85382cc810ea (diff)
downloadtcpdump-faf8160c18545f4c508a1be179b89c39c6645c7e.tar.gz
Second stage of adding support for 64-bit integral data types - this
causes the configure script to attempt to define the PRI[doux]64 macros if they're not defined by including <inttypes.h>, and causes "missing/bittypes.h" to attempt to define them, if undefined, in a fashion that should, with any luck, work on MSVC++ and various flavors of GNU C on Windows. Fix the spelling of "Mac OS X".
-rw-r--r--acconfig.h8
-rw-r--r--aclocal.m443
-rw-r--r--config.h.in8
-rwxr-xr-xconfigure434
-rw-r--r--configure.in65
-rw-r--r--missing/bittypes.h32
6 files changed, 540 insertions, 50 deletions
diff --git a/acconfig.h b/acconfig.h
index e6342d57..3027457e 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -20,6 +20,8 @@
/* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE
+/* define if <inttypes.h> defines PRI[doxu]64 macros */
+#undef INTTYPES_H_DEFINES_FORMATS
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
@@ -112,6 +114,12 @@
#undef u_int32_t
#undef u_int64_t
+/* Workaround for missing 64-bit formats */
+#undef PRId64
+#undef PRIo64
+#undef PRIx64
+#undef PRIu64
+
/* Whether or not to include the possibly-buggy SMB printer */
#undef TCPDUMP_DO_SMB
diff --git a/aclocal.m4 b/aclocal.m4
index d7e9f5b9..cbae4cbf 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.104 2004-04-17 04:33:17 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.105 2004-04-17 08:44:50 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
@@ -587,6 +587,47 @@ AC_DEFUN(AC_LBL_CHECK_TYPE,
fi])
dnl
+dnl Check whether a given format can be used to print 64-bit integers
+dnl
+AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT,
+ [
+ AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers])
+ AC_RUN_IFELSE(
+ [
+ AC_LANG_SOURCE(
+ [[
+# ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+# endif
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ u_int64_t t = 1;
+ char strbuf[16+1];
+ sprintf(strbuf, "%016$1x", t << 32);
+ if (strcmp(strbuf, "0000000100000000") == 0)
+ exit(0);
+ else
+ exit(1);
+ }
+ ]])
+ ],
+ [
+ AC_DEFINE(PRId64, "$1d")
+ AC_DEFINE(PRIo64, "$1o")
+ AC_DEFINE(PRIx64, "$1x")
+ AC_DEFINE(PRIu64, "$1u")
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ $2
+ ])
+ ])
+
+dnl
dnl Checks to see if unaligned memory accesses fail
dnl
dnl usage:
diff --git a/config.h.in b/config.h.in
index d6fc8ddb..58cff19c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -21,6 +21,8 @@
/* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE
+/* define if <inttypes.h> defines PRI[doxu]64 macros */
+#undef INTTYPES_H_DEFINES_FORMATS
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
@@ -113,6 +115,12 @@
#undef u_int32_t
#undef u_int64_t
+/* Workaround for missing 64-bit formats */
+#undef PRId64
+#undef PRIo64
+#undef PRIx64
+#undef PRIu64
+
/* Whether or not to include the possibly-buggy SMB printer */
#undef TCPDUMP_DO_SMB
diff --git a/configure b/configure
index 5cd63419..e87d1a34 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.179 .
+# From configure.in Revision: 1.180 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by Autoconf 2.52.
#
@@ -7991,6 +7991,350 @@ EOF
fi
+#
+# We can't just check for <inttypes.h> - some systems have one that
+# doesn't define all the PRI[doxu]64 macros.
+#
+
+for ac_header in inttypes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:8002: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8008 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8012: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:8018: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:8037: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+ #
+ # OK, we have inttypes.h, but does it define those macros?
+ #
+ echo "$as_me:8047: checking whether inttypes.h defines the PRI[doxu]64 macros" >&5
+echo $ECHO_N "checking whether inttypes.h defines the PRI[doxu]64 macros... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+
+ #line 8051 "configure"
+#include "confdefs.h"
+
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ printf("%" PRId64 "\n", (u_int64_t)1);
+ printf("%" PRIo64 "\n", (u_int64_t)1);
+ printf("%" PRIx64 "\n", (u_int64_t)1);
+ printf("%" PRIu64 "\n", (u_int64_t)1);
+ }
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8068: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:8071: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:8074: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8077: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:8080: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ ac_lbl_inttypes_h_defines_formats=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:8088: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ac_lbl_inttypes_h_defines_formats=no
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ #
+ # We don't have inttypes.h, so it obviously can't define those
+ # macros.
+ #
+ ac_lbl_inttypes_h_defines_formats=no
+
+fi
+done
+
+if test "$ac_lbl_inttypes_h_defines_formats" = yes; then
+ cat >>confdefs.h <<\EOF
+#define INTTYPES_H_DEFINES_FORMATS 1
+EOF
+
+else
+
+ echo "$as_me:8113: checking whether %llx can be used to format 64-bit integers" >&5
+echo $ECHO_N "checking whether %llx can be used to format 64-bit integers... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:8116: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+
+ #line 8122 "configure"
+#include "confdefs.h"
+
+# ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+# endif
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ u_int64_t t = 1;
+ char strbuf[16+1];
+ sprintf(strbuf, "%016llx", t << 32);
+ if (strcmp(strbuf, "0000000100000000") == 0)
+ exit(0);
+ else
+ exit(1);
+ }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8144: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8147: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:8149: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8152: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define PRId64 "lld"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIo64 "llo"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIx64 "llx"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIu64 "llu"
+EOF
+
+ echo "$as_me:8171: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:8179: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+ echo "$as_me:8182: checking whether %Lx can be used to format 64-bit integers" >&5
+echo $ECHO_N "checking whether %Lx can be used to format 64-bit integers... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:8185: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+
+ #line 8191 "configure"
+#include "confdefs.h"
+
+# ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+# endif
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ u_int64_t t = 1;
+ char strbuf[16+1];
+ sprintf(strbuf, "%016Lx", t << 32);
+ if (strcmp(strbuf, "0000000100000000") == 0)
+ exit(0);
+ else
+ exit(1);
+ }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8213: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8216: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:8218: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8221: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define PRId64 "Ld"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIo64 "Lo"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIx64 "Lx"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIu64 "Lu"
+EOF
+
+ echo "$as_me:8240: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:8248: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+ echo "$as_me:8251: checking whether %qx can be used to format 64-bit integers" >&5
+echo $ECHO_N "checking whether %qx can be used to format 64-bit integers... $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:8254: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+
+ #line 8260 "configure"
+#include "confdefs.h"
+
+# ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+# endif
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ u_int64_t t = 1;
+ char strbuf[16+1];
+ sprintf(strbuf, "%016qx", t << 32);
+ if (strcmp(strbuf, "0000000100000000") == 0)
+ exit(0);
+ else
+ exit(1);
+ }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8282: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8285: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:8287: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8290: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define PRId64 "qd"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIo64 "qo"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIx64 "qx"
+EOF
+
+ cat >>confdefs.h <<\EOF
+#define PRIu64 "qu"
+EOF
+
+ echo "$as_me:8309: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:8317: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+ { { echo "$as_me:8320: error: neither %llx nor %Lx nor %qx worked on a 64-bit integer" >&5
+echo "$as_me: error: neither %llx nor %Lx nor %qx worked on a 64-bit integer" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+
rm -f os-proto.h
if test "${LBL_CFLAGS+set}" = set; then
V_CCOPT="$V_CCOPT ${LBL_CFLAGS}"
@@ -8026,18 +8370,18 @@ rm -f os-proto.h
EOF
else
- { echo "$as_me:8029: WARNING: can't find $name" >&5
+ { echo "$as_me:8373: WARNING: can't find $name" >&5
echo "$as_me: WARNING: can't find $name" >&2;}
fi
fi
-echo "$as_me:8034: checking if sockaddr struct has sa_len member" >&5
+echo "$as_me:8378: checking if sockaddr struct has sa_len member" >&5
echo $ECHO_N "checking if sockaddr struct has sa_len member... $ECHO_C" >&6
if test "${ac_cv_lbl_sockaddr_has_sa_len+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8040 "configure"
+#line 8384 "configure"
#include "confdefs.h"
# include <sys/types.h>
@@ -8051,16 +8395,16 @@ u_int i = sizeof(((struct sockaddr *)0)->sa_len)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8054: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8398: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8057: \$? = $ac_status" >&5
+ echo "$as_me:8401: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8060: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8404: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8063: \$? = $ac_status" >&5
+ echo "$as_me:8407: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lbl_sockaddr_has_sa_len=yes
else
@@ -8071,7 +8415,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
- echo "$as_me:8074: result: $ac_cv_lbl_sockaddr_has_sa_len" >&5
+ echo "$as_me:8418: result: $ac_cv_lbl_sockaddr_has_sa_len" >&5
echo "${ECHO_T}$ac_cv_lbl_sockaddr_has_sa_len" >&6
if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
cat >>confdefs.h <<\EOF
@@ -8080,7 +8424,7 @@ EOF
fi
-echo "$as_me:8083: checking if unaligned accesses fail" >&5
+echo "$as_me:8427: checking if unaligned accesses fail" >&5
echo $ECHO_N "checking if unaligned accesses fail... $ECHO_C" >&6
if test "${ac_cv_lbl_unaligned_fail+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8167,7 +8511,7 @@ EOF
esac
fi
- echo "$as_me:8170: result: $ac_cv_lbl_unaligned_fail" >&5
+ echo "$as_me:8514: result: $ac_cv_lbl_unaligned_fail" >&5
echo "${ECHO_T}$ac_cv_lbl_unaligned_fail" >&6
if test $ac_cv_lbl_unaligned_fail = yes ; then
cat >>confdefs.h <<\EOF
@@ -8176,13 +8520,13 @@ EOF
fi
- echo "$as_me:8179: checking for h_errno" >&5
+ echo "$as_me:8523: checking for h_errno" >&5
echo $ECHO_N "checking for h_errno... $ECHO_C" >&6
if test "${ac_cv_var_h_errno+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8185 "configure"
+#line 8529 "configure"
#include "confdefs.h"
# include <sys/types.h>
@@ -8196,16 +8540,16 @@ int foo = h_errno;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8199: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8543: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8202: \$? = $ac_status" >&5
+ echo "$as_me:8546: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8205: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8549: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8208: \$? = $ac_status" >&5
+ echo "$as_me:8552: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_var_h_errno=yes
else
@@ -8216,7 +8560,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
- echo "$as_me:8219: result: $ac_cv_var_h_errno" >&5
+ echo "$as_me:8563: result: $ac_cv_var_h_errno" >&5
echo "${ECHO_T}$ac_cv_var_h_errno" >&6
if test "$ac_cv_var_h_errno" = "yes"; then
cat >>confdefs.h <<\EOF
@@ -8231,7 +8575,7 @@ if test "${with_crypto+set}" = set; then
else
-echo "$as_me:8234: checking for SSLeay" >&5
+echo "$as_me:8578: checking for SSLeay" >&5
echo $ECHO_N "checking for SSLeay... $ECHO_C" >&6
ac_cv_ssleay_path=no
incdir=no
@@ -8265,7 +8609,7 @@ for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg;
incdir=no
fi
done
-echo "$as_me:8268: result: $ac_cv_ssleay_path" >&5
+echo "$as_me:8612: result: $ac_cv_ssleay_path" >&5
echo "${ECHO_T}$ac_cv_ssleay_path" >&6
if test "$ac_cv_ssleay_path" != no; then
V_INCLS="$V_INCLS $incdir"
@@ -8277,7 +8621,7 @@ if test "$ac_cv_ssleay_path" != no; then
LIBS="$LIBS -lrsaref"
fi
-echo "$as_me:8280: checking for DES_cbc_encrypt in -lcrypto" >&5
+echo "$as_me:8624: checking for DES_cbc_encrypt in -lcrypto" >&5
echo $ECHO_N "checking for DES_cbc_encrypt in -lcrypto... $ECHO_C" >&6
if test "${ac_cv_lib_crypto_DES_cbc_encrypt+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8285,7 +8629,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8288 "configure"
+#line 8632 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8304,16 +8648,16 @@ DES_cbc_encrypt ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8307: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8651: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8310: \$? = $ac_status" >&5
+ echo "$as_me:8654: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8313: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8657: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8316: \$? = $ac_status" >&5
+ echo "$as_me:8660: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_crypto_DES_cbc_encrypt=yes
else
@@ -8324,7 +8668,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8327: result: $ac_cv_lib_crypto_DES_cbc_encrypt" >&5
+echo "$as_me:8671: result: $ac_cv_lib_crypto_DES_cbc_encrypt" >&5
echo "${ECHO_T}$ac_cv_lib_crypto_DES_cbc_encrypt" >&6
if test $ac_cv_lib_crypto_DES_cbc_encrypt = yes; then
cat >>confdefs.h <<EOF
@@ -8340,23 +8684,23 @@ fi
for ac_header in openssl/evp.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:8343: checking for $ac_header" >&5
+echo "$as_me:8687: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8349 "configure"
+#line 8693 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:8353: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:8697: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:8359: \$? = $ac_status" >&5
+ echo "$as_me:8703: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -8375,7 +8719,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:8378: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:8722: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -8406,7 +8750,7 @@ fi
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:8409: checking for a BSD compatible install" >&5
+echo "$as_me:8753: checking for a BSD compatible install" >&5
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
@@ -8455,7 +8799,7 @@ fi
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:8458: result: $INSTALL" >&5
+echo "$as_me:8802: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -8550,7 +8894,7 @@ DEFS=-DHAVE_CONFIG_H
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:8553: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:8897: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
@@ -8726,7 +9070,7 @@ cat >>$CONFIG_STATUS <<\EOF
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:8729: error: ambiguous option: $1
+ { { echo "$as_me:9073: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
@@ -8745,7 +9089,7 @@ Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:8748: error: unrecognized option: $1
+ -*) { { echo "$as_me:9092: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
@@ -8790,7 +9134,7 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- *) { { echo "$as_me:8793: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:9137: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
@@ -9013,7 +9357,7 @@ done; }
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:9016: creating $ac_file" >&5
+ { echo "$as_me:9360: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
@@ -9031,7 +9375,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:9034: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:9378: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -9044,7 +9388,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:9047: error: cannot find input file: $f" >&5
+ { { echo "$as_me:9391: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -9105,7 +9449,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:9108: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:9452: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
@@ -9116,7 +9460,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:9119: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:9463: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -9129,7 +9473,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:9132: error: cannot find input file: $f" >&5
+ { { echo "$as_me:9476: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -9246,7 +9590,7 @@ cat >>$CONFIG_STATUS <<\EOF
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:9249: $ac_file is unchanged" >&5
+ { echo "$as_me:9593: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
diff --git a/configure.in b/configure.in
index d9455fc6..3335cd1b 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.179 2004-04-17 04:33:17 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.180 2004-04-17 08:44:51 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
@@ -6,7 +6,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_REVISION($Revision: 1.179 $)
+AC_REVISION($Revision: 1.180 $)
AC_PREREQ(2.50)
AC_INIT(tcpdump.c)
@@ -15,7 +15,6 @@ AC_CANONICAL_HOST
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
-
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h netinet/ether.h)
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
#include <sys/socket.h>])
@@ -590,7 +589,7 @@ 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 Check for Mac OS 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 <pcap.h>])
@@ -696,6 +695,64 @@ AC_LBL_CHECK_TYPE(u_int32_t, u_int)
AC_LBL_CHECK_TYPE(int64_t, long long)
AC_LBL_CHECK_TYPE(u_int64_t, unsigned long long)
+#
+# We can't just check for <inttypes.h> - some systems have one that
+# doesn't define all the PRI[doxu]64 macros.
+#
+AC_CHECK_HEADERS(inttypes.h,
+ [
+ #
+ # OK, we have inttypes.h, but does it define those macros?
+ #
+ AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_SOURCE(
+ [[
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ main()
+ {
+ printf("%" PRId64 "\n", (u_int64_t)1);
+ printf("%" PRIo64 "\n", (u_int64_t)1);
+ printf("%" PRIx64 "\n", (u_int64_t)1);
+ printf("%" PRIu64 "\n", (u_int64_t)1);
+ }
+ ]])
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ ac_lbl_inttypes_h_defines_formats=yes
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ac_lbl_inttypes_h_defines_formats=no
+ ])
+ ],
+ [
+ #
+ # We don't have inttypes.h, so it obviously can't define those
+ # macros.
+ #
+ ac_lbl_inttypes_h_defines_formats=no
+ ])
+if test "$ac_lbl_inttypes_h_defines_formats" = yes; then
+ AC_DEFINE(INTTYPES_H_DEFINES_FORMATS)
+else
+ AC_LBL_CHECK_64BIT_FORMAT(ll,
+ [
+ AC_LBL_CHECK_64BIT_FORMAT(L,
+ [
+ AC_LBL_CHECK_64BIT_FORMAT(q,
+ [
+ AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
+ ])
+ ])
+ ])
+fi
+
AC_LBL_DEVEL(V_CCOPT)
AC_LBL_SOCKADDR_SA_LEN
diff --git a/missing/bittypes.h b/missing/bittypes.h
index 2ee7dae4..e1ab9af7 100644
--- a/missing/bittypes.h
+++ b/missing/bittypes.h
@@ -83,3 +83,35 @@ typedef unsigned short u_int64_t;
#endif
#endif /* HAVE_U_INT64_T */
+
+#ifndef PRId64
+#ifdef _MSC_EXTENSIONS
+#define PRId64 "i64d"
+#else /* _MSC_EXTENSIONS */
+#define PRId64 "lld"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRId64 */
+
+#ifndef PRIo64
+#ifdef _MSC_EXTENSIONS
+#define PRIo64 "i64o"
+#else /* _MSC_EXTENSIONS */
+#define PRIo64 "llo"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIo64 */
+
+#ifndef PRIx64
+#ifdef _MSC_EXTENSIONS
+#define PRIx64 "i64x"
+#else /* _MSC_EXTENSIONS */
+#define PRIx64 "llx"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIx64 */
+
+#ifndef PRIu64
+#ifdef _MSC_EXTENSIONS
+#define PRIu64 "i64u"
+#else /* _MSC_EXTENSIONS */
+#define PRIu64 "llu"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIu64 */