From: Christian W. <cwa...@gm...> - 2005-05-15 15:52:36
|
Julien BLACHE wrote: > Christian Walther <cwa...@gm...> wrote: >> We should decide whether setting WORDS_BIGENDIAN should be done by >> configure or in the C code. At the moment, it is done in both places - >> in configure, as added by Romain as part of one of my Mac OS X > > It isn't, as your patch never made it to the repository. At least > configure.ac was not modified recently. It is: <http://svn.tilp.info/cgi-bin/viewcvs.cgi/libtifiles/trunk/ configure.ac?root=tilp&rev=1022&r1=964&r2=1022>. Romain just didn't mention it in the commit message. > The problem is that the traditional configure check is broken, and > will fail on some platforms. IIRC this check used to be in the > configure script, and I was defining WORDS_BIGENDIAN on Mac OS X from > the command line (because I didn't use the configure script in Project > Builder). > > Re-adding the configure check is probably the easiest way to solve the > problem. Then my change can be reverted. (the check is known to work > on the platforms we care for) Like this? Index: configure.ac =================================================================== --- configure.ac (revision 1064) +++ configure.ac (working copy) @@ -68,6 +68,9 @@ AC_TYPE_SIZE_T AC_STRUCT_TM +# Checks for architecture features. +AC_C_BIGENDIAN + # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_STAT @@ -79,8 +82,7 @@ case "$host" in *-*-*bsd*) ARCH="-D__BSD__" ;; *-*-mingw*) ARCH="-D__WIN32__ -D__MINGW32__" ;; - powerpc-*-linux-*) ARCH="-D__LINUX__ -DWORDS_BIGENDIAN" ;; - powerpc-apple-darwin*) ARCH="-D__MACOSX__ -DWORDS_BIGENDIAN" ;; + powerpc-apple-darwin*) ARCH="-D__MACOSX__" ;; *) ARCH="-D__LINUX__" ;; esac CFLAGS="$CFLAGS $ARCH" =================================================================== This works for me, but since I'm not familiar with autoconf, I'd rather ask before committing. Slightly off-topic: Is there a less-brute-force way of answering the question "In what revisions, if any, did configure.ac contain 'ENDIAN'?" than 'svn cat'ting and grepping every single revision? (I didn't do that, I just wondered...) -Christian |