[1.5] Fix big endian checking with autotools
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 26 Mar 2014 15:25:37 +0000 (15:25 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 26 Mar 2014 15:25:37 +0000 (15:25 +0000)
Thanks to winfried for patch
Fixes issue 302

configure.ac

index 1bb9dee583c66530fdad1016f0d73ecc0c79d02a..71098e51ce6e3d9aec5b3b8b18b148b6feab8e77 100644 (file)
@@ -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])