Description: find endianness on every Debian architecture
 src/Core/OOCPUInfo.h maintains a hand-made list of architectures of each
 endianness. It uses environment variables when available, I guess this is
 used when hardware supports both. This build process fails for unknown
 architectures (alpha ia64 s390).
 .
 Some systems provide sys/param.h, and among them some define __BYTE_ORDER.
 Upstream avoids this solution as-is since it fails on some of their systems.

Bug-debian: http://bugs.debian.org/614277
Author: Michael Werle <micha@michaelwerle.com>
Author: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: Michael Werle <micha@michaelwerle.com>

--- a/src/Core/OOCPUInfo.h
+++ b/src/Core/OOCPUInfo.h
@@ -82,6 +82,17 @@
 #define OOLITE_LITTLE_ENDIAN	0
 #endif
 
+#if (! OOLITE_BIG_ENDIAN) && (! OOLITE_LITTLE_ENDIAN)
+#  include <sys/param.h>
+#  if defined(__BYTE_ORDER)
+#    if __BYTE_ORDER == __BIG_ENDIAN
+#      define OOLITE_BIG_ENDIAN 1
+#    endif
+#    if __BYTE_ORDER == __LITTLE_ENDIAN
+#      define OOLITE_LITTLE_ENDIAN 1
+#    endif
+#  endif
+#endif
 
 #if !OOLITE_BIG_ENDIAN && !OOLITE_LITTLE_ENDIAN
 #error Neither OOLITE_BIG_ENDIAN nor OOLITE_LITTLE_ENDIAN is defined as nonzero!
