]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN.
authorKelley Cook <kcook@gcc.gnu.org>
Wed, 4 May 2005 01:14:51 +0000 (01:14 +0000)
committerR. Kelley Cook <kcook@gcc.gnu.org>
Wed, 4 May 2005 01:14:51 +0000 (01:14 +0000)
2005-05-04  Kelley Cook  <kcook@gcc.gnu.org>

* config/m32r/xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN.
* config/m32r/xm-linux.h: Don't undefine HOST_WORDS_BIG_ENDIAN.
* mips-tfile.c: Use WORDS_BIG_ENDIAN instead of HOST_WORDS_BIG_ENDIAN.
* aclocal.m4: Don't include accross.m4.
* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
* configure, config.in: Regenerate.

From-SVN: r99203

gcc/ChangeLog
gcc/aclocal.m4
gcc/config.in
gcc/config/m32r/xm-linux.h
gcc/config/m32r/xm-m32r.h
gcc/configure
gcc/configure.ac
gcc/mips-tfile.c

index aac45faaf1d072dde5124f777ab8260a33cab2ee..37671990b4e80cb989c1943375b5dec268732332 100644 (file)
@@ -1,3 +1,13 @@
+2005-05-04  Kelley Cook  <kcook@gcc.gnu.org>
+
+       * config/m32r/xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN.
+       * config/m32r/xm-linux.h: Don't undefine HOST_WORDS_BIG_ENDIAN.
+       * mips-tfile.c: Use WORDS_BIG_ENDIAN instead of HOST_WORDS_BIG_ENDIAN.
+       * aclocal.m4: Don't include accross.m4.
+       * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
+       Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
+       * configure, config.in: Regenerate.
+       
 2005-05-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/21265
index f5e13d8a15bbb98dfe0f0c241662bd9cad22035a..ad7f518f8ede1e9f5c6b9edbfb8b71639f7e54ab 100644 (file)
@@ -1,4 +1,3 @@
-m4_include([../config/accross.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/gettext-sister.m4])
 m4_include([../config/iconv.m4])
index eae8b5465c1094a27f9b1709c8075bd0bedf9bb8..74c3e5a5fca2a87cb410e77b3cbbf69dbdf8d55c 100644 (file)
@@ -1,8 +1,5 @@
 /* config.in.  Generated from configure.ac by autoheader.  */
 
-/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-#undef BYTEORDER
-
 /* Define as the number of bits in a byte, if \`limits.h' doesn't. */
 #undef CHAR_BIT
 
 /* Define if your compiler supports the \`__int64' type. */
 #undef HAVE___INT64
 
-/* Define if the host machine stores words of multi-word integers in
-   big-endian order. */
-#undef HOST_WORDS_BIG_ENDIAN
-
 /* Define as const if the declaration of iconv() needs const. */
 #undef ICONV_CONST
 
    The default is the GCC version number. */
 #undef WIN32_REGISTRY_KEY
 
-/* whether byteorder is bigendian */
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
 #undef WORDS_BIGENDIAN
 
 /* Always define this when using the GNU C Library */
index 1c6f46297989e3f9b0b794d7fe500741da65235b..ed7fb68caef6517991ff8b36b49797e91c7c2360 100644 (file)
@@ -20,7 +20,3 @@
 
 #include <m32r/xm-m32r.h>
 #include <xm-linux.h>
-
-/* Doubles are stored in memory with the high order word first.
-   This matters when cross-compiling.  */
-#undef HOST_WORDS_BIG_ENDIAN
index c7b006ae3b5f0b9cfcf30c7a22b5d1366cca2449..4fd6c06af71c72f70d954b461c526d8cce2e2153 100644 (file)
 #define HOST_BITS_PER_LONG      32
 #define HOST_BITS_PER_LONGLONG  64
 
-/* Doubles are stored in memory with the high order word first.
-   This matters when cross-compiling.  */
-#define HOST_WORDS_BIG_ENDIAN    1
-
 /* target machine dependencies.
    tm.h is a symbolic link to the actual target specific file.  */
 #include "tm.h"
index bf9966f4340808861babe0b498b33c93bab764ba..4c4f3171d9acc1e228cf3eb0cce0cbed470058cb 100755 (executable)
@@ -8344,8 +8344,7 @@ echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
 if test "${ac_cv_c_bigendian+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_c_bigendian=unknown
-# See if sys/param.h defines the BYTE_ORDER macro.
+  # See if sys/param.h defines the BYTE_ORDER macro.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8354,13 +8353,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/param.h>
+
 int
 main ()
 {
-
 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  bogus endian macros
 #endif
+
   ;
   return 0;
 }
@@ -8396,13 +8396,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/param.h>
+
 int
 main ()
 {
-
 #if BYTE_ORDER != BIG_ENDIAN
  not big endian
 #endif
+
   ;
   return 0;
 }
@@ -8441,11 +8442,69 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-if test $ac_cv_c_bigendian = unknown; then
-if test "$cross_compiling" = yes; then
-   echo $ac_n "cross-compiling... " 2>&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8453,7 +8512,9 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-main () {
+int
+main ()
+{
   /* Are we little or big endian?  From Harbison&Steele.  */
   union
   {
@@ -8487,67 +8548,26 @@ fi
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
 echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-if test $ac_cv_c_bigendian = unknown; then
-echo "$as_me:$LINENO: checking to probe for byte ordering" >&5
-echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6
-
-cat >conftest.c <<EOF
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
-int main() { _ascii (); _ebcdic (); return 0; }
-EOF
- if test -f conftest.c ; then
-     if ${CC-cc} ${CFLAGS} -c conftest.c -o conftest.o && test -f conftest.o ; then
-        if test `grep -l BIGenDianSyS conftest.o` ; then
-           echo $ac_n ' big endian probe OK, ' 1>&6
-           ac_cv_c_bigendian=yes
-        fi
-        if test `grep -l LiTTleEnDian conftest.o` ; then
-           echo $ac_n ' little endian probe OK, ' 1>&6
-           if test $ac_cv_c_bigendian = yes ; then
-            ac_cv_c_bigendian=unknown;
-           else
-            ac_cv_c_bigendian=no
-           fi
-        fi
-        echo $ac_n 'guessing bigendian ...  ' >&6
-     fi
-  fi
-echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-fi
-if test $ac_cv_c_bigendian = yes; then
+case $ac_cv_c_bigendian in
+  yes)
 
 cat >>confdefs.h <<\_ACEOF
 #define WORDS_BIGENDIAN 1
 _ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HOST_WORDS_BIG_ENDIAN 1
-_ACEOF
-
-  BYTEORDER=4321
-else
-  BYTEORDER=1234
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define BYTEORDER $BYTEORDER
-_ACEOF
-
-if test $ac_cv_c_bigendian = unknown; then
-  { { echo "$as_me:$LINENO: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&5
-echo "$as_me: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&2;}
-   { (exit 1); exit 1; }; }
-fi
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
 
 
 # --------
index 23c914de44366aeb7915db3f6f3a88efbc821831..4a3cb3793706f811b80d16748fdde10e7217cf01 100644 (file)
@@ -893,7 +893,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
 
 # These tests can't be done till we know if we have limits.h.
 gcc_AC_C_CHAR_BIT
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 # --------
 # UNSORTED
index c0aec6f072edb012f2b7eaf852c1e7d8d1ed208c..49ae0773d99acd362ddfad71385dec2ee9b9f6a9 100644 (file)
@@ -2358,7 +2358,7 @@ initialize_init_file (void)
   init_file.fdr.fMerge = 1;
   init_file.fdr.glevel = GLEVEL_2;
 
-#ifdef HOST_WORDS_BIG_ENDIAN
+#ifdef WORDS_BIG_ENDIAN
   init_file.fdr.fBigendian = 1;
 #endif