From: Alexandre Duret-Lutz Date: Sun, 12 Aug 2001 12:23:49 +0000 (+0000) Subject: * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Handle ACTION-IF-TRUE, X-Git-Tag: AUTOCONF-2.52d~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5b70717c189cfd517d492bc3ec37880613fd486;p=thirdparty%2Fautoconf.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 618fae766..1ba765d86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-08-11 Alexandre Duret-Lutz + + * 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 * lib/autoconf/c.m4 (AC_C_BIGENDIAN): Guess endianness by grep'ing diff --git a/NEWS b/NEWS index 933f8de35..27fe117ed 100644 --- a/NEWS +++ b/NEWS @@ -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 57fca80f4..71f15e58c 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 7cd84d95d..d8b131dc0 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