OSDN Git Service

c3427acef75d5c4da4691cb14f38a39ebffb5f1b
[pf3gnuchains/gcc-fork.git] / contrib / egcs_update
1 #! /bin/sh
2 #
3 # Update a local CVS tree from the egcs repository, with an emphasis
4 # on treating generated files correctly, so that autoconf, bison et
5 # al are not required for the ``end'' user.
6 #
7 # By default all command-line options are passed to `cvs update` in
8 # addition to $UPDATE_OPTIONS (defined below). If the first parameter
9 # reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself
10 # are omitted. 
11
12 # Examples:
13 #
14 # contrib/egcs_update -r egcs_latest_snapshot
15 # contrib/egcs_update -A
16 # contrib/egcs_update --nostdflags -P -r egcs_1_1_branch gcc/testsuite
17 #
18 #
19 # (C) 1998 Free Software Foundation
20 # Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, August 1998.
21 #
22 # This script is Free Software, and it can be copied, distributed and
23 # modified as defined in the GNU General Public License.  A copy of
24 # its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
25
26
27 UPDATE_OPTIONS=-P
28 # Add -d to create any directories that exist in the repository but not
29 #        locally.
30 # Add -A to reset any sticky tags, dates, or `-k' options.
31
32
33 echo "Current directory is `pwd`."
34
35 # First of all, check whether this indeed looks like a local CVS of egcs.
36 if [ ! -d CVS ] || [ ! -f gcc/version.c ]; then
37         echo "This does not seem to be an egcs CVS tree!"
38         exit
39 fi
40
41 # Check command-line options
42
43 if [ x"${1}"x = x"--nostdflags"x ]; then
44     shift
45 else
46     set -- $UPDATE_OPTIONS ${1+"$@"}
47 fi
48
49
50 echo "Pass 1: Updating autoconf and bison generated files"
51 # Do a CVS update on those files that exist in CVS directories.  libg++
52 # makes sense to drop into the tree, but it isn't CVS-controlled.
53 for i in `find . -name configure.in -o -name '*.y'`
54 do
55         D=`dirname $i`/CVS
56         [ -f $i -a  -d $D ]  && echo $i  
57 done | xargs cvs -q update
58
59
60 echo "Pass 2: Updating full tree"
61 cvs -q update ${1+"$@"}
62
63 echo "Pass 3: Fixing local tree"
64 touch `find . -name configure -print`
65 touch `find texinfo -name Makefile.in -print`
66 touch `find texinfo -name \*.pot -print`
67 touch `find texinfo -name \*.gmo -print`
68 for f in gcc/c-parse.y \
69          gcc/cstamp-h.in \
70          gcc/c-gperf.h \
71          gcc/c-parse.c \
72          gcc/c-parse.h \
73          gcc/cexp.c \
74          gcc/cp/parse.c \
75          gcc/cp/parse.h \
76          gcc/objc/objc-parse.c \
77          gcc/objc/objc-parse.y \
78          gcc/java/parse.h \
79          libf2c/libU77/stamp-h.in \
80          contrib/fixinc/fixincl.x \
81          contrib/fixinc/inclhack.sh \
82          contrib/fixinc/fixincl.sh
83 do
84         touch $f
85 done