Better endianness fix
authorMatthias Clasen <matthiasc@src.gnome.org>
Wed, 2 Jul 2008 19:21:53 +0000 (19:21 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 2 Jul 2008 19:21:53 +0000 (19:21 +0000)
svn path=/trunk/; revision=7149

ChangeLog
configure.in

index 37abd9f..d6dc208 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-07-02  Matthias Clasen  <mclasen@redhat.com>
 
+       * configure.in: Better endianness fix. From Tomas Mraz.
+
+2008-07-02  Matthias Clasen  <mclasen@redhat.com>
+
        * NEWS: Updates
 
 2008-07-02  Colin Walters  <walters@redhat.com>
index 7495555..348d512 100644 (file)
@@ -821,6 +821,20 @@ AM_CONDITIONAL(HAVE_SUNSTUDIO_VISIBILITY, [test x$g_have_sunstudio_visibility =
 
 # check for bytesex stuff
 AC_C_BIGENDIAN
+if test x$ac_cv_c_bigendian = xuniversal ; then
+AC_TRY_COMPILE([#include <endian.h>], [#if __BYTE_ORDER == __BIG_ENDIAN
+#else
+#error Not a big endian. 
+#endif],
+    ac_cv_c_bigendian=yes
+    ,AC_TRY_COMPILE([#include <endian.h>], [#if __BYTE_ORDER == __LITTLE_ENDIAN
+#else
+#error Not a little endian. 
+#endif],
+    ac_cv_c_bigendian=no
+    ,AC_MSG_WARN([Could not determine endianness.])))
+fi
+
 
 # check for header files
 AC_CHECK_HEADERS([dirent.h float.h limits.h pwd.h grp.h sys/param.h sys/poll.h sys/resource.h])