]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Limit AC_C_BIGENDIAN univeral checks to Mac OS X.
authorPeter O'Gorman <pogma@thewrittenword.com>
Fri, 22 Aug 2008 16:18:25 +0000 (18:18 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 22 Aug 2008 16:18:25 +0000 (18:18 +0200)
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Limit the check to
__APPLE_CC__ with possible -arch flags.
* NEWS: Document it.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
lib/autoconf/c.m4

index be2e04c7d0dc5e968542c198e3ba8c778eebb0af..5b45504047d319dfb44e512408babf095aeff749 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-22  Peter O'Gorman  <pogma@thewrittenword.com>
+
+       Limit AC_C_BIGENDIAN univeral checks to Mac OS X.
+       * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Limit the check to
+       __APPLE_CC__ with possible -arch flags.
+       * NEWS: Document it.
+
 2008-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * NEWS: Fix typo.
diff --git a/NEWS b/NEWS
index 7fe8dac9cda7a7e37c900085fd05e1c9439e1559..ffeaf8bc991fdb5e7757e911588b1b1d4060f4d6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ GNU Autoconf NEWS - User visible changes.
 
 * Major changes in Autoconf 2.62a (2008-??-??)
 
+** AC_C_BIGENDIAN does not mistakenly report "universal" for some
+   bigendian hosts, a regression introduced with universal binary
+   support in 2.62.
+
 ** AC_PATH_X now includes /lib64 and /usr/lib64 in its list of default
    library directories.
 
index ffaa06e39dff758a24618a8f6504b22103caefac..51fdfeba68fffe7f6f5638eaeef00149ed168282 100644 (file)
@@ -1399,24 +1399,34 @@ fi
 AC_DEFUN([AC_C_BIGENDIAN],
 [AH_VERBATIM([WORDS_BIGENDIAN],
 [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
-#if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-#elif ! defined __LITTLE_ENDIAN__
-# undef WORDS_BIGENDIAN
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
 #endif])dnl
  AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian],
    [ac_cv_c_bigendian=unknown
     m4_ifval(m4_ifdef([AH_HEADER], 1)[$4],
-      [# See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
+      [# See if we're dealing with a universal compiler.
        AC_COMPILE_IFELSE(
         [AC_LANG_SOURCE(
-           [[#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
-              neither is defined;
+           [[#ifndef __APPLE_CC__
+              not a universal capable compiler
             #endif
             typedef int dummy;
            ]])],
-        [ac_cv_c_bigendian=universal])],
+        [
+       # 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])],
       [AC_DIAGNOSE([obsolete], [AC_C_BIGENDIAN suggests AC_CONFIG_HEADERS])])
     if test $ac_cv_c_bigendian = unknown; then
       # See if sys/param.h defines the BYTE_ORDER macro.
@@ -1521,7 +1531,10 @@ AC_DEFUN([AC_C_BIGENDIAN],
    no)
      $2 ;; #(
    universal)
-     $4 ;; #(
+     m4_default([$4],
+       [AC_DEFINE([AC_APPLE_UNIVERSAL_BUILD],1,
+          [Define if building universal (internal helper macro)])])
+     ;; #(
    *)
      m4_default([$3],
        [AC_MSG_ERROR([unknown endianness