summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-04-23 00:20:40 -0700
committerGuy Harris <guy@alum.mit.edu>2014-04-23 00:20:40 -0700
commited85e20e4d6a27d5405f37366dd34b64c10a9211 (patch)
tree1dd34201f8777a4aba0ecbc39e8f480ba1407c41 /configure
parent595f1b5414c37b6ba31ed876343fd278a4c058ca (diff)
downloadtcpdump-ed85e20e4d6a27d5405f37366dd34b64c10a9211.tar.gz
u_intN_t is dead, long live uintN_t.
And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure159
1 files changed, 88 insertions, 71 deletions
diff --git a/configure b/configure
index 114edcd6..37aa8a1b 100755
--- a/configure
+++ b/configure
@@ -6897,75 +6897,107 @@ _ACEOF
#
-# For now, we're using the old BSD-style u_intXX_t types, so check for
-# them.
+# The minimum version of autoconf that we support is 2.61, and it
+# supports the AC_TYPE_UINTn_T macros. Use them; we've stopped
+# using the old BSD-style u_intXX_t types.
#
-# We should probably migrate to the standard C uintXX_t types.
-#
-for ac_header in sys/bitypes.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_bitypes_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_BITYPES_H 1
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
_ACEOF
+;;
+ esac
-fi
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+ no|yes) ;; #(
+ *)
-done
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+ no|yes) ;; #(
+ *)
-ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int8_t" = xyes; then :
-else
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+ esac
-$as_echo "#define u_int8_t unsigned char" >>confdefs.h
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+ no|yes) ;; #(
+ *)
-fi
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
-ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int16_t" = xyes; then :
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+ no|yes) ;; #(
+ *)
-else
+$as_echo "#define _UINT32_T 1" >>confdefs.h
-$as_echo "#define u_int16_t unsigned short" >>confdefs.h
-fi
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+ esac
-ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int32_t" = xyes; then :
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+ no|yes) ;; #(
+ *)
-else
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
-$as_echo "#define u_int32_t unsigned int" >>confdefs.h
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+ no|yes) ;; #(
+ *)
-fi
+$as_echo "#define _UINT64_T 1" >>confdefs.h
-ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "$ac_includes_default
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-"
-if test "x$ac_cv_type_u_int64_t" = xyes; then :
-else
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+ esac
-$as_echo "#define u_int64_t unsigned long long" >>confdefs.h
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+ no|yes) ;; #(
+ *)
-fi
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
#
@@ -6992,16 +7024,13 @@ $as_echo_n "checking whether inttypes.h defines the PRI[doxu]64 macros... " >&6;
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
- #ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
- #endif
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);
+ printf("%" PRId64 "\n", (uint64_t)1);
+ printf("%" PRIo64 "\n", (uint64_t)1);
+ printf("%" PRIx64 "\n", (uint64_t)1);
+ printf("%" PRIu64 "\n", (uint64_t)1);
}
@@ -7050,15 +7079,12 @@ else
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
-# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016lx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
@@ -7107,15 +7133,12 @@ else
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
-# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016llx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
@@ -7164,15 +7187,12 @@ else
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
-# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016Lx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
@@ -7221,15 +7241,12 @@ else
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
-# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016qx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)