+2008-12-26 Bruno Haible <bruno@clisp.org>
+
+ Improve multiarch detection.
+ * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Make detection of options
+ indicating a universal build more reliable.
+
2008-12-28 William Pursell <bill.pursell@gmail.com> (tiny change)
Use AS_CASE in documented example.
]])],
[
# Check for potential -arch flags. It is not universal unless
- # there are some -arch flags. Note that *ppc* also matches
- # ppc64. This check is also rather less than ideal.
- case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #(
- *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
- esac])
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done])
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
AC_COMPILE_IFELSE(