[Speex-dev] [patch] Mac Universal Binaries

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Thu May 3 17:08:17 PDT 2007


> It is not that AC_C_BIGENDIAN does not work. It is that it determines
> endianness at configure-time as opposed to compile-time. The process
> for building universal binaries on Mac demands that the distinction be
> made at compile-time. To enable building universal binaries on Mac in
> a single pass, the decision has to be deferred to compile-time.

I don't quite see the major difference between doing things at configure
time or at compile time, bug anyway...

> My strong suspicion is that testing __BIG_ENDIAN__ at compile-time
> will work for all relevant unix-like platforms. Even icc supports
> this.

My suspicion is that I don't want to break things because MacOS X has
strange requirements.

> The extra thing we could do is set a preprocessor variable at
> configure-time that we could use at compile-time to determine whether
> the endianess was resolved at configure-time or should be resolved at
> compile-time. For example:
> 
> #if defined(COMPILE_TIME_ENDIANESS) && defined(__BIG_ENDIAN__) ||
> !defined(COMPILE_TIME_ENDIANESS) && defined(WORDS_BIGENDIAN)
> /* do big endian thing */
> #else
> /* do little endian thing */
> #endif
> 
> This seems excessively complicated, so I preferred not to do it.

Actually, all we need is to do is have that once in the main include:
#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
#define SPEEX_BIGENDIAN
#endif

and then we just use SPEEX_BIGENDIAN everywhere else.

	Jean-Marc


More information about the Speex-dev mailing list