From cf3c2aa0842187495ebe5f1bdb5f4f66c6ec3eff Mon Sep 17 00:00:00 2001 From: Marco Maggi Date: Thu, 18 Oct 2018 11:40:29 +0200 Subject: [PATCH] stopped using ac_c_bigendian_croos in favor of ac_c_bigendian --- expat/acinclude.m4 | 1 - expat/configure.ac | 10 ++- expat/conftools/ac_c_bigendian_cross.m4 | 81 ------------------------- 3 files changed, 7 insertions(+), 85 deletions(-) delete mode 100644 expat/conftools/ac_c_bigendian_cross.m4 diff --git a/expat/acinclude.m4 b/expat/acinclude.m4 index 130cc3ae..be1d5037 100644 --- a/expat/acinclude.m4 +++ b/expat/acinclude.m4 @@ -1,7 +1,6 @@ # acinclude.m4 -- # -m4_include(conftools/ac_c_bigendian_cross.m4) dnl m4_include(meta/autoconf/ax-check-compile-flag.m4) dnl m4_include(meta/autoconf/ax-gcc-version.m4) diff --git a/expat/configure.ac b/expat/configure.ac index ec0c05e8..33a6467b 100644 --- a/expat/configure.ac +++ b/expat/configure.ac @@ -102,9 +102,13 @@ AC_HEADER_STDC dnl Checks for typedefs, structures, and compiler characteristics. -dnl Note: Avoid using AC_C_BIGENDIAN because it does not -dnl work in a cross compile. -AC_C_BIGENDIAN_CROSS +dnl We define BYTEORDER to 1234 when the platform is little endian; it +dnl defines it to 4321 when the platform is big endian. +dnl +dnl A long time ago (early 2000 years) AC_C_BIGENDIAN was considered wrong +dnl when cross compiling, now (2018) we assume it is fine. +AC_C_BIGENDIAN([BYTEORDER=4321],[BYTEORDER=1234]) +AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST AC_TYPE_SIZE_T diff --git a/expat/conftools/ac_c_bigendian_cross.m4 b/expat/conftools/ac_c_bigendian_cross.m4 deleted file mode 100644 index 49ab6c45..00000000 --- a/expat/conftools/ac_c_bigendian_cross.m4 +++ /dev/null @@ -1,81 +0,0 @@ -dnl @synopsis AC_C_BIGENDIAN_CROSS -dnl -dnl Check endianness even when crosscompiling -dnl (partially based on the original AC_C_BIGENDIAN). -dnl -dnl The implementation will create a binary, and instead of running -dnl the binary it will be grep'ed for some symbols that will look -dnl different for different endianness of the binary. -dnl -dnl @version $Id: ac_c_bigendian_cross.m4,v 1.1 2001/07/24 19:51:35 fdrake Exp $ -dnl @author Guido Draheim -dnl -AC_DEFUN([AC_C_BIGENDIAN_CROSS], -[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, -[ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -AC_TRY_COMPILE([#include -#include ], [ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. -AC_TRY_COMPILE([#include -#include ], [ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) -if test $ac_cv_c_bigendian = unknown; then -AC_TRY_RUN([main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, -[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) -fi]) -if test $ac_cv_c_bigendian = unknown; then -AC_MSG_CHECKING(to probe for byte ordering) -[ -cat >conftest.c <&AC_FD_MSG - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG - fi - fi -AC_MSG_RESULT($ac_cv_c_bigendian) -fi -if test $ac_cv_c_bigendian = yes; then - AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) - BYTEORDER=4321 -else - BYTEORDER=1234 -fi -AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) -if test $ac_cv_c_bigendian = unknown; then - AC_MSG_ERROR(unknown endianness - sorry, please pre-set ac_cv_c_bigendian) -fi -])