OSDN Git Service

2010-03-23 Paolo Carlini <paolo.carlini@oracle.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / configure
index 5ae0996..ed611d6 100755 (executable)
@@ -843,8 +843,15 @@ enable_version_specific_runtime_libs
       ac_precious_vars='build_alias
 host_alias
 target_alias
-CPP
+CC
+CFLAGS
+LDFLAGS
+LIBS
 CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CPP
 CXXCPP'
 
 
@@ -3485,26 +3492,9 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
-# We're almost certainly being configured before anything else which uses
-# C++, so all of our AC_PROG_* discoveries will be cached.  It's vital that
-# we not cache the value of CXX that we "discover" here, because it's set
-# to something unique for us and libjava.  Other target libraries need to
-# find CXX for themselves.  We yank the rug out from under the normal AC_*
-# process by sneakily renaming the cache variable.  This also lets us debug
-# the value of "our" CXX in postmortems.
-#
-# We must also force CXX to /not/ be a precious variable, otherwise the
-# wrong (non-multilib-adjusted) value will be used in multilibs.  This
-# little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS.  And as a side
-# effect, CXXFLAGS is no longer automagically subst'd, so we have to do
-# that ourselves.  Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
-#
 # -fno-builtin must be present here so that a non-conflicting form of
 # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
 
-
-
-
 save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS -fno-builtin"
 ac_ext=c
@@ -4317,11 +4307,11 @@ if test -z "$CXX"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${glibcxx_cv_prog_CXX+set}" = set; then :
+if test "${ac_cv_prog_CXX+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
-  glibcxx_cv_prog_CXX="$CXX" # Let the user override the test.
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4330,7 +4320,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    glibcxx_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4340,7 +4330,7 @@ IFS=$as_save_IFS
 
 fi
 fi
-CXX=$glibcxx_cv_prog_CXX
+CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
 $as_echo "$CXX" >&6; }
@@ -4560,9 +4550,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 CXXFLAGS="$save_CXXFLAGS"
 
-
-
-
 # Runs configure.host, and assorted other critical bits.  Sets
 # up critical shell variables.
 
@@ -11454,7 +11441,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11457 "configure"
+#line 11444 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11560,7 +11547,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11563 "configure"
+#line 11550 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14828,6 +14815,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+# Eliminate -lstdc++ addition to postdeps for cross compiles.
+postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'`
+
 # Possibly disable most of the library.
 ## TODO: Consider skipping unncessary tests altogether in this case, rather
 ## than just ignoring the results.  Faster /and/ more correct, win win.
@@ -14897,7 +14887,7 @@ fi
     #
     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 14900 "configure"
+#line 14890 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -15052,14 +15042,220 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
   old_CXXFLAGS="$CXXFLAGS"
 
+  # Do link tests if possible, instead asm tests, limited to some platforms
+  # see discussion in PR target/40134, PR libstdc++/40133 and the thread
+  # starting at http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00322.html
+  atomic_builtins_link_tests=no
+  if test x$gcc_no_link != xyes; then
+    # Can do link tests. Limit to some tested platforms
+    case "$host" in
+      *-*-linux* | *-*-uclinux* | *-*-kfreebsd*-gnu | *-*-gnu*)
+       atomic_builtins_link_tests=yes
+        ;;
+    esac
+  fi
+
+  if test x$atomic_builtins_link_tests = xyes; then
+
+  # Do link tests.
+
+  CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for bool" >&5
+$as_echo_n "checking for atomic builtins for bool... " >&6; }
+  if test "${glibcxx_cv_atomic_bool+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+typedef bool atomic_type;
+       atomic_type c1;
+       atomic_type c2;
+       const atomic_type c3(0);
+       __sync_fetch_and_add(&c1, c2);
+       __sync_val_compare_and_swap(&c1, c3, c2);
+       __sync_lock_test_and_set(&c1, c3);
+       __sync_lock_release(&c1);
+       __sync_synchronize();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_atomic_bool=yes
+else
+  glibcxx_cv_atomic_bool=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+  if test $glibcxx_cv_atomic_bool = yes; then
+
+$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_1 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_bool" >&5
+$as_echo "$glibcxx_cv_atomic_bool" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for short" >&5
+$as_echo_n "checking for atomic builtins for short... " >&6; }
+  if test "${glibcxx_cv_atomic_short+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+typedef short atomic_type;
+       atomic_type c1;
+       atomic_type c2;
+       const atomic_type c3(0);
+       __sync_fetch_and_add(&c1, c2);
+       __sync_val_compare_and_swap(&c1, c3, c2);
+       __sync_lock_test_and_set(&c1, c3);
+       __sync_lock_release(&c1);
+       __sync_synchronize();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_atomic_short=yes
+else
+  glibcxx_cv_atomic_short=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+  if test $glibcxx_cv_atomic_short = yes; then
+
+$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_2 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_short" >&5
+$as_echo "$glibcxx_cv_atomic_short" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for int" >&5
+$as_echo_n "checking for atomic builtins for int... " >&6; }
+  if test "${glibcxx_cv_atomic_int+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+typedef int atomic_type;
+       atomic_type c1;
+       atomic_type c2;
+       const atomic_type c3(0);
+       __sync_fetch_and_add(&c1, c2);
+       __sync_val_compare_and_swap(&c1, c3, c2);
+       __sync_lock_test_and_set(&c1, c3);
+       __sync_lock_release(&c1);
+       __sync_synchronize();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_atomic_int=yes
+else
+  glibcxx_cv_atomic_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+  if test $glibcxx_cv_atomic_int = yes; then
+
+$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_4 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_int" >&5
+$as_echo "$glibcxx_cv_atomic_int" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for long long" >&5
+$as_echo_n "checking for atomic builtins for long long... " >&6; }
+  if test "${glibcxx_cv_atomic_long_long+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+typedef long long atomic_type;
+       atomic_type c1;
+       atomic_type c2;
+       const atomic_type c3(0);
+       __sync_fetch_and_add(&c1, c2);
+       __sync_val_compare_and_swap(&c1, c3, c2);
+       __sync_lock_test_and_set(&c1, c3);
+       __sync_lock_release(&c1);
+       __sync_synchronize();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_atomic_long_long=yes
+else
+  glibcxx_cv_atomic_long_long=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+  if test $glibcxx_cv_atomic_long_long = yes; then
+
+$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_8 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_long_long" >&5
+$as_echo "$glibcxx_cv_atomic_long_long" >&6; }
+
+  else
+
+  # Do asm tests.
+
   # Compile unoptimized.
   CXXFLAGS='-O0 -S'
 
-  # Fake what AC_TRY_COMPILE does, without linking as this is
-  # unnecessary for a builtins test.
+  # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 15062 "configure"
+#line 15258 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -15083,20 +15279,20 @@ $as_echo_n "checking for atomic builtins for bool... " >&6; }
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
       if grep __sync_ conftest.s >/dev/null 2>&1 ; then
-        enable_atomic_builtinsb=no
+        glibcxx_cv_atomic_bool=no
       else
 
 $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_1 1" >>confdefs.h
 
-        enable_atomic_builtinsb=yes
+        glibcxx_cv_atomic_bool=yes
       fi
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_builtinsb" >&5
-$as_echo "$enable_atomic_builtinsb" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_bool" >&5
+$as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15099 "configure"
+#line 15295 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -15120,20 +15316,20 @@ $as_echo_n "checking for atomic builtins for short... " >&6; }
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
       if grep __sync_ conftest.s >/dev/null 2>&1 ; then
-        enable_atomic_builtinss=no
+        glibcxx_cv_atomic_short=no
       else
 
 $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_2 1" >>confdefs.h
 
-        enable_atomic_builtinss=yes
+        glibcxx_cv_atomic_short=yes
       fi
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_builtinss" >&5
-$as_echo "$enable_atomic_builtinss" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_short" >&5
+$as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15136 "configure"
+#line 15332 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -15158,20 +15354,20 @@ $as_echo_n "checking for atomic builtins for int... " >&6; }
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
       if grep __sync_ conftest.s >/dev/null 2>&1 ; then
-        enable_atomic_builtinsi=no
+        glibcxx_cv_atomic_int=no
       else
 
 $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_4 1" >>confdefs.h
 
-        enable_atomic_builtinsi=yes
+        glibcxx_cv_atomic_int=yes
       fi
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_builtinsi" >&5
-$as_echo "$enable_atomic_builtinsi" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_int" >&5
+$as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15174 "configure"
+#line 15370 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -15195,18 +15391,19 @@ $as_echo_n "checking for atomic builtins for long long... " >&6; }
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
       if grep __sync_ conftest.s >/dev/null 2>&1 ; then
-        enable_atomic_builtinsll=no
+        glibcxx_cv_atomic_long_long=no
       else
 
 $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS_8 1" >>confdefs.h
 
-        enable_atomic_builtinsll=yes
+        glibcxx_cv_atomic_long_long=yes
       fi
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_builtinsll" >&5
-$as_echo "$enable_atomic_builtinsll" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_long_long" >&5
+$as_echo "$glibcxx_cv_atomic_long_long" >&6; }
     rm -f conftest*
 
+  fi
 
   CXXFLAGS="$old_CXXFLAGS"
   ac_ext=c
@@ -15217,7 +15414,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
   # Set atomicity_dir to builtins if either of above tests pass.
-  if test $enable_atomic_builtinsi = yes || test $enable_atomic_builtinsb = yes ; then
+  if test $glibcxx_cv_atomic_int = yes || test $glibcxx_cv_atomic_bool = yes ; then
     atomicity_dir=cpu/generic/atomicity_builtins
   fi
 
@@ -15246,7 +15443,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15249 "configure"
+#line 15446 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -16859,11 +17056,11 @@ $as_echo "$enable_libstdcxx_debug" >&6; }
 
   # See if configured libgomp/omp.h exists. (libgomp may be in
   # noconfigdirs but not explicitly disabled.)
-  if test -f $glibcxx_builddir/../libgomp/omp.h; then
+  if echo " ${TARGET_CONFIGDIRS} " | grep " libgomp " > /dev/null 2>&1 ; then
     enable_parallel=yes;
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: $glibcxx_builddir/../libgomp/omp.h not found" >&5
-$as_echo "$as_me: $glibcxx_builddir/../libgomp/omp.h not found" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: target-libgomp not built" >&5
+$as_echo "$as_me: target-libgomp not built" >&6;}
   fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for parallel mode support" >&5
@@ -19255,8 +19452,8 @@ fi
 
 
 # Check for available headers.
-for ac_header in endian.h float.h fp.h ieeefp.h inttypes.h locale.h \
-machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
+for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
 strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
 sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
 wchar.h wctype.h
@@ -61600,49 +61797,61 @@ if test "$acx_cv_header_stdint" = stddef.h; then
     #define _UINT8_T
     #ifndef __uint8_t_defined
     #define __uint8_t_defined
+    #ifndef uint8_t
     typedef unsigned $acx_cv_type_int8_t uint8_t;
     #endif
     #endif
+    #endif
 
     #ifndef _UINT16_T
     #define _UINT16_T
     #ifndef __uint16_t_defined
     #define __uint16_t_defined
+    #ifndef uint16_t
     typedef unsigned $acx_cv_type_int16_t uint16_t;
     #endif
     #endif
+    #endif
 
     #ifndef _UINT32_T
     #define _UINT32_T
     #ifndef __uint32_t_defined
     #define __uint32_t_defined
+    #ifndef uint32_t
     typedef unsigned $acx_cv_type_int32_t uint32_t;
     #endif
     #endif
+    #endif
 
     #ifndef _INT8_T
     #define _INT8_T
     #ifndef __int8_t_defined
     #define __int8_t_defined
+    #ifndef int8_t
     typedef $acx_cv_type_int8_t int8_t;
     #endif
     #endif
+    #endif
 
     #ifndef _INT16_T
     #define _INT16_T
     #ifndef __int16_t_defined
     #define __int16_t_defined
+    #ifndef int16_t
     typedef $acx_cv_type_int16_t int16_t;
     #endif
     #endif
+    #endif
 
     #ifndef _INT32_T
     #define _INT32_T
     #ifndef __int32_t_defined
     #define __int32_t_defined
+    #ifndef int32_t
     typedef $acx_cv_type_int32_t int32_t;
     #endif
     #endif
+    #endif
 EOF
 elif test "$ac_cv_type_u_int32_t" = yes; then
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -61662,25 +61871,31 @@ elif test "$ac_cv_type_u_int32_t" = yes; then
     #define _UINT8_T
     #ifndef __uint8_t_defined
     #define __uint8_t_defined
+    #ifndef uint8_t
     typedef u_int8_t uint8_t;
     #endif
     #endif
+    #endif
 
     #ifndef _UINT16_T
     #define _UINT16_T
     #ifndef __uint16_t_defined
     #define __uint16_t_defined
+    #ifndef uint16_t
     typedef u_int16_t uint16_t;
     #endif
     #endif
+    #endif
 
     #ifndef _UINT32_T
     #define _UINT32_T
     #ifndef __uint32_t_defined
     #define __uint32_t_defined
+    #ifndef uint32_t
     typedef u_int32_t uint32_t;
     #endif
     #endif
+    #endif
 EOF
 else
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -61730,9 +61945,11 @@ elif test "$ac_cv_type_u_int64_t" = yes; then
     #define _UINT64_T
     #ifndef __uint64_t_defined
     #define __uint64_t_defined
+    #ifndef uint64_t
     typedef u_int64_t uint64_t;
     #endif
     #endif
+    #endif
 EOF
 elif test -n "$acx_cv_type_int64_t"; then
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -61740,15 +61957,19 @@ elif test -n "$acx_cv_type_int64_t"; then
     /* architecture has a 64-bit type, $acx_cv_type_int64_t */
     #ifndef _INT64_T
     #define _INT64_T
+    #ifndef int64_t
     typedef $acx_cv_type_int64_t int64_t;
     #endif
+    #endif
     #ifndef _UINT64_T
     #define _UINT64_T
     #ifndef __uint64_t_defined
     #define __uint64_t_defined
+    #ifndef uint64_t
     typedef unsigned $acx_cv_type_int64_t uint64_t;
     #endif
     #endif
+    #endif
 EOF
 else
   sed 's/^ *//' >> tmp-stdint.h <<EOF
@@ -61758,13 +61979,17 @@ else
     #ifndef _INT64_T
     #define _INT64_T
     #ifndef __int64_t_defined
+    #ifndef int64_t
     typedef long long int64_t;
     #endif
     #endif
+    #endif
     #ifndef _UINT64_T
     #define _UINT64_T
+    #ifndef uint64_t
     typedef unsigned long long uint64_t;
     #endif
+    #endif
 
     #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0
     /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
@@ -61776,24 +62001,32 @@ else
 
     # ifndef _INT64_T
     # define _INT64_T
+    # ifndef int64_t
     __extension__ typedef long long int64_t;
     # endif
+    # endif
     # ifndef _UINT64_T
     # define _UINT64_T
+    # ifndef uint64_t
     __extension__ typedef unsigned long long uint64_t;
     # endif
+    # endif
 
     #elif !defined __STRICT_ANSI__
     # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
 
     #  ifndef _INT64_T
     #  define _INT64_T
+    #  ifndef int64_t
     typedef __int64 int64_t;
     #  endif
+    #  endif
     #  ifndef _UINT64_T
     #  define _UINT64_T
+    #  ifndef uint64_t
     typedef unsigned __int64 uint64_t;
     #  endif
+    #  endif
     # endif /* compiler */
 
     #endif /* ANSI version */
@@ -61806,11 +62039,15 @@ if test "$ac_cv_type_uintptr_t" != yes; then
 
     /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */
     #ifndef __uintptr_t_defined
+    #ifndef uintptr_t
     typedef u$acx_cv_type_intptr_t uintptr_t;
     #endif
+    #endif
     #ifndef __intptr_t_defined
+    #ifndef intptr_t
     typedef $acx_cv_type_intptr_t  intptr_t;
     #endif
+    #endif
 EOF
 fi
 
@@ -61860,16 +62097,20 @@ if test "$ac_cv_type_uintmax_t" != yes; then
   sed 's/^ *//' >> tmp-stdint.h <<EOF
 
     /* Define intmax based on what we found */
+    #ifndef intmax_t
     #ifdef _INT64_T
     typedef int64_t       intmax_t;
     #else
     typedef long          intmax_t;
     #endif
+    #endif
+    #ifndef uintmax_t
     #ifdef _UINT64_T
     typedef uint64_t      uintmax_t;
     #else
     typedef unsigned long uintmax_t;
     #endif
+    #endif
 EOF
 fi