From c77822c1c35ac5443e21979f4f3c1a0e0e51676c Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Fri, 18 Jan 2002 18:58:19 +0000 Subject: [PATCH] Patched CheckForBigEndian for cross compilation - patch from Maciej Rozycki --- ChangeLog | 5 +++++ configure | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42cb72cd..2f8715aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-01-18 Frank Warmerdam + + * configure: Modify CheckForBigEndian so it can work in a cross + compiled situation. + 2002-01-16 Frank Warmerdam * tools/tiffdump.c: include TIFFTAG_JPEGTABLES in tag list. diff --git a/configure b/configure index 71d826b0..501fe6d0 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #!/bin/sh -# $Header: /cvs/maptools/cvsroot/libtiff/configure,v 1.21 2001-12-15 17:36:53 warmerda Exp $ +# $Header: /cvs/maptools/cvsroot/libtiff/configure,v 1.22 2002-01-18 18:58:19 warmerda Exp $ # # Tag Image File Format (TIFF) Software # @@ -152,7 +152,7 @@ do -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) - echo "This is TIFF configure $Revision: 1.21 $" + echo "This is TIFF configure $Revision: 1.22 $" exit 0 ;; -help|--help) usage; exit 0;; @@ -946,6 +946,21 @@ EOF CheckForBigEndian() { + cat>t.c< +#ifdef __BYTE_ORDER +#if __BYTE_ORDER == __LITTLE_ENDIAN +little; +#elif __BYTE_ORDER == __BIG_ENDIAN +big; +#endif +#endif +EOF + capture cat t.c + runMakeX t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep little >&5 && \ + return 1 + runMakeX t "t:; ${CCOMPILER} ${ENVOPTS} -E t.c" | grep big >&5 && \ + return 0 echo 'main() { int one = 1; char* cp = (char*)&one; exit(*cp!=0); }'>t.c capture cat t.c runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c" && ./a.out