Commit 2d6eb5bf by Zack Weinberg

aclocal.m4 (gcc_AC_EXAMINE_OBJECT): New utility macro which handles the gory…

aclocal.m4 (gcc_AC_EXAMINE_OBJECT): New utility macro which handles the gory details of converting an object file...

	* aclocal.m4 (gcc_AC_EXAMINE_OBJECT): New utility macro which
	handles the gory details of converting an object file into
	something that's safe to grep.
	(gcc_AC_C_COMPILE_BIGENDIAN): Rename to
	gcc_AC_C_COMPILE_ENDIAN.  Use gcc_AC_EXAMINE_OBJECT.  Put
	newlines at either end of the string we're looking for.
	Make 'checking ...' message less stilted.
	(gcc_AC_C_FLOAT_FORMAT): Use gcc_AC_EXAMINE_OBJECT.  Handle
	ARM in-memory layout and its hypothetical converse.  Don't
	define HOST_FLOAT_WORDS_BIG_ENDIAN unless it's different from
	HOST_WORDS_BIG_ENDIAN.

	* configure.in: Adjust for renamed macro.  Move
	gcc_AC_C_FLOAT_FORMAT below gcc_AC_C_COMPILE_ENDIAN.
	* configure, config.in: Regenerate.

From-SVN: r40562
parent d577781c
2001-03-16 Zack Weinberg <zackw@stanford.edu>
* aclocal.m4 (gcc_AC_EXAMINE_OBJECT): New utility macro which
handles the gory details of converting an object file into
something that's safe to grep.
(gcc_AC_C_COMPILE_BIGENDIAN): Rename to
gcc_AC_C_COMPILE_ENDIAN. Use gcc_AC_EXAMINE_OBJECT. Put
newlines at either end of the string we're looking for.
Make 'checking ...' message less stilted.
(gcc_AC_C_FLOAT_FORMAT): Use gcc_AC_EXAMINE_OBJECT. Handle
ARM in-memory layout and its hypothetical converse. Don't
define HOST_FLOAT_WORDS_BIG_ENDIAN unless it's different from
HOST_WORDS_BIG_ENDIAN.
* configure.in: Adjust for renamed macro. Move
gcc_AC_C_FLOAT_FORMAT below gcc_AC_C_COMPILE_ENDIAN.
* configure, config.in: Regenerate.
2001-03-16 Laurynas Biveinis <lauras@softhome.net> 2001-03-16 Laurynas Biveinis <lauras@softhome.net>
* fixinc/Makefile.in: Set SHELL. * fixinc/Makefile.in: Set SHELL.
...@@ -6,12 +24,12 @@ ...@@ -6,12 +24,12 @@
* fixinc/fixincl.c (fix_with_system): Quote file names before * fixinc/fixincl.c (fix_with_system): Quote file names before
passing them to shell. passing them to shell.
2001-03-16 Laurynas Biveinis <lauras@softhome.net> 2001-03-16 Laurynas Biveinis <lauras@softhome.net>
* Makefile.in: Use fix-header$(build_exeext) instead * Makefile.in: Use fix-header$(build_exeext) instead
of fix-header. of fix-header.
2001-03-16 Richard Henderson <rth@redhat.com> 2001-03-16 Richard Henderson <rth@redhat.com>
* dwarf2out.c: Revert most of 2000-11-25 and 2001-01-24 changes. * dwarf2out.c: Revert most of 2000-11-25 and 2001-01-24 changes.
...@@ -88,9 +106,9 @@ Fri Mar 16 14:47:57 CET 2001 Jan Hubicka <jh@suse.cz> ...@@ -88,9 +106,9 @@ Fri Mar 16 14:47:57 CET 2001 Jan Hubicka <jh@suse.cz>
2001-03-15 Steve Ellcey <sje@cup.hp.com> 2001-03-15 Steve Ellcey <sje@cup.hp.com>
* config.gcc (ia64*-*-hpux*): New case. * config.gcc (ia64*-*-hpux*): New case.
* config/ia64/hpux.h: New file for HP-UX support. * config/ia64/hpux.h: New file for HP-UX support.
* config/ia64/t-hpux: New file for HP-UX support. * config/ia64/t-hpux: New file for HP-UX support.
2001-03-16 Bruce Korb <bkorb@gnu.org>, Alexandre Oliva <aoliva@redhat.com> 2001-03-16 Bruce Korb <bkorb@gnu.org>, Alexandre Oliva <aoliva@redhat.com>
...@@ -240,7 +258,7 @@ Thu Mar 15 11:24:29 EST 2001 John Wehle (john@feith.com) ...@@ -240,7 +258,7 @@ Thu Mar 15 11:24:29 EST 2001 John Wehle (john@feith.com)
(rest_of_decl_compilation): Likewise. (rest_of_decl_compilation): Likewise.
* tree.c (simple_cst_equal): Likewise. * tree.c (simple_cst_equal): Likewise.
* objc/objc-act.c (generate_static_references): Likewise. * objc/objc-act.c (generate_static_references): Likewise.
2001-03-14 Zack Weinberg <zackw@stanford.edu> 2001-03-14 Zack Weinberg <zackw@stanford.edu>
* aclocal.m4 (gcc_AC_C_CHARSET, gcc_AC_C_COMPILE_BIGENDIAN, * aclocal.m4 (gcc_AC_C_CHARSET, gcc_AC_C_COMPILE_BIGENDIAN,
......
...@@ -1258,6 +1258,49 @@ elif test $ac_cv_c_charset = EBCDIC; then ...@@ -1258,6 +1258,49 @@ elif test $ac_cv_c_charset = EBCDIC; then
[Define if the host execution character set is EBCDIC.]) [Define if the host execution character set is EBCDIC.])
fi]) fi])
dnl Utility macro used by next two tests.
dnl AC_EXAMINE_OBJECT(C source code,
dnl commands examining object file,
dnl [commands to run if compile failed]):
dnl
dnl Compile the source code to an object file; then convert it into a
dnl printable representation. All unprintable characters and
dnl asterisks (*) are replaced by dots (.). All white space is
dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the
dnl output, but runs of newlines are compressed to a single newline.
dnl Finally, line breaks are forcibly inserted so that no line is
dnl longer than 80 columns and the file ends with a newline. The
dnl result of all this processing is in the file conftest.dmp, which
dnl may be examined by the commands in the second argument.
dnl
AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
[AC_LANG_SAVE
AC_LANG_C
dnl Next bit cribbed from AC_TRY_COMPILE.
cat > conftest.$ac_ext <<EOF
[#line __oline__ "configure"
#include "confdefs.h"
$1
]EOF
if AC_TRY_EVAL(ac_compile); then
od -c conftest.o |
sed ['s/^[0-7]*[ ]*//
s/\*/./g
s/ \\n/*/g
s/ [0-9][0-9][0-9]/./g
s/ \\[^ ]/./g'] |
tr -d '
' | tr -s '*' '
' | fold | sed '$a\
' > conftest.dmp
$2
ifelse($3, , , else
$3
)dnl
fi
rm -rf conftest*
AC_LANG_RESTORE])
dnl Host endianness probe. dnl Host endianness probe.
dnl This tests byte-within-word endianness. GCC actually needs dnl This tests byte-within-word endianness. GCC actually needs
dnl to know word-within-larger-object endianness. They are the dnl to know word-within-larger-object endianness. They are the
...@@ -1266,39 +1309,35 @@ dnl Differs from AC_C_BIGENDIAN in that it does not require ...@@ -1266,39 +1309,35 @@ dnl Differs from AC_C_BIGENDIAN in that it does not require
dnl running a program on the host, and it defines the macro we dnl running a program on the host, and it defines the macro we
dnl want to see. dnl want to see.
dnl dnl
AC_DEFUN([gcc_AC_C_COMPILE_BIGENDIAN], AC_DEFUN([gcc_AC_C_COMPILE_ENDIAN],
[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_compile_bigendian, [AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian,
[dnl The extra quote protects the [] in the structure definition. [ac_cv_c_compile_endian=unknown
cat >conftest.$ac_ext <<EOF gcc_AC_EXAMINE_OBJECT([
[#include "confdefs.h"
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> # include <limits.h>
#endif #endif
/* This structure must have no internal padding. */ /* This structure must have no internal padding. */
struct { struct {
char prefix[sizeof "endian::" - 1]; char prefix[sizeof "\nendian:" - 1];
short word; short word;
char postfix[2];
} tester = { } tester = {
"endian::", "\nendian:",
#if SIZEOF_SHORT == 4 #if SIZEOF_SHORT == 4
('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) | ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
#endif #endif
('A' << CHAR_BIT) | 'B' ('A' << CHAR_BIT) | 'B',
};] 'X', '\n'
EOF };],
ac_cv_c_compile_bigendian=unknown [if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
if AC_TRY_EVAL(ac_compile); then ac_cv_c_compile_endian=big-endian
if grep 'endian::AB' conftest.o >/dev/null 2>&1; then elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_compile_bigendian=yes ac_cv_c_compile_endian=little-endian
elif grep 'endian::BA' conftest.o >/dev/null 2>&1; then fi])
ac_cv_c_compile_bigendian=no ])
fi if test $ac_cv_c_compile_endian = unknown; then
fi
if test $ac_cv_c_compile_bigendian = unknown; then
AC_MSG_ERROR([*** unable to determine endianness]) AC_MSG_ERROR([*** unable to determine endianness])
fi elif test $ac_cv_c_compile_endian = big-endian; then
rm -rf conftest*])
if test $ac_cv_c_compile_bigendian = yes; then
AC_DEFINE(HOST_WORDS_BIG_ENDIAN, 1, AC_DEFINE(HOST_WORDS_BIG_ENDIAN, 1,
[Define if the host machine stores words of multi-word integers in [Define if the host machine stores words of multi-word integers in
big-endian order.]) big-endian order.])
...@@ -1319,10 +1358,7 @@ dnl as ASCII?) ...@@ -1319,10 +1358,7 @@ dnl as ASCII?)
dnl dnl
AC_DEFUN([gcc_AC_C_FLOAT_FORMAT], AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
[AC_CACHE_CHECK(floating point format, ac_cv_c_float_format, [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
[# [AC_TRY_COMPILE] will delete the object file before we get a [gcc_AC_EXAMINE_OBJECT(
# chance to look at it.
dnl The extra quote protects the [] instances in the code.
cat >conftest.$ac_ext <<EOF
[/* This will not work unless sizeof(double) == 8. */ [/* This will not work unless sizeof(double) == 8. */
extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1]; extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
...@@ -1333,7 +1369,7 @@ struct possibility { ...@@ -1333,7 +1369,7 @@ struct possibility {
char postfix[8]; char postfix[8];
}; };
#define C(cand) { "format::", cand, "::tamrof" } #define C(cand) { "\nformat:", cand, ":tamrof\n" }
struct possibility table [] = struct possibility table [] =
{ {
C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */ C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
...@@ -1341,35 +1377,43 @@ struct possibility table [] = ...@@ -1341,35 +1377,43 @@ struct possibility table [] =
C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */ C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */ C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */ C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */
};] };],
EOF [if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
if AC_TRY_EVAL(ac_compile); then ac_cv_c_float_format='IEEE (big-endian)'
if grep 'format::.@IEEEF.::tamrof' conftest.o >/dev/null 2>&1; then elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='IEEE (big-endian)' ac_cv_c_float_format='IEEE (big-endian)'
elif grep 'format::.FEEEI@.::tamrof' conftest.o >/dev/null 2>&1; then elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='IEEE (little-endian)' ac_cv_c_float_format='IEEE (little-endian)'
elif grep 'format::.__floa.::tamrof' conftest.o >/dev/null 2>&1; then elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='IEEE (little-endian)'
elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='VAX D-float' ac_cv_c_float_format='VAX D-float'
elif grep 'format::..PDP-1.::tamrof' conftest.o >/dev/null 2>&1; then elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='PDP-10' ac_cv_c_float_format='PDP-10'
elif grep 'format::.BMHEXF.::tamrof' conftest.o >/dev/null 2>&1; then elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
ac_cv_c_float_format='IBM 370 hex' ac_cv_c_float_format='IBM 370 hex'
else else
AC_MSG_ERROR(Unknown floating point format) AC_MSG_ERROR(Unknown floating point format)
fi fi],
else [AC_MSG_ERROR(compile failed)])
AC_MSG_ERROR(compile failed) ])
fi # IEEE is the default format. If the float endianness isn't the same
rm -rf conftest*]) # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
# (which is a tristate: yes, no, default). This is only an issue with
# IEEE; the other formats are only supported by a few machines each,
# all with the same endianness.
format= format=
bigend= fbigend=
case $ac_cv_c_float_format in case $ac_cv_c_float_format in
'IEEE (big-endian)' ) 'IEEE (big-endian)' )
# IEEE is the default, but define HOST_FLOAT_WORDS_BIG_ENDIAN if test $ac_cv_c_compile_endian = little-endian; then
# in case it's different from HOST_WORDS_BIG_ENDIAN. fbigend=1
bigend=yes fi
;; ;;
'IEEE (little-endian)' ) 'IEEE (little-endian)' )
if test $ac_cv_c_compile_endian = big-endian; then
fbigend=0
fi
;; ;;
'VAX D-float' ) 'VAX D-float' )
format=VAX_FLOAT_FORMAT format=VAX_FLOAT_FORMAT
...@@ -1385,12 +1429,13 @@ if test -n "$format"; then ...@@ -1385,12 +1429,13 @@ if test -n "$format"; then
AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format, AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
[Define to the floating point format of the host machine, if not IEEE.]) [Define to the floating point format of the host machine, if not IEEE.])
fi fi
if test -n "$bigend"; then if test -n "$fbigend"; then
AC_DEFINE(HOST_FLOAT_WORDS_BIG_ENDIAN, 1, AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
[Define to 1 if the host machine stores floating point numbers in [Define to 1 if the host machine stores floating point numbers in
memory with the word containing the sign bit at the lowest address. memory with the word containing the sign bit at the lowest address,
or to 0 if it does it the other way around.
This macro need not be defined if the ordering is the same as for This macro should not be defined if the ordering is the same as for
multi-word integers.]) multi-word integers.])
fi fi
]) ])
...@@ -320,16 +320,6 @@ ...@@ -320,16 +320,6 @@
/* Define if the host execution character set is EBCDIC. */ /* Define if the host execution character set is EBCDIC. */
#undef HOST_EBCDIC #undef HOST_EBCDIC
/* Define to the floating point format of the host machine, if not IEEE. */
#undef HOST_FLOAT_FORMAT
/* Define to 1 if the host machine stores floating point numbers in
memory with the word containing the sign bit at the lowest address.
This macro need not be defined if the ordering is the same as for
multi-word integers. */
#undef HOST_FLOAT_WORDS_BIG_ENDIAN
/* Always define this when using the GNU C Library */ /* Always define this when using the GNU C Library */
#undef _GNU_SOURCE #undef _GNU_SOURCE
...@@ -343,6 +333,17 @@ ...@@ -343,6 +333,17 @@
big-endian order. */ big-endian order. */
#undef HOST_WORDS_BIG_ENDIAN #undef HOST_WORDS_BIG_ENDIAN
/* Define to the floating point format of the host machine, if not IEEE. */
#undef HOST_FLOAT_FORMAT
/* Define to 1 if the host machine stores floating point numbers in
memory with the word containing the sign bit at the lowest address,
or to 0 if it does it the other way around.
This macro should not be defined if the ordering is the same as for
multi-word integers. */
#undef HOST_FLOAT_WORDS_BIG_ENDIAN
/* Define if you have a working <inttypes.h> header file. */ /* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
......
...@@ -379,7 +379,6 @@ if test $ac_cv_c___int64 = yes; then ...@@ -379,7 +379,6 @@ if test $ac_cv_c___int64 = yes; then
fi fi
gcc_AC_C_CHARSET gcc_AC_C_CHARSET
gcc_AC_C_FLOAT_FORMAT
# If the native compiler is GCC, we can enable warnings even in stage1. # If the native compiler is GCC, we can enable warnings even in stage1.
# That's useful for people building cross-compilers, or just running a # That's useful for people building cross-compilers, or just running a
...@@ -464,7 +463,8 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) ...@@ -464,7 +463,8 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
# These tests can't be done till we know if we have limits.h. # These tests can't be done till we know if we have limits.h.
gcc_AC_C_CHAR_BIT gcc_AC_C_CHAR_BIT
gcc_AC_C_COMPILE_BIGENDIAN gcc_AC_C_COMPILE_ENDIAN
gcc_AC_C_FLOAT_FORMAT
# See if GNAT has been installed # See if GNAT has been installed
AC_CHECK_PROG(have_gnat, gnatbind, yes, no) AC_CHECK_PROG(have_gnat, gnatbind, yes, no)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment