Commit 9f18db39 by Paolo Bonzini Committed by Paolo Bonzini

Alan Modra <amodra.bigpond.net.au>

2005-06-16  Paolo Bonzini  <bonzini@gnu.org>
            Daniel Jacobowitz  <dan@codesourcery.com>
	    Alan Modra <amodra.bigpond.net.au>

        * configure.ac (gcc_version): Set near the beginning.
        (as, ld, nm): Do not link in-tree tools.  Set gcc_cv_* if tools are
        found in the tree.  Use gcc_AC_PROG to find the tools in the system.
        (objdump): Do not look for it.
        * Makefile.in (NM_FOR_TARGET): Point to ./nm.
        (ORIGINAL_AS_FOR_TARGET, ORIGINAL_LD_FOR_TARGET,
        ORIGINAL_NM_FOR_TARGET): Substitute from autoconf.
        (as, ld, nm): New rules.
        (libgcc.mk): Depend on them.
        * aclocal.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL,
        gcc_AC_BUILD_EXEEXT): New.
        (gcc_AC_CHECK_PROG_VER): Use gcc_AC_BUILD_EXEEXT.
        * configure: Regenerate.

Co-Authored-By: Daniel Jacobowitz <dan@codesourcery.com>

From-SVN: r101084
parent 72095b64
2005-06-16 Paolo Bonzini <bonzini@gnu.org>
Daniel Jacobowitz <dan@codesourcery.com>
Alan Modra <amodra.bigpond.net.au>
* configure.ac (gcc_version): Set near the beginning.
(as, ld, nm): Do not link in-tree tools. Set gcc_cv_* if tools are
found in the tree. Use gcc_AC_PROG to find the tools in the system.
(objdump): Do not look for it.
* Makefile.in (NM_FOR_TARGET): Point to ./nm
(ORIGINAL_AS_FOR_TARGET, ORIGINAL_LD_FOR_TARGET,
ORIGINAL_NM_FOR_TARGET): Substitute from autoconf.
(as, ld, nm): New rules.
(libgcc.mk): Depend on them.
* aclocal.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL,
gcc_AC_BUILD_EXEEXT): New.
(gcc_AC_CHECK_PROG_VER): Use gcc_AC_BUILD_EXEEXT.
* configure: Regenerate.
2005-06-16 Jan Hubicka <jh@suse.cz>
* basic-block.h (rtl_bb_info): Break out head_, end_,
......@@ -3602,10 +3620,6 @@
2005-05-17 Paolo Bonzini <bonzini@gnu.org>
* tree-ssa-math-opts.c: New file.
2005-05-17 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Add tree-ssa-math-opts.c.
* expr.c (expand_expr_real_1) <case RDIV_EXPR>: Never emit as a*(1/b).
* fold-const.c (distribute_real_division): New.
......
......@@ -343,6 +343,7 @@ AR_FOR_TARGET := $(shell \
AR_FLAGS_FOR_TARGET =
AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@
RANLIB_FOR_TARGET := $(shell \
if [ -f $(objdir)/../binutils/ranlib ] ; then \
echo $(objdir)/../binutils/ranlib ; \
......@@ -353,18 +354,9 @@ RANLIB_FOR_TARGET := $(shell \
t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \
fi; \
fi)
NM_FOR_TARGET := $(shell \
if [ -f ./nm ] ; then \
echo ./nm ; \
elif [ -f $(objdir)/../binutils/nm-new ] ; then \
echo $(objdir)/../binutils/nm-new ; \
else \
if [ "$(host)" = "$(target)" ] ; then \
echo $(NM); \
else \
t='$(program_transform_name)'; echo nm | sed -e $$t ; \
fi; \
fi)
ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@
ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@
NM_FOR_TARGET = ./nm
# --------
# UNSORTED
......@@ -1207,6 +1199,49 @@ cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
# Create links to binutils, especially for in-tree builds, to make -B.
# use them. We need hard links so that directories can be shuffled
# during toplevel bootstrap.
# Go through an additional indirection, because the file we create
# can be either `sometool' (if it is a script) or `sometool$(exeext)'
# (if it is a hard link).
stamp-as: $(ORIGINAL_AS_FOR_TARGET)
@echo creating as; rm -f as; \
case "$<" in \
./*) ;; \
../*) \
echo $(LN) $< as$(exeext); \
$(LN) $< as$(exeext) || cp $< as$(exeext) ;; \
*) echo '#!$(SHELL)' > as; echo 'exec $< "$$@"' >> as ; \
chmod +x as ;; \
esac
echo timestamp > $@
stamp-collect-ld: $(ORIGINAL_LD_FOR_TARGET)
@echo creating collect-ld; rm -f collect-ld; \
case "$<" in \
./*) ;; \
../*) \
echo $(LN) $< collect-ld$(exeext); \
$(LN) $< collect-ld$(exeext) || cp $< collect-ld$(exeext) ;; \
*) echo '#!$(SHELL)' > collect-ld; echo 'exec $< "$$@"' >> collect-ld ; \
chmod +x collect-ld ;; \
esac
echo timestamp > $@
stamp-nm: $(ORIGINAL_NM_FOR_TARGET)
@echo creating nm; rm -f nm; \
case "$<" in \
./*) ;; \
../*) \
echo $(LN) $< nm$(exeext); \
$(LN) $< nm$(exeext) || cp $< nm$(exeext) ;; \
*) echo '#!$(SHELL)' > nm; echo 'exec $< "$$@"' >> nm ; \
chmod +x nm ;; \
esac
echo timestamp > $@
# Dump a specs file to make -B./ read these specs over installed ones.
$(SPECS): xgcc$(exeext)
$(GCC_FOR_TARGET) -dumpspecs > tmp-specs
......@@ -1245,7 +1280,8 @@ xlimits.h: glimits.h limitx.h limity.h
LIB2ADD = $(LIB2FUNCS_EXTRA)
LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext) specs
libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) specs \
xgcc$(exeext) stamp-as stamp-collect-ld stamp-nm
objext='$(objext)' \
LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
......@@ -4031,7 +4067,7 @@ bootstrap4 bootstrap4-lean: stage4_build
unstage1 unstage2 unstage3 unstage4 unstageprofile unstagefeedback:
-set -vx; stage=`echo $@ | sed -e 's/un//'`; \
rm -f $$stage/as$(exeext); \
rm -f $$stage/ld$(exeext); \
rm -f $$stage/nm$(exeext); \
rm -f $$stage/collect-ld$(exeext); \
if test -d $$stage; then \
mv $$stage/specs $(SPECS) 2>/dev/null || :; \
......
......@@ -329,7 +329,8 @@ dnl Locate a program and check that its version is acceptable.
dnl AC_PROG_CHECK_VER(var, name, version-switch,
dnl version-extract-regexp, version-glob)
AC_DEFUN([gcc_AC_CHECK_PROG_VER],
[AC_CHECK_PROG([$1], [$2], [$2])
[AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
AC_CHECK_PROG([$1], [$2], [$2])
if test -n "[$]$1"; then
# Found it, now check the version.
AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern,
......@@ -653,3 +654,78 @@ m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET
])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[
#endif
]))])
AC_DEFUN([gcc_AC_TOOL_DIRS], [
# When searching for the assembler or linker, search the same directories
# that the installed compiler will search. Else we may find the wrong
# assembler or linker and lose. If we do not find a suitable binary,
# then try the user's path.
#
# Also note we have to check MD_EXEC_PREFIX before checking the user's path.
if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
gcc_cv_tool_prefix=/usr/local
else
gcc_cv_tool_prefix=$prefix
fi
else
gcc_cv_tool_prefix=$exec_prefix
fi
if test x$host = x$build; then
gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR/usr/lib/gcc/$target_noncanonical/$gcc_version"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR/usr/lib/gcc/$target_noncanonical"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/$target_noncanonical/bin"
else
gcc_cv_tool_dirs=
fi
if test x$build = x$target; then
# Rummage through tm_files looking for MD_EXEC_PREFIX
md_dirs=
for f in ${tm_file_list}; do
if test -f $f; then
if grep '^#[ ]*undef[ ]*MD_EXEC_PREFIX' $f > /dev/null; then
md_dirs=
fi
md_dirs="$md_dirs "`sed -n -e 's@^#[ ]*define[ ]*MD_EXEC_PREFIX[ ]*"\(.*\)/"@\1@p' < $f`
fi
done
for f in ${md_dirs}; do
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$f"
done
fi])
dnl Make sure that build_exeext is looked for
AC_DEFUN([gcc_AC_BUILD_EXEEXT], [
ac_executable_extensions="$build_exeext"])
AC_DEFUN([gcc_AC_CHECK_TOOL], [
AC_REQUIRE([gcc_AC_TOOL_DIRS])
AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
dnl shut up useless "checking for..." messages
dnl we can still read them in config.log
exec AS_MESSAGE_FD([])>/dev/null
AC_PATH_PROGS($1, $2, , $gcc_cv_tool_dirs)
if test "x[$]$1" = x; then
# If the loop above did not find a tool, then use whatever
# one we can find in the users's path. We are looking for a
# ${build} -> ${target} tool.
if test "x$program_prefix" != xNONE; then
default_tool_name=${program_prefix}$2
elif test x$build != x$host && test x$build != x$target; then
default_tool_name=${target_noncanonical}-$2
else
default_tool_name=`echo $2 | sed "${program_transform_name}"`
fi
AC_PATH_PROGS($1, $default_tool_name,
$gcc_cv_tool_prefix/$default_tool_name$build_exeext)
fi
test "$silent" != yes && exec AS_MESSAGE_FD([])>&1
$3="[$]$1"
AC_SUBST($3)])
......@@ -30,6 +30,8 @@ AC_INIT
AC_CONFIG_SRCDIR(tree.c)
AC_CONFIG_HEADER(auto-host.h:config.in)
gcc_version=`cat $srcdir/BASE-VER`
# Determine the host, build, and target systems
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
......@@ -1739,7 +1741,6 @@ esac
# If build != host, and we aren't building gas in-tree, we identify a
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.
AC_MSG_CHECKING(what assembler to use)
in_tree_gas=no
gcc_cv_as=
gcc_cv_gas_major_version=
......@@ -1747,9 +1748,6 @@ gcc_cv_gas_minor_version=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
if test -x "$DEFAULT_ASSEMBLER"; then
gcc_cv_as="$DEFAULT_ASSEMBLER"
elif test -x as$build_exeext; then
# Build using assembler in the current directory.
gcc_cv_as=./as$build_exeext
elif test -f $gcc_cv_as_gas_srcdir/configure.in \
&& test -f ../gas/Makefile \
&& test x$build = x$host; then
......@@ -1758,8 +1756,7 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \
# we'll use what we're building after installation anyway.
in_tree_gas=yes
_gcc_COMPUTE_GAS_VERSION
rm -f as$build_exeext
$LN_S ../gas/as-new$build_exeext as$build_exeext 2>/dev/null
gcc_cv_as=../gas/as-new$build_exeext
in_tree_gas_is_elf=no
if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
|| (grep 'obj_format = multi' ../gas/Makefile \
......@@ -1768,79 +1765,17 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \
in_tree_gas_is_elf=yes
fi
m4_pattern_allow([AS_FOR_TARGET])dnl
elif test -x as$build_exeext; then
# Build using assembler in the current directory.
gcc_cv_as=./as$build_exeext
elif test -x "$AS_FOR_TARGET"; then
gcc_cv_as="$AS_FOR_TARGET"
elif test -x "$AS" && test x$host = x$target; then
gcc_cv_as="$AS"
fi
gcc_version=`cat $srcdir/BASE-VER`
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
# path.
#
# Also note we have to check MD_EXEC_PREFIX before checking the
# user's path. Unfortunately, there is no good way to get at the
# value of MD_EXEC_PREFIX here. So we do a brute force search
# through all the known MD_EXEC_PREFIX values. Ugh. This needs
# to be fixed as part of the make/configure rewrite too.
if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
else
test_prefix=$prefix
fi
else
test_prefix=$exec_prefix
fi
# If the loop below does not find an assembler, then use whatever
# one we can find in the users's path. We are looking for a
# ${build} -> ${target} assembler.
if test "x$program_prefix" != xNONE; then
gcc_cv_as=${program_prefix}as$build_exeext
elif test x$build != x$host && test x$build != x$target; then
gcc_cv_as=${target_noncanonical}-as$build_exeext
else
gcc_cv_as=`echo as | sed "${program_transform_name}"`$build_exeext
fi
if test x$host = x$build; then
test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \
$test_prefix/libexec/gcc/$target_noncanonical \
/usr/lib/gcc/$target_noncanonical/$gcc_version \
/usr/lib/gcc/$target_noncanonical \
$test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
$test_prefix/$target_noncanonical/bin"
else
test_dirs=
fi
if test x$build = x$target; then
test_dirs="$test_dirs \
/usr/libexec \
/usr/ccs/gcc \
/usr/ccs/bin \
/udk/usr/ccs/bin \
/bsd43/usr/lib/cmplrs/cc \
/usr/cross64/usr/bin \
/usr/lib/cmplrs/cc \
/sysv/usr/lib/cmplrs/cc \
/svr4/usr/lib/cmplrs/cc \
/usr/bin"
fi
for dir in $test_dirs; do
if test -x $dir/as$build_exeext; then
gcc_cv_as=$dir/as$build_exeext
break;
fi
done
fi
gcc_AC_CHECK_TOOL(gcc_cv_as, as, ORIGINAL_AS_FOR_TARGET)
AC_MSG_CHECKING(what assembler to use)
case $in_tree_gas in
yes)
AC_MSG_RESULT("newly built gas")
......@@ -1857,7 +1792,6 @@ esac
# If build != host, and we aren't building gas in-tree, we identify a
# build->target linker and hope that it will have the same features
# as the host->target linker we'll be using.
AC_MSG_CHECKING(what linker to use)
in_tree_ld=no
gcc_cv_ld=
gcc_cv_gld_major_version=
......@@ -1866,9 +1800,6 @@ gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
if test -x "$DEFAULT_LINKER"; then
gcc_cv_ld="$DEFAULT_LINKER"
elif test -x collect-ld$build_exeext; then
# Build using linker in the current directory.
gcc_cv_ld=./collect-ld$build_exeext
elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
&& test -f ../ld/Makefile \
&& test x$build = x$host; then
......@@ -1895,79 +1826,18 @@ changequote(,)dnl
gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
changequote([,])dnl
rm -f collect-ld$build_exeext
$LN_S ../ld/ld-new$build_exeext collect-ld$build_exeext 2>/dev/null
gcc_cv_ld=../ld/ld-new$build_exeext
elif test -x collect-ld$build_exeext; then
# Build using linker in the current directory.
gcc_cv_ld=./collect-ld$build_exeext
elif test -x "$LD_FOR_TARGET"; then
gcc_cv_ld="$LD_FOR_TARGET"
elif test -x "$LD" && test x$host = x$target; then
gcc_cv_ld="$LD"
fi
if test "x$gcc_cv_ld" = x; then
# Search the same directories that the installed compiler will
# search. Else we may find the wrong linker and lose. If we
# do not find a suitable linker binary, then try the user's
# path.
#
# Also note we have to check MD_EXEC_PREFIX before checking the
# user's path. Unfortunately, there is no good way to get at the
# value of MD_EXEC_PREFIX here. So we do a brute force search
# through all the known MD_EXEC_PREFIX values. Ugh. This needs
# to be fixed as part of the make/configure rewrite too.
if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
else
test_prefix=$prefix
fi
else
test_prefix=$exec_prefix
fi
# If the loop below does not find a linker, then use whatever
# one we can find in the users's path. We are looking for a
# ${build} -> ${target} linker.
if test "x$program_prefix" != xNONE; then
gcc_cv_ld=${program_prefix}ld$build_exeext
elif test x$build != x$host && test x$build != x$target; then
gcc_cv_ld=${target_noncanonical}-ld$build_exeext
else
gcc_cv_ld=`echo ld | sed "${program_transform_name}"`$build_exeext
fi
if test x$host = x$build; then
test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \
$test_prefix/libexec/gcc/$target_noncanonical \
/usr/lib/gcc/$target_noncanonical/$gcc_version \
/usr/lib/gcc/$target_noncanonical \
$test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
$test_prefix/$target_noncanonical/bin"
else
test_dirs=
fi
if test x$build = x$target; then
test_dirs="$test_dirs \
/usr/libexec \
/usr/ccs/gcc \
/usr/ccs/bin \
/udk/usr/ccs/bin \
/bsd43/usr/lib/cmplrs/cc \
/usr/cross64/usr/bin \
/usr/lib/cmplrs/cc \
/sysv/usr/lib/cmplrs/cc \
/svr4/usr/lib/cmplrs/cc \
/usr/bin"
fi
for dir in $test_dirs; do
if test -x $dir/ld$build_exeext; then
gcc_cv_ld=$dir/ld$build_exeext
break;
fi
done
fi
gcc_AC_CHECK_TOOL(gcc_cv_ld, ld, ORIGINAL_LD_FOR_TARGET)
AC_MSG_CHECKING(what linker to use)
case $in_tree_ld in
yes)
AC_MSG_RESULT("newly built ld")
......@@ -1979,24 +1849,19 @@ esac
# Figure out what nm we will be using.
gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
AC_MSG_CHECKING(what nm to use)
in_tree_nm=no
if test -x nm$build_exeext; then
gcc_cv_nm=./nm$build_exeext
elif test -f $gcc_cv_binutils_srcdir/configure.in \
gcc_cv_nm=
if test -f $gcc_cv_binutils_srcdir/configure.in \
&& test -f ../binutils/Makefile; then
# Single tree build which includes binutils.
in_tree_nm=yes
gcc_cv_nm=../binutils/nm-new$build_exeext
elif test -x nm$build_exeext; then
gcc_cv_nm=./nm$build_exeext
rm -f nm$build_exeext
$LN_S ../binutils/nm-new$build_exeext nm$build_exeext 2>/dev/null
elif test "x$program_prefix" != xNONE; then
gcc_cv_nm=${program_prefix}nm$build_exeext
elif test x$build != x$host && test x$build != x$target; then
gcc_cv_nm=${target_noncanonical}-nm$build_exeext
else
gcc_cv_nm=`echo nm | sed "${program_transform_name}"`$build_exeext
fi
gcc_AC_CHECK_TOOL(gcc_cv_nm, nm, ORIGINAL_NM_FOR_TARGET)
AC_MSG_CHECKING(what nm to use)
case $in_tree_nm in
yes) AC_MSG_RESULT("newly built nm") ;;
no) AC_MSG_RESULT($gcc_cv_nm) ;;
......@@ -2011,9 +1876,7 @@ elif test -f $gcc_cv_binutils_srcdir/configure.in \
&& test -f ../binutils/Makefile; then
# Single tree build which includes binutils.
in_tree_objdump=yes
gcc_cv_objdump=./objdump$build_exeext
rm -f objdump$build_exeext
$LN_S ../binutils/objdump$build_exeext objdump$build_exeext 2>/dev/null
gcc_cv_objdump=../binutils/objdump$build_exeext
elif test "x$program_prefix" != xNONE; then
gcc_cv_objdump=${program_prefix}objdump$build_exeext
elif test x$build != x$host && test x$build != x$target; then
......
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