From: Bruno Haible Date: Mon, 29 Dec 2008 23:19:31 +0000 (-0700) Subject: Improve multiarch detection. X-Git-Tag: v2.63b~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7c8c45b6ffb7dfb5baa56ba6f8995c85b90d4be;p=thirdparty%2Fautoconf.git Improve multiarch detection. * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Make detection of options indicating a universal build more reliable. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index f60e99afd..fe0fb5c6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-26 Bruno Haible + + 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 (tiny change) Use AS_CASE in documented example. diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index b728d80b5..beaf0b151 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1312,11 +1312,26 @@ AC_DEFUN([AC_C_BIGENDIAN], ]])], [ # 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(