4ffea2
From 270e016f8d24ef4bd99f26084100581d2ea97a19 Mon Sep 17 00:00:00 2001
Adam Tkac c5814f
From: Adam Tkac <atkac@redhat.com>
4ffea2
Date: Mon, 12 Jan 2009 10:29:10 +1000
4ffea2
Subject: [PATCH] Workaround for RH bug #449944
Adam Tkac c5814f
Adam Tkac c5814f
AC_C_BIGENDIAN macro in autoconf 2.62 is badly broken. See
Adam Tkac c5814f
https://bugzilla.redhat.com/show_bug.cgi?id=449944 for more information.
Adam Tkac c5814f
4ffea2
Forward-ported to 1.6 prerelease.
4ffea2
---
4ffea2
 configure.ac             |   10 +++++++++-
4ffea2
 include/dix-config.h.in  |    8 ++++++++
4ffea2
 include/xorg-server.h.in |    8 ++++++++
4ffea2
 3 files changed, 25 insertions(+), 1 deletions(-)
4ffea2
4ffea2
diff --git a/configure.ac b/configure.ac
4ffea2
index c222c95..e40a1a2 100644
4ffea2
--- a/configure.ac
4ffea2
+++ b/configure.ac
4ffea2
@@ -103,7 +103,6 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
Adam Tkac c5814f
 
Adam Tkac c5814f
 dnl Checks for typedefs, structures, and compiler characteristics.
Adam Tkac c5814f
 AC_C_CONST
Adam Tkac c5814f
-AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
Adam Tkac c5814f
 
Adam Tkac c5814f
 AC_CHECK_SIZEOF([unsigned long])
Adam Tkac c5814f
 if test "$ac_cv_sizeof_unsigned_long" = 8; then
4ffea2
@@ -1182,6 +1181,15 @@ AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
Adam Tkac c5814f
 AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
Adam Tkac c5814f
 
Adam Tkac c5814f
 XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
4ffea2
+AH_VERBATIM([X_BYTE_ORDER],[
Adam Tkac c5814f
+/* Define endian order */
4ffea2
+#ifdef __BIG_ENDIAN__
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_BIG_ENDIAN
4ffea2
+#else
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_LITTLE_ENDIAN
4ffea2
+#endif
Adam Tkac c5814f
+#define X_BYTE_ORDER _X_BYTE_ORDER
4ffea2
+])
Adam Tkac c5814f
 
Adam Tkac c5814f
 dnl ---------------------------------------------------------------------------
4ffea2
 dnl DDX section.
4ffea2
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
4ffea2
index 977bff3..a3ce66c 100644
4ffea2
--- a/include/dix-config.h.in
4ffea2
+++ b/include/dix-config.h.in
4ffea2
@@ -363,6 +363,14 @@
Adam Tkac c5814f
 /* Vendor name */
Adam Tkac c5814f
 #undef XVENDORNAME
Adam Tkac c5814f
 
Adam Tkac c5814f
+/* Define endian order */
4ffea2
+#ifdef __BIG_ENDIAN__
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_BIG_ENDIAN
4ffea2
+#else
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_LITTLE_ENDIAN
4ffea2
+#endif
Adam Tkac c5814f
+#define X_BYTE_ORDER _X_BYTE_ORDER
4ffea2
+
Adam Tkac c5814f
 /* Enable GNU and other extensions to the C environment for GLIBC */
Adam Tkac c5814f
 #undef _GNU_SOURCE
4ffea2
 
4ffea2
diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
4ffea2
index 4cf1bbf..f041c7c 100644
4ffea2
--- a/include/xorg-server.h.in
4ffea2
+++ b/include/xorg-server.h.in
4ffea2
@@ -145,6 +145,14 @@
Adam Tkac c5814f
 /* Vendor name */
Adam Tkac c5814f
 #undef XVENDORNAME
Adam Tkac c5814f
 
Adam Tkac c5814f
+/* Define endian order */
4ffea2
+#ifdef __BIG_ENDIAN__
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_BIG_ENDIAN
4ffea2
+#else
Adam Tkac c5814f
+#define _X_BYTE_ORDER X_LITTLE_ENDIAN
4ffea2
+#endif
Adam Tkac c5814f
+#define X_BYTE_ORDER _X_BYTE_ORDER
4ffea2
+
Adam Tkac c5814f
 /* BSD-compliant source */
Adam Tkac c5814f
 #undef _BSD_SOURCE
4ffea2
 
4ffea2
-- 
4ffea2
1.6.0.6
4ffea2