(This issue caused OpenSSH to fail to configure properly on Darwin, so
it's not just a contrived example...)
Darwin's (g)cc driver has the ability to build for multiple
architectures simultaneously:
cc -arch i386 -arch ppc foo.c
This will invoke the compiler once for each architecture and create a
"fat" binary with both i386 and ppc sections. It returns a single exit
status, non-zero if either compile failed. Unfortunately, when the
aforementioned macro is used, it causes a compile-test to be issued like
this:
#if BYTE_ORDER == BIG_ENDIAN
big endian
#endif
Since the i386 side fails this #if test, it causes the entire cc to
fail, so WORDS_BIGENDIAN is not defined for either architecture.
I'm trying to figure out the best way to fix this. Is the
autoconf/configure mechanism just not suited to handle this form of
compilation? Should Darwin change its build system to run autoconf once
for each architecture?
thanks,
matt.