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