autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_C_BIGENDIAN vs. Darwin


From: Matt Watson
Subject: AC_C_BIGENDIAN vs. Darwin
Date: Sun, 24 Jun 2001 13:51:27 -0700

(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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]