configure.ac: Allow tm_file to contain build-directory files.

gcc/
	* configure.ac: Allow tm_file to contain build-directory files.
	* configure: Regenerate.
	* config.gcc (m68k-*-uclinux*): Add ./sysroot-suffix.h to tm_file.
	* config/m68k/t-uclinux (sysroot-suffix.h): New target.
	* config/m68k/print-sysroot-suffix.sh: New file.

From-SVN: r122613
This commit is contained in:
Richard Sandiford 2007-03-06 09:06:35 +00:00 committed by Richard Sandiford
parent 4ab870f5c3
commit 3ca43df7e2
6 changed files with 108 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2007-03-06 Richard Sandiford <richard@codesourcery.com>
* configure.ac: Allow tm_file to contain build-directory files.
* configure: Regenerate.
* config.gcc (m68k-*-uclinux*): Add ./sysroot-suffix.h to tm_file.
* config/m68k/t-uclinux (sysroot-suffix.h): New target.
* config/m68k/print-sysroot-suffix.sh: New file.
2007-03-06 Richard Sandiford <richard@codesourcery.com>
* config/m68k/m68k.h (PIC_OFFSET_TABLE_REGNUM): Use the REGNO

View File

@ -1548,7 +1548,7 @@ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
# ABI.
default_m68k_cpu=68020
default_cf_cpu=5206
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h flat.h m68k/linux.h m68k/uclinux.h"
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
tm_defines="${tm_defines} MOTOROLA=1 USE_GAS UCLIBC_DEFAULT=1"
extra_options="${extra_options} linux.opt"
tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"

View File

@ -0,0 +1,82 @@
#!/bin/sh
# Copyright (C) 2006 Free Software Foundation, Inc.
# This file is part of GCC.
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston MA 02110-1301, USA.
# This script takes the following arguments:
#
# - the target sysroot
# - the value of $(MULTILIB_MATCHES)
# - the value of $(MULTILIB_OPTIONS)
#
# It uses these arguments to construct a definition of SYSROOT_SUFFIX_SPEC,
# which it prints to the standard output. For each multilib directory FOO,
# the script checks whether $sysroot has a subdirectory FOO, and if so will
# use /FOO for all compatible command-line options. It will not add a
# suffix for /FOO's options otherwise. These suffixes are concatenated,
# with one subspec for each space-separated entry in $(MULTILIB_OPTIONS).
set -e
sysroot=$1
matches=$2
options=$3
# For each multilib option OPT, add to $substs a sed command of the
# form "-e 's/OPT/OPT/'".
substs=""
for option in `echo "$options" | tr '/' ' '`
do
substs="$substs -e 's/$option/$option/g'"
done
# For each ALIAS=CANONICAL entry in $MULTILIB_MATCHES, look for sed
# arguments in $substs of the form "-e 's/CANONICAL/.../'". Replace
# such entries with "-e 's/CANONICAL/ALIAS|.../'". Both the ALIAS and
# CANONICAL parts of $MULTILIB_MATCHES use '?' to stand for '='.
#
# After this loop, a command of the form "echo FOO | eval sed $substs"
# will replace a canonical option FOO with a %{...}-style spec pattern.
for match in $matches
do
canonical=`echo "$match" | sed -e 's/=.*//' -e 's/?/=/g'`
alias=`echo "$match" | sed -e 's/.*=//' -e 's/?/=/g'`
substs=`echo "$substs" | sed -e "s,s/$canonical/,&$alias|,"`
done
# Build up the final SYSROOT_SUFFIX_SPEC in $spec.
spec=
for combo in $options
do
# See which option alternatives in $combo have their own sysroot
# directory. Create a subspec of the form "%{PAT1:/DIR1;...;PATn:DIRn}"
# from each such option OPTi, where DIRi is the directory associated
# with OPTi and PATi is the result of passing OPTi through $substs.
subspec=
for option in `echo "$combo" | tr '/' ' '`
do
dir=`echo "$option" | sed 's/cpu=//'`
if test -d "$sysroot/$dir"; then
test -z "$subspec" || subspec="$subspec;"
subspec="$subspec"`echo "$option" | eval sed $substs`":/$dir"
fi
done
# Concatenate all the subspecs.
test -z "$subspec" || spec="$spec%{$subspec}"
done
if test -n "$spec"; then
echo "#undef SYSROOT_SUFFIX_SPEC"
echo "#define SYSROOT_SUFFIX_SPEC \"$spec\""
fi

View File

@ -7,3 +7,10 @@ M68K_MLIB_CPU += && (MLIB == "68020" || !match(FLAGS, "FL_MMU"))
# Add multilibs for execute-in-place and shared-library code.
M68K_MLIB_OPTIONS += msep-data/mid-shared-library
M68K_MLIB_DIRNAMES += msep-data mid-shared-library
# This rule uses MULTILIB_MATCHES to generate a definition of
# SYSROOT_SUFFIX_SPEC.
sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
$(SHELL) $(srcdir)/config/m68k/print-sysroot-suffix.sh \
"$(SYSTEM_HEADER_DIR)/../.." "$(MULTILIB_MATCHES)" \
"$(MULTILIB_OPTIONS)" > $@

5
gcc/configure vendored
View File

@ -13027,6 +13027,11 @@ tm_file_list="options.h"
tm_include_list="options.h"
for f in $tm_file; do
case $f in
./* )
f=`echo $f | sed 's/^..//'`
tm_file_list="${tm_file_list} $f"
tm_include_list="${tm_include_list} $f"
;;
defaults.h )
tm_file_list="${tm_file_list} \$(srcdir)/$f"
tm_include_list="${tm_include_list} $f"

View File

@ -1610,6 +1610,11 @@ tm_file_list="options.h"
tm_include_list="options.h"
for f in $tm_file; do
case $f in
./* )
f=`echo $f | sed 's/^..//'`
tm_file_list="${tm_file_list} $f"
tm_include_list="${tm_include_list} $f"
;;
defaults.h )
tm_file_list="${tm_file_list} \$(srcdir)/$f"
tm_include_list="${tm_include_list} $f"