[krbdev.mit.edu #2551] Use __BIG_ENDIAN__ and __LITTLE_ENDIAN__ if available to detect endianness

Alexandra Ellwood via RT rt-comment at krbdev.mit.edu
Mon May 3 18:24:06 EDT 2004


The krb5 build system should (where it needs to know the endianness of the machine) prefer 
the compile-time variables __BIG_ENDIAN__ and __LITTLE_ENDIAN__ over the autoconf-
generated variables if they are available.  This will make cross-compilation to systems with 
different endianness possible (for compilers that provide these variables).

This is needed for Darwin i386 builds.  

Note that in the Darwin case, we need to check the compiler variables at compile time and 
not in an autoconf test.  With the Apple mach-o compiler, a single gcc invocation can build a 
fat object file with code for multiple architectures (ie: "CFLAGS=-arch pcc -arch i386").

We are referring to endianness in at least two places in the 1.3 sources:
src/lib/crypto/aes/aesopt.h
src/util/db2/include/db-int.h


More information about the krb5-bugs mailing list