* 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