1998-08-11 16:38:09 +08:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2000-04-28 09:23:47 +08:00
|
|
|
# Update a local CVS tree from the GCC repository, with an emphasis
|
2000-11-22 21:11:44 +08:00
|
|
|
# on treating generated files correctly, so that autoconf, gperf et
|
1998-08-11 16:38:09 +08:00
|
|
|
# al are not required for the ``end'' user.
|
|
|
|
#
|
1998-08-11 17:04:53 +08:00
|
|
|
# By default all command-line options are passed to `cvs update` in
|
|
|
|
# addition to $UPDATE_OPTIONS (defined below). If the first parameter
|
|
|
|
# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself
|
2000-09-16 20:14:12 +08:00
|
|
|
# are omitted.
|
|
|
|
#
|
1999-07-05 18:22:15 +08:00
|
|
|
# If the first parameter reads --patch, the second parameter is considered
|
|
|
|
# a patch file.
|
2000-09-16 20:14:12 +08:00
|
|
|
#
|
1999-07-27 21:26:37 +08:00
|
|
|
# If the first parameter is --touch, no cvs 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.
|
|
|
|
#
|
2005-03-18 19:47:28 +08:00
|
|
|
# If the first parameter is --silent, this script prints nothing other
|
|
|
|
# than error messages; the second parameter is then interpreted as above.
|
|
|
|
#
|
1998-08-11 17:04:53 +08:00
|
|
|
# Examples:
|
|
|
|
#
|
2000-04-28 09:23:47 +08:00
|
|
|
# contrib/gcc_update -r gcc_latest_snapshot
|
|
|
|
# contrib/gcc_update -A
|
|
|
|
# contrib/gcc_update --nostdflags -P -r gcc-2_95-branch gcc/testsuite
|
|
|
|
# contrib/gcc_update --patch some-patch
|
|
|
|
# contrib/gcc_update --touch
|
|
|
|
# contrib/gcc_update --list
|
1998-08-11 17:04:53 +08:00
|
|
|
#
|
1998-08-12 19:02:37 +08:00
|
|
|
#
|
2005-03-18 19:47:28 +08:00
|
|
|
# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
|
1998-08-12 19:02:37 +08:00
|
|
|
# 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
|
|
|
|
|
1998-08-11 16:38:09 +08:00
|
|
|
|
2003-03-04 04:09:38 +08:00
|
|
|
# CVS command
|
|
|
|
GCC_CVS=${GCC_CVS-${CVS-cvs}}
|
1999-07-05 18:22:15 +08:00
|
|
|
# Default options used when updating via CVS.
|
2001-05-23 20:15:03 +08:00
|
|
|
UPDATE_OPTIONS=-Pd
|
|
|
|
# Use -P to prune empty directories.
|
|
|
|
# Use -d to create any directories that exist in the repository but not
|
|
|
|
# locally.
|
|
|
|
# Use -A to reset any sticky tags, dates, or `-k' options.
|
|
|
|
|
|
|
|
######## Anything below shouldn't be changed by regular users.
|
1998-08-11 16:38:09 +08:00
|
|
|
|
2000-05-18 12:19:35 +08:00
|
|
|
# Arrange for the value of $0 to be available for functions
|
|
|
|
self=$0
|
1998-08-11 16:38:09 +08:00
|
|
|
|
2005-03-18 19:47:28 +08:00
|
|
|
# This function prints its arguments to standard output unless
|
|
|
|
# "silent" is set.
|
|
|
|
silent=
|
|
|
|
chat () {
|
|
|
|
if [ -z "$silent" ]; then
|
|
|
|
echo "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1999-07-27 21:26:37 +08:00
|
|
|
# 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
|
2004-08-31 17:27:00 +08:00
|
|
|
# fixincludes
|
|
|
|
fixincludes/configure: fixincludes/configure.ac fixincludes/aclocal.m4
|
|
|
|
fixincludes/config.h.in: fixincludes/configure.ac fixincludes/aclocal.m4
|
intl: New directory; see intl/ChangeLog for details.
top:
* intl: New directory; see intl/ChangeLog for details.
* ABOUT-NLS, config.rpath: Import from gettext 0.12.1.
* Makefile.tpl: all-gcc depends on maybe-all-intl.
* Makefile.in: Regenerate.
config:
* gettext.m4: New file - copy of gettext.m4 from binutils
CVS, with added AC_ISC_POSIX macro from gcc/aclocal.m4.
gcc:
* ABOUT-NLS: Delete.
* intl: Delete entire directory.
* aclocal.m4: Include ../config/gettext.m4. Delete
AC_ISC_POSIX, AM_LANGINFO_CODESET, jm_GLIBC21, AM_LC_MESSAGES,
AM_PATH_PROG_WITH_TEST, AM_WITH_NLS, and AM_GNU_GETTEXT.
* configure.in: Use CY_GNU_GETTEXT, not AM_GNU_GETTEXT.
Remove intl/Makefile from all_outputs.
* configure, config.in: Regenerate.
* Makefile.in: Expunge all references to intl subdirectory.
Add -I../intl to INCLUDES.
* intl.h: Include libintl.h if and only if ENABLE_NLS is defined.
intl:
* Makefile.in: Remove unnecessary capabilities for
installation, build of shared libraries, generation of
distribution tarballs, etc. Fix all the places that rely on
the parent directory. Don't generate libgnuintl.h from
anything; do generate $(objdir)/libintl.h from libgnuintl.h if
necessary. Adjust DEFS for use of config.h.
* libgnuintl.h.in: Rename libgnuintl.h.
* README: New file.
* config.charset, ref-add.sin, ref-del.sin: Delete (unused).
* COPYING.LIB-2.0, COPYING.LIB-2.1: Delete (redundant).
* aclocal.m4: New; generated per instructions in gettext manual.
* configure.in: New; written from scratch for this configuration.
* configure, config.h.in: Generated.
contrib:
* gcc_update: Remove gcc/intl/plural.c from list.
Add new generated files intl/plural.c, intl/configure,
intl/config.h.in.
From-SVN: r68928
2003-07-05 02:18:54 +08:00
|
|
|
# intl library
|
|
|
|
intl/plural.c: intl/plural.y
|
2004-03-01 05:13:41 +08:00
|
|
|
intl/configure: intl/configure.ac intl/aclocal.m4
|
|
|
|
intl/config.h.in: intl/configure.ac intl/aclocal.m4
|
1999-07-27 21:26:37 +08:00
|
|
|
# Now, proceed to gcc automatically generated files
|
2004-01-04 03:55:35 +08:00
|
|
|
gcc/configure: gcc/configure.ac
|
|
|
|
gcc/cstamp-h.in: gcc/configure.ac
|
1999-07-29 01:52:02 +08:00
|
|
|
gcc/config.in: gcc/cstamp-h.in
|
1999-07-27 21:26:37 +08:00
|
|
|
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
|
2004-08-03 21:35:47 +08:00
|
|
|
gcc/config/arm/arm-tune.md: gcc/config/arm/arm-cores.def gcc/config/arm/gentune.sh
|
1999-07-27 21:26:37 +08:00
|
|
|
# And then, language-specific files
|
2003-01-03 14:05:11 +08:00
|
|
|
gcc/cp/cfns.h: gcc/cp/cfns.gperf
|
|
|
|
gcc/java/keyword.h: gcc/java/keyword.gperf
|
2003-06-24 09:32:33 +08:00
|
|
|
# testsuite
|
|
|
|
# Without this, _Pragma3.c can have a false negative.
|
|
|
|
gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h
|
1999-07-27 21:26:37 +08:00
|
|
|
# And libraries, at last
|
2004-05-30 03:51:26 +08:00
|
|
|
libbanshee/configure: libbanshee/configure.ac
|
2004-06-15 22:59:58 +08:00
|
|
|
libmudflap/configure: libmudflap/configure.ac
|
2004-04-09 21:13:09 +08:00
|
|
|
libobjc/configure: libobjc/configure.ac
|
2004-04-12 19:03:16 +08:00
|
|
|
zlib/aclocal.m4: zlib/configure.ac zlib/acinclude.m4
|
|
|
|
zlib/Makefile.in: zlib/Makefile.am zlib/configure.ac zlib/aclocal.m4
|
|
|
|
zlib/configure: zlib/configure.ac zlib/aclocal.m4
|
2004-01-10 10:12:41 +08:00
|
|
|
fastjar/aclocal.m4: fastjar/configure.ac
|
|
|
|
fastjar/Makefile.in: fastjar/Makefile.am fastjar/configure.ac fastjar/aclocal.m4
|
|
|
|
fastjar/configure: fastjar/configure.ac fastjar/aclocal.m4
|
2004-11-05 12:11:44 +08:00
|
|
|
boehm-gc/aclocal.m4: boehm-gc/configure.ac
|
2004-06-16 19:58:44 +08:00
|
|
|
boehm-gc/Makefile.in: boehm-gc/Makefile.am boehm-gc/configure.ac boehm-gc/aclocal.m4
|
2004-06-16 15:35:00 +08:00
|
|
|
boehm-gc/configure: boehm-gc/configure.ac boehm-gc/aclocal.m4
|
2004-03-11 10:24:53 +08:00
|
|
|
libada/configure: libada/configure.ac
|
2004-03-17 03:19:19 +08:00
|
|
|
libffi/aclocal.m4: libffi/configure.ac libffi/acinclude.m4
|
|
|
|
libffi/Makefile.in: libffi/Makefile.am libffi/configure.ac libffi/aclocal.m4
|
|
|
|
libffi/configure: libffi/configure.ac libffi/aclocal.m4
|
|
|
|
libffi/fficonfig.h.in: libffi/configure.ac libffi/aclocal.m4
|
2004-06-10 12:50:45 +08:00
|
|
|
libgfortran/aclocal.m4: libgfortran/configure.ac libgfortran/acinclude.m4
|
|
|
|
libgfortran/Makefile.in: libgfortran/Makefile.am libgfortran/configure.ac libgfortran/aclocal.m4
|
|
|
|
libgfortran/configure: libgfortran/configure.ac libgfortran/aclocal.m4
|
2004-08-21 00:17:35 +08:00
|
|
|
libjava/aclocal.m4: libjava/configure.ac libjava/acinclude.m4
|
|
|
|
libjava/Makefile.in: libjava/Makefile.am libjava/configure.ac libjava/aclocal.m4
|
|
|
|
libjava/configure: libjava/configure.ac libjava/aclocal.m4
|
2003-12-17 14:22:00 +08:00
|
|
|
libjava/libltdl/aclocal.m4: libjava/libltdl/configure.ac libjava/libltdl/acinclude.m4
|
|
|
|
libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
|
|
|
libjava/libltdl/configure: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
2003-12-19 13:50:14 +08:00
|
|
|
libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
2004-06-14 21:53:45 +08:00
|
|
|
libcpp/aclocal.m4: libcpp/configure.ac
|
2004-08-25 17:07:43 +08:00
|
|
|
libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
|
2004-06-14 21:53:45 +08:00
|
|
|
libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
|
2002-09-25 06:51:57 +08:00
|
|
|
# Top level
|
|
|
|
Makefile.in: Makefile.tpl Makefile.def
|
2002-12-29 00:24:33 +08:00
|
|
|
configure: configure.in config/acx.m4
|
1999-07-27 21:26:37 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-05 18:22:15 +08:00
|
|
|
# This function touches generated files such that the ``end'' user does
|
|
|
|
# not have to rebuild them.
|
1999-07-27 21:26:37 +08:00
|
|
|
touch_files () {
|
2001-05-15 03:57:52 +08:00
|
|
|
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.$$
|
2002-04-18 18:09:10 +08:00
|
|
|
echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$
|
2001-05-15 03:57:52 +08:00
|
|
|
echo ' echo Touching $@...; \' >> Makefile.$$
|
2005-03-18 19:47:28 +08:00
|
|
|
chat ' echo Touching $@... 1>&2; \' >> Makefile.$$
|
2001-05-15 03:57:52 +08:00
|
|
|
echo ' touch $@' >> Makefile.$$
|
|
|
|
files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$
|
2004-11-14 14:31:00 +08:00
|
|
|
|
2004-11-20 18:49:16 +08:00
|
|
|
# We would have to explicitly shut off the "Entering... Leaving..."
|
2004-11-14 14:31:00 +08:00
|
|
|
# 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.
|
2004-11-20 18:49:16 +08:00
|
|
|
# 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; do
|
2001-05-15 03:57:52 +08:00
|
|
|
sleep 1
|
|
|
|
done 2>&1
|
|
|
|
rm -f Makefile.$$
|
1999-07-05 18:22:15 +08:00
|
|
|
}
|
|
|
|
|
2001-05-15 03:57:52 +08:00
|
|
|
|
2000-05-13 04:18:49 +08:00
|
|
|
# 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 () {
|
2005-03-18 19:47:28 +08:00
|
|
|
chat "Adjusting file timestamps"
|
|
|
|
exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch
|
2000-09-16 20:14:12 +08:00
|
|
|
}
|
1999-07-05 18:22:15 +08:00
|
|
|
|
|
|
|
# This functions applies a patch to an existing tree.
|
1999-07-27 21:26:37 +08:00
|
|
|
apply_patch () {
|
1999-07-05 18:22:15 +08:00
|
|
|
if [ -f $1 ]; then
|
|
|
|
echo "Applying patch file $1"
|
|
|
|
case "$1" in
|
|
|
|
*gz)
|
|
|
|
gzip -d -c $1 | patch -p1 ;;
|
1999-11-28 15:41:09 +08:00
|
|
|
*bz2)
|
|
|
|
bzip2 -d -c $1 | patch -p1 ;;
|
1999-07-05 18:22:15 +08:00
|
|
|
*)
|
|
|
|
cat $1 | patch -p1 ;;
|
|
|
|
esac
|
|
|
|
fi
|
2000-05-13 04:18:49 +08:00
|
|
|
touch_files_reexec
|
1999-07-05 18:22:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Check whether this indeed looks like a local tree.
|
|
|
|
if [ ! -f gcc/version.c ]; then
|
2000-04-28 09:23:47 +08:00
|
|
|
echo "This does not seem to be a GCC tree!"
|
1999-07-05 18:22:15 +08:00
|
|
|
exit
|
1998-08-11 16:38:09 +08:00
|
|
|
fi
|
|
|
|
|
2005-03-18 19:47:28 +08:00
|
|
|
case "$1" in
|
|
|
|
--silent)
|
|
|
|
silent=t
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1999-07-27 21:26:37 +08:00
|
|
|
case "$1" in
|
1999-07-05 18:22:15 +08:00
|
|
|
# First of all, check whether we are going to process a patch.
|
2000-09-16 20:14:12 +08:00
|
|
|
--patch)
|
1999-07-27 21:26:37 +08:00
|
|
|
if test "$#" != 2; then
|
|
|
|
echo "$1" expects only one argument >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
apply_patch "${2}"
|
|
|
|
exit $?
|
|
|
|
;;
|
|
|
|
|
|
|
|
--touch)
|
|
|
|
if test "$#" != 1; then
|
|
|
|
echo "$1" does not expect any argument >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
touch_files
|
|
|
|
exit $?
|
|
|
|
;;
|
|
|
|
|
|
|
|
--list)
|
|
|
|
if test "$#" != 1; then
|
|
|
|
echo "$1" does not expect any argument >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
files_and_dependencies | sed 's/ /: /'
|
|
|
|
exit $?
|
|
|
|
;;
|
|
|
|
|
|
|
|
--help)
|
|
|
|
sed -e '1,2d' -e '/^UPDATE_OPTIONS=/{i\
|
|
|
|
\
|
|
|
|
|
|
|
|
p
|
|
|
|
}' \
|
|
|
|
-e '/^$/,$d' -e 's/#//' -e 's/^ //' < $0
|
|
|
|
exit $?
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
1999-07-05 18:22:15 +08:00
|
|
|
|
|
|
|
# Check whether this indeed looks like a local CVS tree.
|
|
|
|
if [ ! -d CVS ]; then
|
2000-04-28 09:23:47 +08:00
|
|
|
echo "This does not seem to be a GCC CVS tree!"
|
1999-07-05 18:22:15 +08:00
|
|
|
exit
|
|
|
|
fi
|
1998-08-11 17:04:53 +08:00
|
|
|
|
1999-07-05 18:22:15 +08:00
|
|
|
# Check command-line options
|
1998-08-11 17:04:53 +08:00
|
|
|
if [ x"${1}"x = x"--nostdflags"x ]; then
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
set -- $UPDATE_OPTIONS ${1+"$@"}
|
|
|
|
fi
|
|
|
|
|
2005-03-18 19:47:28 +08:00
|
|
|
chat "Updating CVS tree"
|
|
|
|
|
|
|
|
$GCC_CVS -q ${silent+-Q} update ${1+"$@"}
|
2000-09-16 20:14:12 +08:00
|
|
|
if [ $? -ne 0 ]; then
|
2000-08-31 05:56:42 +08:00
|
|
|
(touch_files_reexec)
|
1999-02-04 16:07:51 +08:00
|
|
|
echo "CVS update of full tree failed." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
1998-08-11 16:38:09 +08:00
|
|
|
|
2001-07-27 14:00:45 +08:00
|
|
|
{
|
|
|
|
date
|
|
|
|
TZ=UTC date
|
|
|
|
} > LAST_UPDATED
|
2000-05-13 04:18:49 +08:00
|
|
|
touch_files_reexec
|