diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2001-08-12 12:23:49 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2001-08-12 12:23:49 +0000 |
commit | a5b70717c189cfd517d492bc3ec37880613fd486 (patch) | |
tree | 914f062b2e662228624b18e3be1087d8c0cb1680 | |
parent | 6667f46047ac72968984d63b06ae1613334a1ca9 (diff) | |
download | autoconf-a5b70717c189cfd517d492bc3ec37880613fd486.tar.gz |
* 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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | doc/autoconf.texi | 18 | ||||
-rw-r--r-- | lib/autoconf/c.m4 | 18 |
4 files changed, 36 insertions, 11 deletions
@@ -1,5 +1,12 @@ 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 magic values from an object file when cross-compiling. Based on code by Guido Draheim <Guido.Draheim@gmx.de>. @@ -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 diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 57fca80f..71f15e58 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 7cd84d95..d8b131dc 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -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 |