autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2-bigendian-action-if.patch


From: Alexandre Duret-Lutz
Subject: 2-bigendian-action-if.patch
Date: Sun, 12 Aug 2001 12:54:35 +0200

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,8 @@
+2001-08-11  Alexandre Duret-Lutz  <address@hidden>
+
+       * 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.
+

Index: NEWS
===================================================================
RCS file: /home/adl/CVSROOT/actmp/NEWS,v
retrieving revision 1.2
diff -u -r1.2 NEWS
--- NEWS        11 Aug 2001 20:31:36 -0000      1.2
+++ NEWS        11 Aug 2001 21:08:19 -0000
@@ -12,6 +12,10 @@
 - 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.
 
 * Major changes in Autoconf 2.52
 ** Documentation
Index: lib/autoconf/c.m4
===================================================================
RCS file: /home/adl/CVSROOT/actmp/lib/autoconf/c.m4,v
retrieving revision 1.2
diff -u -r1.2 c.m4
--- lib/autoconf/c.m4   11 Aug 2001 20:31:36 -0000      1.2
+++ lib/autoconf/c.m4   11 Aug 2001 21:03:33 -0000
@@ -828,8 +828,8 @@
 ])# 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 @@
 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
 
Index: doc/autoconf.texi
===================================================================
RCS file: /home/adl/CVSROOT/actmp/doc/autoconf.texi,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 autoconf.texi
--- doc/autoconf.texi   11 Aug 2001 19:12:58 -0000      1.1.1.1
+++ doc/autoconf.texi   11 Aug 2001 21:00:58 -0000
@@ -4486,14 +4486,26 @@
 @code{AC_TRY_COMPILE} (@pxref{Examining Syntax}) or @code{AC_TRY_RUN}
 (@pxref{Run Time})
 
address@hidden AC_C_BIGENDIAN
address@hidden 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}.
address@hidden 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
address@hidden
+
+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
address@hidden  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.
address@hidden defmac
 
 @defmac AC_C_CONST
 @maindex C_CONST



reply via email to

[Prev in Thread] Current Thread [Next in Thread]