]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (C Compiler): Warn that AC_C_BIGENDIAN
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Mar 2007 07:30:17 +0000 (07:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Mar 2007 07:30:17 +0000 (07:30 +0000)
suggests AC_CONFIG_HEADERS.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Warn if not using
AC_CONFIG_HEADERS.  Problem reported by
Peter O'Gorman.

ChangeLog
doc/autoconf.texi
lib/autoconf/c.m4

index 077cabd6023b1621df9a78e8e7b7ec14a34996c2..b74d8ba430a0e030a5dfe1e02ab1287274c31031 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc/autoconf.texi (C Compiler): Warn that AC_C_BIGENDIAN
+       suggests AC_CONFIG_HEADERS.
+       * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Warn if not using
+       AC_CONFIG_HEADERS.  Problem reported by
+       Peter O'Gorman.
+
 2007-02-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Fix typo "__LITLE_ENDIAN__".
index 5e421cc9daf0d4f9f01e0017737da59f227a4317..45697101d151431c5b8a926f562571ec14344949 100644 (file)
@@ -6486,6 +6486,11 @@ abort configure and tell the installer how to bypass this test.
 And finally, the default for @var{action-if-universal} is to define
 @samp{WORDS_BIGENDIAN} or not, depending on the architecture that the
 code is being generated for.
+
+If you use this macro without specifying @var{action-if-universal}, you
+should also use @code{AC_CONFIG_HEADERS}; otherwise
+@samp{WORDS_BIGENDIAN} may be set incorrectly for Mac OS X universal
+binary files.
 @end defmac
 
 @defmac AC_C_CONST
index f9105c042f6499305cbee74721a502ca0446abf5..a5b7348fd94f3c77494581db149ff082e2f8e953 100644 (file)
@@ -1,6 +1,6 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Programming languages support.
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -1381,15 +1381,17 @@ AC_DEFUN([AC_C_BIGENDIAN],
 #endif])dnl
  AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian],
    [ac_cv_c_bigendian=unknown
-    # See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
-    AC_COMPILE_IFELSE(
-      [AC_LANG_SOURCE(
-        [[#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
-           neither is defined;
-         #endif
-         typedef int dummy;
-        ]])],
-      [ac_cv_c_bigendian=universal])
+    m4_ifval(m4_ifdef([AH_HEADER], 1)[$4],
+      [# See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
+       AC_COMPILE_IFELSE(
+        [AC_LANG_SOURCE(
+           [[#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
+              neither is defined;
+            #endif
+            typedef int dummy;
+           ]])],
+        [ac_cv_c_bigendian=universal])],
+      [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.
       AC_COMPILE_IFELSE(