From 8c71728242904c3097d2589bd5bc1217026c8666 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Wed, 26 Mar 2014 15:25:37 +0000 Subject: [PATCH] [1.5] Fix big endian checking with autotools Thanks to winfried for patch Fixes issue 302 --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1bb9dee5..71098e51 100644 --- a/configure.ac +++ b/configure.ac @@ -465,8 +465,14 @@ AC_HEADER_DIRENT ### Checks for compiler characteristics AM_PROG_CC_C_O -AC_C_BIGENDIAN - +ac_cv_c_big_endian=0 +AC_C_BIGENDIAN([ac_cv_c_big_endian=yes], [ac_cv_c_big_endian=no],[]) +# +if test "x${ac_cv_c_big_endian}" = "xyes" ; then + AC_DEFINE(OPJ_BIG_ENDIAN, [1], [define to 1 if your machine has BE]) + AC_DEFINE(WORDS_BIGENDIAN, [1], [define to 1 if your machine has BE]) +fi +# #OPJ_COMPILER_FLAG([-Wall]) #OPJ_COMPILER_FLAG([-Wextra]) #OPJ_COMPILER_FLAG([-Wshadow])