AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2007.10.23 08:38 "[Tiff] universal build patch", by Kai-Uwe Behrmann
2007.10.23 15:37 "Re: [Tiff] universal build patch", by Bob Friesenhahn
2007.10.23 15:50 "Re: [Tiff] universal build patch", by Andrey Kiselev
2007.10.23 16:12 "Re: [Tiff] universal build patch", by Bob Friesenhahn
2007.10.23 19:17 "Re: [Tiff] universal build patch", by Andrey Kiselev
2007.10.23 20:44 "Re: [Tiff] universal build patch", by Bob Friesenhahn
2007.10.24 07:19 "Re: [Tiff] universal build patch", by Andrey Kiselev
2007.10.24 08:32 "Re: [Tiff] universal build patch", by Kai-Uwe Behrmann
2007.10.24 11:26 "Re: [Tiff] universal build patch", by Andrey Kiselev
2007.10.24 15:44 "Re: [Tiff] universal build patch", by Bob Friesenhahn
2007.10.23 20:56 "Re: [Tiff] universal build patch", by Toby Thain

2007.10.23 16:12 "Re: [Tiff] universal build patch", by Bob Friesenhahn

We can easily switch to this method instead of autoconf macro. I am only concerning about portability of this approach.

It is 100% portable as long as you stick to using Apple's modified GCC 4.X and OS X. Other targets are of no consequence. :-)

Solaris defines _LITTLE_ENDIAN or _BIG_ENDIAN by including <sys/types.h>

OS X (and probably *BSD) define BIG_ENDIAN, LITTLE_ENDIAN and BYTE_ORDER but don't define __BIG_ENDIAN, __LITTLE_ENDIAN nor __BYTE_ORDER

Apple's gcc for ppc-darwin has a built-in define of __BIG_ENDIAN__ as 1, but doesn't define __LITTLE_ENDIAN__ nor __BYTE_ORDER.

Linux glibc headers define both BIG_ENDIAN and __BIG_ENDIAN, LITTLE_ENDIAN and __LITTLE_ENDIAN, and __BYTE_ORDER and BYTE_ORDER

System FOO does whatever it feels like.

My feeling is that it the only completely correct approach is to configure/build on each native target since otherwise some decisions made may be wrong. Perhaps 32-bit OS X has managed to constrain PPC and Intel differences to only endian order but this is the exception rather than the rule. With Mac OS X Leopard (Arriving October 26) perhaps the rules will change (the rules for Apple always change).

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/