From d6169d90477a1b467545408f4ea9570ed4f36bf9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 26 Oct 2019 07:10:33 +0000 Subject: Simplify endianness test --- configure | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 189a047..13c460b 100755 --- a/configure +++ b/configure @@ -203,30 +203,14 @@ tryendianness () { #define _DEFAULT_SOURCE #endif #include <$i> -int a = 1 ; -EOF - if trybasic "$tmpc" ; then - cat > "$tmpc" < int a = LITTLE_ENDIAN ; int b = BIG_ENDIAN ; int c = BYTE_ORDER ; EOF - trybasic "$tmpc" || continue - for j in little big pdp ; do - k=`echo $j | tr a-z A-Z` - cat > "$tmpc" < "$tmpc" < int a[BYTE_ORDER == ${k}_ENDIAN ? 1 : -1] ; EOF - if trybasic "$tmpc" ; then - echo "endianness: $j" >> "$sysdeps/sysdeps" - echo " ... $j" - rm -f "$tmpc" - return - fi - done - rm -f "$tmpc" - fail "$0: error: unable to determine endianness according to $i" - fi + if trybasic "$tmpc" ; then + echo "endianness: $j" >> "$sysdeps/sysdeps" + echo " ... $j" + rm -f "$tmpc" + return + fi + done + rm -f "$tmpc" + fail "$0: error: unable to determine endianness according to $i" done rm -f "$tmpc" - fail "$0: error: unable to determine endianness: no endian.h found" + fail "$0: error: unable to determine endianness: no suitable endian.h found" } trysigned () { -- cgit v1.2.3