]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Handle ACTION-IF-TRUE,
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 12 Aug 2001 12:23:49 +0000 (12:23 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 12 Aug 2001 12:23:49 +0000 (12:23 +0000)
ACTION-IF-FALSE, and ACTION-IF-UNKNOWN.
* doc/autoconf.texi (C Compiler Characteristics): Update
documentation for AC_C_BIGENDIAN.

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

index 618fae766fc73330dc162fa207444b386ebb21f9..1ba765d861c03e66d2e256b1444b4e98dc9ece6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-11  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Handle ACTION-IF-TRUE,
+       ACTION-IF-FALSE, and ACTION-IF-UNKNOWN.
+       * doc/autoconf.texi (C Compiler Characteristics): Update
+       documentation for AC_C_BIGENDIAN.
+
 2001-08-11  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Guess endianness by grep'ing
diff --git a/NEWS b/NEWS
index 933f8de35aed322de9c8c1976f9f9139e0c7313d..27fe117ed02a3e0b708eb46f4b300f386cef0b46 100644 (file)
--- a/NEWS
+++ b/NEWS
 - The top level $prefix is propagated to the AC_CONFIG_SUBDIRS configures.
 ** C Macros
 - AC_C_BIGENDIAN supports the cross-compiling case.
+- AC_C_BIGENDIAN accepts ACTION-IF-TRUE, ACTION-IF-FALSE, and
+  ACTION-IF-UNKNOWN arguments.  All are facultative, and the default
+  for ACTION-IF-TRUE is to define WORDS_BIGENDIAN like AC_C_BIGENDIAN
+  always did.
 \f
 * Major changes in Autoconf 2.52
 ** Documentation
index 57fca80f4f0510a0bb8beaf364902af64f3469d7..71f15e58cebc06e71e8f3a6330ca08efd2339482 100644 (file)
@@ -4486,14 +4486,26 @@ features.  To check for characteristics not listed here, use
 @code{AC_TRY_COMPILE} (@pxref{Examining Syntax}) or @code{AC_TRY_RUN}
 (@pxref{Run Time})
 
-@defmac AC_C_BIGENDIAN
+@defmac AC_C_BIGENDIAN (@ovar{action-if-true}, @ovar{action-if-false}, @ovar{action-if-unknown})
 @maindex C_BIGENDIAN
 @cvindex WORDS_BIGENDIAN
 @cindex Endianness
 If words are stored with the most significant byte first (like Motorola
-and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
-@end defmac
+and SPARC CPUs), execute @var{action-if-true}.  If words are stored with
+the less significant byte first (like Intel and VAX CPUs), execute
+@var{action-if-false}.
+
+This macro runs a test-case if endianness cannot be determined from the
+system header files.  When cross-compiling the test-case is not run but
+grep'ed for some magic values.  @var{action-if-unknown} is executed if
+the latter case fails to determine the byte sex of the host system.
 
+The default for @var{action-if-true} is to define
+@samp{WORDS_BIGENDIAN}.  The default for @var{action-if-false} is to do
+nothing.  And finally, the default for @var{action-if-unknown} is to
+abort configure and tell the installer which variable he should preset
+to bypass this test.
+@end defmac
 
 @defmac AC_C_CONST
 @maindex C_CONST
index 7cd84d95dfc9dd7406d576f78049079868c6d8a0..d8b131dc0f19523fa6d5460865a1863132af8b81 100644 (file)
@@ -828,8 +828,8 @@ fi
 ])# AC_C_LONG_DOUBLE
 
 
-# AC_C_BIGENDIAN
-# --------------
+# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
+# -------------------------------------------------------------------------
 AC_DEFUN([AC_C_BIGENDIAN],
 [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
 [# See if sys/param.h defines the BYTE_ORDER macro.
@@ -884,14 +884,16 @@ if test `grep -l LiTTleEnDian conftest.$ac_objext` ; then
 fi])])])])
 case $ac_cv_c_bigendian in
   yes)
-    AC_DEFINE(WORDS_BIGENDIAN, 1,
-             [Define if your processor stores words with the most significant
-              byte first (like Motorola and SPARC, unlike Intel and VAX).]);;
+    m4_default([$1],
+      [AC_DEFINE([WORDS_BIGENDIAN], 1,
+        [Define if your processor stores words with the most significant
+        byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;;
   no)
-    ;;
+    $2 ;;
   *)
-    AC_MSG_ERROR([unknown endianess
-presetting ac_cv_c_bigendian=no (or yes) will help]);;
+    m4_default([$3],
+      [AC_MSG_ERROR([unknown endianess
+presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
 esac
 ])# AC_C_BIGENDIAN