source: trunk/src/gcc/maintainer-scripts/gcc_release@ 2027

Last change on this file since 2027 was 1477, checked in by bird, 21 years ago

This commit was generated by cvs2svn to compensate for changes in r1476,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 18.3 KB
RevLine 
[2]1#! /bin/sh
2
3########################################################################
4#
5# File: gcc_release
6# Author: Jeffrey Law, Bernd Schmidt, Mark Mitchell
7# Date: 2001-05-25
8#
9# Contents:
10# Script to create a GCC release.
11#
12# Copyright (c) 2001, 2002 Free Software Foundation.
13#
[1391]14# This file is part of GCC.
[2]15#
[1391]16# GCC is free software; you can redistribute it and/or modify
[2]17# it under the terms of the GNU General Public License as published by
18# the Free Software Foundation; either version 2, or (at your option)
19# any later version.
20#
[1391]21# GCC is distributed in the hope that it will be useful,
[2]22# but WITHOUT ANY WARRANTY; without even the implied warranty of
23# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24# GNU General Public License for more details.
25#
26# You should have received a copy of the GNU General Public License
[1391]27# along with GCC; see the file COPYING. If not, write to
[2]28# the Free Software Foundation, 59 Temple Place - Suite 330,
29# Boston, MA 02111-1307, USA.
30#
31########################################################################
32
33########################################################################
34# Notes
35########################################################################
36
37# Here is an example usage of this script, to create a GCC 3.0.2
38# prerelease:
39#
40# gcc_release -r 3.0.2
41#
42# This script will automatically use the head of the release branch
43# to generate the release.
44
45########################################################################
46# Functions
47########################################################################
48
49# Issue the error message given by $1 and exit with a non-zero
50# exit code.
51
52error() {
53 echo "gcc_release: error: $1"
54 exit 1
55}
56
57# Issue the informational message given by $1.
58
59inform() {
60 echo "gcc_release: $1"
61}
62
63# Issue a usage message explaining how to use this script.
64
65usage() {
66cat <<EOF
67gcc_release [-d destination]
68 [-u username]
69 [-r release]
70 [-t tag]
71 [-p previous-tarball]
72 [-s] [-f] [-l]
73EOF
74 exit 1
75}
76
77# Change to the directory given by $1.
78
79changedir() {
80 cd $1 || \
81 error "Could not change directory to $1"
82}
83
84# Each of the arguments is a directory name, relative to the top
85# of the source tree. Return another name for that directory, relative
86# to the working directory.
87
88adjust_dirs() {
89 for x in $@; do
90 echo `basename ${SOURCE_DIRECTORY}`/$x
91 done
92}
93
94# Build the source tree that will be the basis for the release
95# in ${WORKING_DIRECTORY}/gcc-${RELEASE}.
96
97build_sources() {
98 # If the WORKING_DIRECTORY already exists, do not risk destroying it.
99 if [ -r ${WORKING_DIRECTORY} ]; then
100 error "\`${WORKING_DIRECTORY}' already exists"
101 fi
102 # Create the WORKING_DIRECTORY.
103 mkdir "${WORKING_DIRECTORY}" \
104 || error "Could not create \`${WORKING_DIRECTORY}'"
105 changedir "${WORKING_DIRECTORY}"
106
107 # If this is a final release, make sure that the ChangeLogs
108 # and version strings are updated.
109 if [ ${FINAL} -ne 0 ]; then
110 inform "Updating ChangeLogs and version files"
111
112 ${CVS} co -d "`basename ${SOURCE_DIRECTORY}`" \
113 -r ${BRANCH} gcc || \
114 error "Could not check out release sources"
115 for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
116 cat - ${x} > ${x}.new <<EOF
117${LONG_DATE} Release Manager
118
119 * GCC ${RELEASE} Released.
120
121EOF
122 mv ${x}.new ${x} || \
123 error "Could not update ${x}"
124 (changedir `dirname ${x}` && \
125 ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
126 error "Could not commit ${x}"
127 done
128
[1391]129 # Update `gcc/version.c'.
[2]130 for x in gcc/version.c; do
131 y=`basename ${x}`
132 (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
[1391]133 sed -e 's|version_string\[\] = \".*\"|version_string\[\] = \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
[2]134 mv ${y}.new ${y} && \
135 ${CVS} ci -m 'Update version' ${y}) || \
136 error "Could not update ${x}"
137 done
138
139 # Make sure we tag the sources for a final release.
140 TAG="gcc_`echo ${RELEASE} | tr . _`_release"
141
142 rm -rf ${SOURCE_DIRECTORY}
143 fi
144
145 # Tag the sources.
146 if [ -n "${TAG}" ]; then
147 inform "Tagging release sources"
148 ${CVS} rtag -r ${BRANCH} -F ${TAG} gcc || \
149 error "Could not tag release sources"
150 BRANCH=$TAG
151 fi
152
153 # Export the current sources.
154 inform "Retrieving release sources"
155 ${CVS} \
156 export -d "`basename ${SOURCE_DIRECTORY}`" \
157 -r ${BRANCH} gcc || \
158 error "Could not retrieve release sources"
159
160 # Run gcc_update on them to set up the timestamps nicely.
161 changedir "gcc-${RELEASE}"
162 contrib/gcc_update --touch
163
164 # Obtain some documentation files from the wwwdocs module.
165 inform "Retrieving HTML documentation"
166 changedir "${WORKING_DIRECTORY}"
[1391]167 for x in bugs faq; do
[2]168 (${CVS} export -r HEAD wwwdocs/htdocs/${x}.html && \
169 cp ${WORKING_DIRECTORY}/wwwdocs/htdocs/${x}.html \
170 ${SOURCE_DIRECTORY}) || \
171 error "Could not retrieve ${x}.html"
172 done
173
174 inform "Generating plain-text documentation from HTML"
175 changedir "${SOURCE_DIRECTORY}"
176 for file in *.html; do
177 newfile=`echo $file | sed -e 's/.html//' | tr "[:lower:]" "[:upper:]"`
178 (${ENV} TERM=vt100 lynx -dump $file \
179 | sed -e "s#file://localhost`/bin/pwd`\(.*\)#http://gcc.gnu.org\1#g" \
180 > $newfile) || \
[1391]181 error "Could not generate text-only version of ${file}"
[2]182 done
183
184 # For a prerelease or real release, we need to generate additional
185 # files not present in CVS.
186 changedir "${SOURCE_DIRECTORY}"
187 if [ $SNAPSHOT -ne 1 ]; then
188 # Generate the documentation.
189 inform "Building install docs"
190 SOURCEDIR=${SOURCE_DIRECTORY}/gcc/doc
191 DESTDIR=${SOURCE_DIRECTORY}/INSTALL
192 export SOURCEDIR
193 export DESTDIR
194 ${SOURCE_DIRECTORY}/gcc/doc/install.texi2html
195
196 # Regenerate the NEWS file.
[1476]197 contrib/gennews > NEWS || \
[2]198 error "Could not regenerate NEWS files"
199
200 # Now, we must build the compiler in order to create any generated
201 # files that are supposed to go in the source directory. This is
202 # also a good sanity check to make sure that the release builds
203 # on at least one platform.
204 inform "Building compiler"
205 OBJECT_DIRECTORY=../objdir
206 contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} build || \
207 error "Could not rebuild GCC"
208
209 # Regenerate the Fotran NEWS and BUGS files.
210 (cd ${OBJECT_DIRECTORY}/gcc && make f77.rebuilt) || \
211 error "Could not regenerate Fortran NEWS and BUGS files"
212 fi
213
214 # Move message catalogs to source directory.
215 mv ../objdir/gcc/po/*.gmo gcc/po/
216
217 # Create a `.brik' file to use for checking the validity of the
218 # release.
219 changedir "${SOURCE_DIRECTORY}"
220 BRIK_FILE=`mktemp /tmp/gcc_release.XXXXXXX`
221 ((find . -type f | sort > $BRIK_FILE) && \
222 brik -Gb -f ${BRIK_FILE} > .brik && \
223 rm ${BRIK_FILE}) || \
224 error "Could not compute brik checksum"
225}
226
227# Buid a single tarfile. The first argument is the name of the name
228# of the tarfile to build, without any suffixes. They will be added
229# automatically. The rest of the arguments are the files or
230# directories to include.
231
232build_tarfile() {
233 # Get the name of the destination tar file.
234 TARFILE="$1.tar.gz"
235 shift
236
237 # Build the tar file itself.
238 (${TAR} cf - "$@" | ${GZIP} > ${TARFILE}) || \
239 error "Could not build tarfile"
240 FILE_LIST="${FILE_LIST} ${TARFILE}"
241}
242
243# Build the various tar files for the release.
244
245build_tarfiles() {
246 inform "Building tarfiles"
247