URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [contrib/] [gcc_update] - Rev 265
Compare with Previous | Blame | View Log
#! /bin/sh## Update a local Subversion tree from the GCC repository, with an emphasis# on treating generated files correctly, so that autoconf, gperf et# al are not required for the ``end'' user.## (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, August 1998.## This script is Free Software, and it can be copied, distributed and# modified as defined in the GNU General Public License. A copy of# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html### By default all command-line options are passed to `svn update` in# addition to $UPDATE_OPTIONS (defined below). If the first parameter# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself# are omitted.## If the first parameter reads --patch, the second parameter is considered# a patch file.## If the first parameter is --touch, no svn operation will be performed,# only generated files that appear to be out of date in the local tree# will be touched.## If the first parameter is --list, a list of the generated files and# their dependencies will be printed; --help prints this message.## If the first parameter is --silent, this script prints nothing other# than error messages; the second parameter is then interpreted as above.## Examples:## contrib/gcc_update -r 8712# contrib/gcc_update --patch some-patch# contrib/gcc_update --touch# contrib/gcc_update --list# SVN commandGCC_SVN=${GCC_SVN-${SVN-svn}}# Default options used when updating via SVN (none).UPDATE_OPTIONS=""######## Anything below shouldn't be changed by regular users.# Arrange for the value of $0 to be available for functionsself=$0# This function prints its arguments to standard output unless# "silent" is set.unset silentchat () {if [ -z "$silent" ]; thenecho "$@"fi}# This function prints a list of all generated files, along with their# dependencies. Note that only one target is supported per line: the# colon is stripped from the output.files_and_dependencies () {sed -e 's/ *#.*//' -e '/^$/d' -e 's/://' <<\EOF# fixincludesfixincludes/configure: fixincludes/configure.ac fixincludes/aclocal.m4fixincludes/config.h.in: fixincludes/configure.ac fixincludes/aclocal.m4# intl libraryintl/plural.c: intl/plural.yintl/configure: intl/configure.ac intl/aclocal.m4intl/config.h.in: intl/configure.ac intl/aclocal.m4# Now, proceed to gcc automatically generated filesgcc/configure: gcc/configure.acgcc/cstamp-h.in: gcc/configure.acgcc/config.in: gcc/cstamp-h.ingcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.defgcc/config/arm/arm-tune.md: gcc/config/arm/arm-cores.def gcc/config/arm/gentune.sh# And then, language-specific filesgcc/cp/cfns.h: gcc/cp/cfns.gperfgcc/java/keyword.h: gcc/java/keyword.gperf# testsuite# Without this, _Pragma3.c can have a false negative.gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h# Similarly, without this, you will see:# direct2s.c:35: warning: current file is older than direct2.cgcc/testsuite/gcc.dg/cpp/direct2s.c: gcc/testsuite/gcc.dg/cpp/direct2.c# lto-pluginlto-plugin/configure: lto-plugin/configure.ac lto-plugin/aclocal.m4lto-plugin/Makefile.in: lto-plugin/Makefile.am lto-plugin/aclocal.m4# And libraries, at lastlibbanshee/configure: libbanshee/configure.aclibmudflap/configure: libmudflap/configure.aclibobjc/configure: libobjc/configure.aczlib/aclocal.m4: zlib/configure.ac zlib/acinclude.m4zlib/Makefile.in: zlib/Makefile.am zlib/configure.ac zlib/aclocal.m4zlib/configure: zlib/configure.ac zlib/aclocal.m4fastjar/aclocal.m4: fastjar/configure.acfastjar/Makefile.in: fastjar/Makefile.am fastjar/configure.ac fastjar/aclocal.m4fastjar/configure: fastjar/configure.ac fastjar/aclocal.m4boehm-gc/aclocal.m4: boehm-gc/configure.acboehm-gc/Makefile.in: boehm-gc/Makefile.am boehm-gc/configure.ac boehm-gc/aclocal.m4boehm-gc/configure: boehm-gc/configure.ac boehm-gc/aclocal.m4libada/configure: libada/configure.aclibffi/aclocal.m4: libffi/configure.ac libffi/acinclude.m4libffi/Makefile.in: libffi/Makefile.am libffi/configure.ac libffi/aclocal.m4libffi/configure: libffi/configure.ac libffi/aclocal.m4libffi/fficonfig.h.in: libffi/configure.ac libffi/aclocal.m4libgfortran/aclocal.m4: libgfortran/configure.ac libgfortran/acinclude.m4libgfortran/Makefile.in: libgfortran/Makefile.am libgfortran/configure.ac libgfortran/aclocal.m4libgfortran/configure: libgfortran/configure.ac libgfortran/aclocal.m4libjava/aclocal.m4: libjava/configure.aclibjava/Makefile.in: libjava/Makefile.am libjava/configure.ac libjava/aclocal.m4libjava/configure: libjava/configure.ac libjava/aclocal.m4libjava/libltdl/aclocal.m4: libjava/libltdl/configure.ac libjava/libltdl/acinclude.m4libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4libjava/libltdl/configure: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4libcpp/aclocal.m4: libcpp/configure.aclibcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4libgomp/testsuite/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4# Top levelMakefile.in: Makefile.tpl Makefile.defconfigure: configure.ac config/acx.m4EOF}# This function touches generated files such that the ``end'' user does# not have to rebuild them.touch_files () {rm -f Makefile.$$echo 'all: \' > Makefile.$$files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$echo '; @true' >> Makefile.$$files_and_dependencies | sed 's, ,: ,' >> Makefile.$$files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$echo ':' >> Makefile.$$echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$echo ' echo Touching $@...; \' >> Makefile.$$chat ' echo Touching $@... 1>&2; \' >> Makefile.$$echo ' touch $@' >> Makefile.$$files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$# We would have to explicitly shut off the "Entering... Leaving..."# messages through "--no-print-directory" to handle the case when# we were called from a recursive invocation (i.e. "$(MAKE)" in a# Makefile, not just make). Passing only "-s" doesn't help then,# because make has helpfully added "-w" to MAKEFLAGS automatically.# Unfortunately we do not require GNU make other than for building# and testing, so let's just grep known text explicitly echoed by# the rule.while ${MAKE-make} -s -f Makefile.$$ all | grep Touching > /dev/null; dosleep 1done 2>&1rm -f Makefile.$$}# Whenever we update the tree or install a patch, we may be modifying# this script. By re-execing it, we ensure that the appropriate# dependencies and rules will be used.touch_files_reexec () {chat "Adjusting file timestamps"exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch}# This functions applies a patch to an existing tree.apply_patch () {if [ -f "$1" ]; thenecho "Applying patch file $1"case $1 in*gz)gzip -d -c "$1" | patch -p1 ;;*bz2)bzip2 -d -c "$1" | patch -p1 ;;*)patch -p1 < "$1";;esacfitouch_files_reexec}# Check whether this indeed looks like a local tree.if [ ! -f gcc/version.c ]; thenecho "This does not seem to be a GCC tree!"exitficase "$1" in--silent)silent=tshift;;esaccase "$1" in# First of all, check whether we are going to process a patch.--patch)if test "$#" != 2; thenecho "$1" expects only one argument >&2exit 1fiapply_patch "${2}"exit $?;;--touch)if test "$#" != 1; thenecho "$1" does not expect any argument >&2exit 1fitouch_filesexit $?;;--list)if test "$#" != 1; thenecho "$1" does not expect any argument >&2exit 1fifiles_and_dependencies | sed 's/ /: /'exit $?;;--help)sed -e '1,2d' -e '/^UPDATE_OPTIONS=/{i\\p}' \-e '/^$/,$d' -e 's/#//' -e 's/^ //' < $0exit $?;;esac# Check whether this indeed looks like a local SVN tree.if [ ! -d .svn ]; thenecho "This does not seem to be a GCC SVN tree!"exitfi# Check command-line optionsif [ x"${1}"x = x"--nostdflags"x ]; thenshiftelseset -- $UPDATE_OPTIONS ${1+"$@"}fichat "Updating SVN tree"$GCC_SVN ${silent+-q} --non-interactive update ${1+"$@"}if [ $? -ne 0 ]; then(touch_files_reexec)echo "SVN update of full tree failed." >&2exit 1firm -f LAST_UPDATED gcc/REVISIONrevision=`svn info | awk '/Revision:/ { print $2 }'`branch=`svn info | sed -ne "/URL:/ {s,.*/trunk,trunk,s,.*/branches/,,s,.*/tags/,,p}"`{dateecho "`TZ=UTC date` (revision $revision)"} > LAST_UPDATEDecho "[$branch revision $revision]" > gcc/REVISIONtouch_files_reexec
