This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: configury assembler features
On Mon, Apr 08, 2002 at 01:30:25PM -0400, DJ Delorie wrote:
>
> > Committed to mainline. Is this, and of course my previous patch,
> > http://gcc.gnu.org/ml/gcc-patches/2002-03/msg01748.html
> > suitable for 3.1 (and 3.0)?
>
> Ok for 3.1. I've lost track of the 3.0 branch status, but I don't
> have a problem with it for that either.
I think we ought to merge across these gas related patches to 3.0 too:
2001-10-30 Zack Weinberg <zack@codesourcery.com>
2001-10-29 Zack Weinberg <zack@codesourcery.com>
2001-10-16 Alan Modra <amodra@bigpond.net.au>
The first two are the as_ver change below, the last is the
gcc_cv_as_bfd_srcdir change.
gcc/ChangeLog
* configure.in (auto-build.h): Use target_alias and build_alias
when running configure.
(gcc_cv_as_bfd_srcdir): Define.
(gcc_cv_as): Use gcc_cv_as_bfd_srcdir to find gas version. Use
$target_alias in directory searchs rather than $target. Heed
program_prefix and program_transform_name. Search for gas in
cross-compiler case too. "test -x" rather than "test -f".
(gcc_cv_nm): Set for cross compilers too.
(gcc_cv_objdump): Define and use.
(as_ver): Cope with date string in as --version output.
* configure: Regenerate.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.483.2.31
diff -u -p -r1.483.2.31 configure.in
--- configure.in 5 Feb 2002 22:11:19 -0000 1.483.2.31
+++ configure.in 9 Apr 2002 01:41:09 -0000
@@ -793,7 +793,7 @@ else
*) realsrcdir=../${srcdir};;
esac
CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
- --target=$target --host=$build --build=$build
+ --target=$target_alias --host=$build_alias --build=$build_alias
# We just finished tests for the build machine, so rename
# the file auto-build.h in the gcc directory.
@@ -1096,6 +1096,7 @@ gcc_cv_as=
gcc_cv_gas_major_version=
gcc_cv_gas_minor_version=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
if test -x "$DEFAULT_ASSEMBLER"; then
gcc_cv_as="$DEFAULT_ASSEMBLER"
elif test -x "$AS"; then
@@ -1105,7 +1106,7 @@ elif test -x as$host_exeext; then
gcc_cv_as=./as$host_exeext
elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
# Single tree build which includes gas.
- for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
+ for f in $gcc_cv_as_bfd_srcdir/configure $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
do
changequote(,)dnl
gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
@@ -1120,8 +1121,7 @@ changequote(,)dnl
changequote([,])dnl
fi
-if test "x$gcc_cv_as" = x -a x$host = x$target; then
- # Native build.
+if test "x$gcc_cv_as" = x; then
# Search the same directories that the installed compiler will
# search. Else we may find the wrong assembler and lose. If we
# do not find a suitable assembler binary, then try the user's
@@ -1146,14 +1146,21 @@ if test "x$gcc_cv_as" = x -a x$host = x$
# If the loop below does not find an assembler, then use whatever
# one we can find in the users's path.
# user's path.
- gcc_cv_as=as$host_exeext
+ if test "x$program_prefix" != xNONE; then
+ gcc_cv_as=${program_prefix}as$host_exeext
+ else
+ gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
+ fi
- test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
- $test_prefix/lib/gcc-lib/$target \
- /usr/lib/gcc/$target/$gcc_version \
- /usr/lib/gcc/$target \
- $test_prefix/$target/bin/$target/$gcc_version \
- $test_prefix/$target/bin \
+ test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
+ $test_prefix/lib/gcc-lib/$target_alias \
+ /usr/lib/gcc/$target_alias/$gcc_version \
+ /usr/lib/gcc/$target_alias \
+ $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
+ $test_prefix/$target_alias/bin"
+
+ if test x$host = x$target; then
+ test_dirs="$test_dirs \
/usr/libexec \
/usr/ccs/gcc \
/usr/ccs/bin \
@@ -1164,9 +1171,10 @@ if test "x$gcc_cv_as" = x -a x$host = x$
/sysv/usr/lib/cmplrs/cc \
/svr4/usr/lib/cmplrs/cc \
/usr/bin"
+ fi
for dir in $test_dirs; do
- if test -f $dir/as$host_exeext; then
+ if test -x $dir/as$host_exeext; then
gcc_cv_as=$dir/as$host_exeext
break;
fi
@@ -1182,12 +1190,24 @@ fi
AC_MSG_CHECKING(what nm to use)
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
-elif test x$host = x$target; then
- # Native build.
- gcc_cv_nm=nm$host_exeext
+elif test "x$program_prefix" != xNONE; then
+ gcc_cv_nm=${program_prefix}nm$host_exeext
+else
+ gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
fi
AC_MSG_RESULT($gcc_cv_nm)
+# Figure out what objdump we will be using.
+AC_MSG_CHECKING(what objdump to use)
+if test -x objdump$host_exeext; then
+ gcc_cv_objdump=./objdump$host_exeext
+elif test "x$program_prefix" != xNONE; then
+ gcc_cv_objdump=${program_prefix}objdump$host_exeext
+else
+ gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext
+fi
+AC_MSG_RESULT($gcc_cv_objdump)
+
# Figure out what assembler alignment features are present.
AC_MSG_CHECKING(assembler alignment features)
gcc_cv_as_alignment_features=none
@@ -1329,7 +1349,7 @@ EOF
as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
if echo "$as_ver" | grep GNU > /dev/null; then
changequote(,)dnl
- as_ver=`echo $as_ver | sed -e 's,[^0-9]*,,' -e 's, .*,,'`
+ as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
as_major=`echo $as_ver | sed 's,\..*,,'`
as_minor=`echo $as_ver | sed 's,[^.]*\.\([0-9]*\).*,\1,'`
changequote([,])dnl
@@ -1406,7 +1426,7 @@ EOF
# If the assembler didn't choke, and we can objdump,
# and we got the correct data, then succeed.
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
- && objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
| tail -3 > conftest.got \
&& { cmp conftest.lit conftest.got > /dev/null 2>&1 \
|| cmp conftest.big conftest.got > /dev/null 2>&1; }