1998-08-11 10:38:09 +02:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2000-04-28 03:23:47 +02:00
|
|
|
# Update a local CVS tree from the GCC repository, with an emphasis
|
2000-11-22 14:11:44 +01:00
|
|
|
# on treating generated files correctly, so that autoconf, gperf et
|
1998-08-11 10:38:09 +02:00
|
|
|
# al are not required for the ``end'' user.
|
|
|
|
#
|
1998-08-11 11:04:53 +02: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 14:14:12 +02:00
|
|
|
# are omitted.
|
|
|
|
#
|
1999-07-05 12:22:15 +02:00
|
|
|
# If the first parameter reads --patch, the second parameter is considered
|
|
|
|
# a patch file.
|
2000-09-16 14:14:12 +02:00
|
|
|
#
|
1999-07-27 15:26:37 +02: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 12:47:28 +01: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 11:04:53 +02:00
|
|
|
# Examples:
|
|
|
|
#
|
2000-04-28 03:23:47 +02: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 11:04:53 +02:00
|
|
|
#
|
1998-08-12 13:02:37 +02:00
|
|
|
#
|
2005-03-18 12:47:28 +01:00
|
|
|
# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
|
1998-08-12 13:02:37 +02: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 10:38:09 +02:00
|
|
|
|
2003-03-03 21:09:38 +01:00
|
|
|
# CVS command
|
|
|
|
GCC_CVS=${GCC_CVS-${CVS-cvs}}
|
1999-07-05 12:22:15 +02:00
|
|
|
# Default options used when updating via CVS.
|
2001-05-23 14:15:03 +02: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 10:38:09 +02:00
|
|
|
|
2000-05-18 06:19:35 +02:00
|
|
|
# Arrange for the value of $0 to be available for functions
|
|
|
|
self=$0
|
1998-08-11 10:38:09 +02:00
|
|
|
|
2005-03-18 12:47:28 +01:00
|
|
|
# This function prints its arguments to standard output unless
|
|
|
|
# "silent" is set.
|
2005-03-19 01:16:22 +01:00
|
|
|
unset silent
|
2005-03-18 12:47:28 +01:00
|
|
|
chat () {
|
|
|
|
if [ -z "$silent" ]; then
|
|
|
|
echo "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1999-07-27 15:26:37 +02: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 11:27:00 +02: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-04 20:18:54 +02:00
|
|
|
# intl library
|
|
|
|
intl/plural.c: intl/plural.y
|
2004-02-29 22:13:41 +01:00
|
|
|
intl/configure: intl/configure.ac intl/aclocal.m4
|
|
|
|
intl/config.h.in: intl/configure.ac intl/aclocal.m4
|
1999-07-27 15:26:37 +02:00
|
|
|
# Now, proceed to gcc automatically generated files
|
2004-01-03 20:55:35 +01:00
|
|
|
gcc/configure: gcc/configure.ac
|
|
|
|
gcc/cstamp-h.in: gcc/configure.ac
|
1999-07-28 19:52:02 +02:00
|
|
|
gcc/config.in: gcc/cstamp-h.in
|
1999-07-27 15:26:37 +02:00
|
|
|
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
|
2004-08-03 15:35:47 +02:00
|
|
|
gcc/config/arm/arm-tune.md: gcc/config/arm/arm-cores.def gcc/config/arm/gentune.sh
|
1999-07-27 15:26:37 +02:00
|
|
|
# And then, language-specific files
|
2003-01-03 07:05:11 +01:00
|
|
|
gcc/cp/cfns.h: gcc/cp/cfns.gperf
|
|
|
|
gcc/java/keyword.h: gcc/java/keyword.gperf
|
2003-06-24 03:32:33 +02: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 15:26:37 +02:00
|
|
|
# And libraries, at last
|
2004-05-29 21:51:26 +02:00
|
|
|
libbanshee/configure: libbanshee/configure.ac
|
2004-06-15 16:59:58 +02:00
|
|
|
libmudflap/configure: libmudflap/configure.ac
|
2004-04-09 15:13:09 +02:00
|
|
|
libobjc/configure: libobjc/configure.ac
|
2004-04-12 13:03:16 +02: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 03:12:41 +01: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 05:11:44 +01:00
|
|
|
boehm-gc/aclocal.m4: boehm-gc/configure.ac
|
2004-06-16 13:58:44 +02:00
|
|
|
boehm-gc/Makefile.in: boehm-gc/Makefile.am boehm-gc/configure.ac boehm-gc/aclocal.m4
|
2004-06-16 09:35:00 +02:00
|
|
|
boehm-gc/configure: boehm-gc/configure.ac boehm-gc/aclocal.m4
|
2004-03-11 03:24:53 +01:00
|
|
|
libada/configure: libada/configure.ac
|
2004-03-16 20:19:19 +01: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 06:50:45 +02: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-20 18:17:35 +02: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 07:22:00 +01: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 06:50:14 +01:00
|
|
|
libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
|
2004-06-14 15:53:45 +02:00
|
|
|
libcpp/aclocal.m4: libcpp/configure.ac
|
2004-08-25 11:07:43 +02:00
|
|
|
libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
|
2004-06-14 15:53:45 +02:00
|
|
|
libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
|
2002-09-25 00:51:57 +02:00
|
|
|
# Top level
|
|
|
|
Makefile.in: Makefile.tpl Makefile.def
|
2002-12-28 17:24:33 +01:00
|
|
|
configure: configure.in config/acx.m4
|
1999-07-27 15:26:37 +02:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-05 12:22:15 +02:00
|
|
|
# This function touches generated files such that the ``end'' user does
|
|
|
|
# not have to rebuild them.
|
1999-07-27 15:26:37 +02:00
|
|
|
touch_files () {
|
2001-05-14 21:57:52 +02: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 12:09:10 +02:00
|
|
|
echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$
|
2001-05-14 21:57:52 +02:00
|
|
|
echo ' echo Touching $@...; \' >> Makefile.$$
|
2005-03-18 12:47:28 +01:00
|
|
|
chat ' echo Touching $@... 1>&2; \' >> Makefile.$$
|
2001-05-14 21:57:52 +02:00
|
|
|
echo ' touch $@' >> Makefile.$$
|
|
|
|
files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$
|
2004-11-14 07:31:00 +01:00
|
|
|
|
2004-11-20 11:49:16 +01:00
|
|
|
# We would have to explicitly shut off the "Entering... Leaving..."
|
2004-11-14 07:31:00 +01: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 11:49:16 +01: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-14 21:57:52 +02:00
|
|
|
sleep 1
|
|
|
|
done 2>&1
|
|
|
|
rm -f Makefile.$$
|
1999-07-05 12:22:15 +02:00
|
|
|
}
|
|
|
|
|
2001-05-14 21:57:52 +02:00
|
|
|
|
2000-05-12 22:18:49 +02: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 12:47:28 +01:00
|
|
|
chat "Adjusting file timestamps"
|
|
|
|
exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch
|
2000-09-16 14:14:12 +02:00
|
|
|
}
|
1999-07-05 12:22:15 +02:00
|
|
|
|
|
|
|
# This functions applies a patch to an existing tree.
|
1999-07-27 15:26:37 +02:00
|
|
|
apply_patch () {
|
2005-03-18 23:43:26 +01:00
|
|
|
if [ -f "$1" ]; then
|
1999-07-05 12:22:15 +02:00
|
|
|
echo "Applying patch file $1"
|
2005-03-18 23:43:26 +01:00
|
|
|
case $1 in
|
1999-07-05 12:22:15 +02:00
|
|
|
*gz)
|
2005-03-18 23:43:26 +01:00
|
|
|
gzip -d -c "$1" | patch -p1 ;;
|
1999-11-28 08:41:09 +01:00
|
|
|
*bz2)
|
2005-03-18 23:43:26 +01:00
|
|
|
bzip2 -d -c "$1" | patch -p1 ;;
|
1999-07-05 12:22:15 +02:00
|
|
|
*)
|
2005-03-18 23:43:26 +01:00
|
|
|
patch -p1 < "$1";;
|
1999-07-05 12:22:15 +02:00
|
|
|
esac
|
|
|
|
fi
|
2000-05-12 22:18:49 +02:00
|
|
|
touch_files_reexec
|
1999-07-05 12:22:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Check whether this indeed looks like a local tree.
|
|
|
|
if [ ! -f gcc/version.c ]; then
|
2000-04-28 03:23:47 +02:00
|
|
|
echo "This does not seem to be a GCC tree!"
|
1999-07-05 12:22:15 +02:00
|
|
|
exit
|
1998-08-11 10:38:09 +02:00
|
|
|
fi
|
|
|
|
|
2005-03-18 12:47:28 +01:00
|
|
|
case "$1" in
|
|
|
|
--silent)
|
|
|
|
silent=t
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1999-07-27 15:26:37 +02:00
|
|
|
case "$1" in
|
1999-07-05 12:22:15 +02:00
|
|
|
# First of all, check whether we are going to process a patch.
|
2000-09-16 14:14:12 +02:00
|
|
|
--patch)
|
1999-07-27 15:26:37 +02: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 12:22:15 +02:00
|
|
|
|
|
|
|
# Check whether this indeed looks like a local CVS tree.
|
|
|
|
if [ ! -d CVS ]; then
|
2000-04-28 03:23:47 +02:00
|
|
|
echo "This does not seem to be a GCC CVS tree!"
|
1999-07-05 12:22:15 +02:00
|
|
|
exit
|
|
|
|
fi
|
1998-08-11 11:04:53 +02:00
|
|
|
|
1999-07-05 12:22:15 +02:00
|
|
|
# Check command-line options
|
1998-08-11 11:04:53 +02:00
|
|
|
if [ x"${1}"x = x"--nostdflags"x ]; then
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
set -- $UPDATE_OPTIONS ${1+"$@"}
|
|
|
|
fi
|
|
|
|
|
2005-03-18 12:47:28 +01:00
|
|
|
chat "Updating CVS tree"
|
|
|
|
|
|
|
|
$GCC_CVS -q ${silent+-Q} update ${1+"$@"}
|
2000-09-16 14:14:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
2000-08-30 23:56:42 +02:00
|
|
|
(touch_files_reexec)
|
1999-02-04 09:07:51 +01:00
|
|
|
echo "CVS update of full tree failed." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
1998-08-11 10:38:09 +02:00
|
|
|
|
2001-07-27 08:00:45 +02:00
|
|
|
{
|
|
|
|
date
|
|
|
|
TZ=UTC date
|
|
|
|
} > LAST_UPDATED
|
2000-05-12 22:18:49 +02:00
|
|
|
touch_files_reexec
|