bug-ghostscript
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 06/21] configure: Fix endianess test while cross-compiling


From: John Darrington
Subject: [PATCH 06/21] configure: Fix endianess test while cross-compiling
Date: Sun, 12 Jan 2014 12:00:19 +0100

* configure.ac: Replace ad hoc endianness test with the standard autoconf one
---
 configure.ac |   21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 150523e..fe7f6b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1862,25 +1862,16 @@ AC_CHECK_FUNCS([bzero dup2 floor gettimeofday memchr 
memmove memset mkdir mkfifo
 dnl --------------------------------------------------
 dnl check for big/little endian for LCMS
 dnl --------------------------------------------------
+AC_C_BIGENDIAN([BIGENDIAN=1],[BIGENDIAN=0],
+       [AC_MSG_ERROR([Cannot determine endianess])],
+       [AC_MSG_ERROR([Endianess is ambiguous])])
 
-AC_MSG_CHECKING([for big endian])
-
-AC_RUN_IFELSE(
-  [AC_LANG_PROGRAM([#include <stdio.h>], [
-   static const int one = 1;
-   return (*(char*)&one == 0 ? 0 : 1);
-  ])],
-  [LCMS_BIGENDIAN=1],
-  [LCMS_BIGENDIAN=0])
-
-if test "x$LCMS_BIGENDIAN" != "x0"; then
-  LCMS_ENDIAN="-DUSE_BIG_ENDIAN=$LCMS_BIGENDIAN"
-  LCMS2_ENDIAN="-DCMS_USE_BIG_ENDIAN=$LCMS_BIGENDIAN"
-  AC_MSG_RESULT(yes)
+if test "x$BIGENDIAN" != "x0"; then
+  LCMS_ENDIAN="-DUSE_BIG_ENDIAN=$BIGENDIAN"
+  LCMS2_ENDIAN="-DCMS_USE_BIG_ENDIAN=$BIGENDIAN"
 else
   LCMS_ENDIAN=
   LCMS2_ENDIAN=
-  AC_MSG_RESULT(no)
 fi
 
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]