* lib/objc.exp: Add -lposix4 on Solaris 2.8.
[official-gcc.git] / contrib / release
blobb0e6a55f37ea16ab491be13116dd35646264e37b
1 #! /bin/sh -x
3 # GCC release generation script.
5 # Originally written by Jeff Law <law@redhat.com>.
7 # We need separate variables for the tag in the CVS sources and the
8 # name of the release directory. Consider if we have a packaging problem
9 # and need to respin the release. The sources do not change, but the release
10 # name changes.
12 # [[ Not clear. You can purge the old tag and make a new one, too.
13 # That way they continue to match. Maximize consistency. ]]
15 # We used to use a tag to get the previous release, but it is more reliable to
16 # actually unpack the previous release from the ftp directory. Consider files
17 # like .brik which are in the release, but not in the repository.
19 if test $# != 6 ; then
20 echo "usage: release release-tag release-name release_branch last-release-name prerelease dotag"
21 exit 1
24 release_tag=$1
25 release_name=$2
26 release_suffix=`echo $release_name | sed -e s#gcc-##`
27 release_branch=$3
28 last_release_name=$4
29 last_release_suffix=`echo $last_release_name | sed -e s#gcc-##`
30 prerelease=$5
31 dotag=$6
33 case $last_release_name in
34 egcs-1.0*)
35 echo "unprotoize.c and README.gcc need special handling"
36 exit 1;
38 egcs-1.1*)
39 echo "No java or chill in egcs-1.1*"
42 gcc-2.95*)
43 echo "No testsuites in gcc-2.95*"
45 esac
47 STATEDIR=${STATEDIR-/home/law}
48 GCCBASE=${GCCBASE-${STATEDIR}/gcc}
49 TMPDIR=${TMPDIR-/var/tmp}
50 export TMPDIR STATEDIR GCCBASE
52 PATH=${GCCBASE}:$PATH
54 [ -f ${GCCBASE}/gcc.pot ] || {
55 echo "'${GCCBASE}/gcc.pot' is missing"
56 exit 1
59 [ -f ${STATEDIR}/bin/brik ] || {
60 echo "'${STATEDIR}/bin/brik' is missing"
61 exit 1
64 # We run this on the cvs server itself so we can get at the cvs
65 # files quickly. It also assumes access to my home dir for some
66 # programs.
67 CVSROOT=/cvs/gcc
68 export CVSROOT
70 # Get somewhere useful with a lot of disk space.
71 cd $TMPDIR
73 # Get into a temporary directory so as not to be confused by
74 # any existing CVS administration files.
75 rm -rf $$
76 mkdir $$
77 cd $$
79 if test $prerelease = no -a $dotag = yes; then
80 update_changelogs $release_name $release_branch
83 # If requested, tag the branch. Three steps, first remove the old tag from
84 # the repository, then check out the release branch, then retag the release
85 # branch.
86 if test $dotag = yes; then
87 rm -rf gcc
88 cvs -Q rtag -d $release_tag gcc
89 cvs -Q co -r $release_branch gcc
90 cvs -Q tag -f $release_tag
91 rm -rf gcc
94 # Get a copy of the previous release. Get it from the ftp dir to avoid minor
95 # issues with files like .brik not being in the repository.
96 if test $prerelease = yes; then
97 echo "Yow!"
98 exit 1;
99 zcat ~ftp/pub/gcc/snapshots/egcs-1.1.2-prerelease/$last_release_name.tar.gz | tar xf -
100 else
101 zcat ~ftp/pub/gcc/releases/$last_release_name/$last_release_name.tar.gz | tar xf -
104 # Files/directories which are not part of the gcc-core module.
105 noncore_files="gcc/cp libio libstdc++ gcc/f libf2c gcc/objc libobjc gcc/ch libchill gcc/java libjava gcc/testsuite"
107 # Get the gcc core. Note that the gcc-core module doesn't work yet, so
108 # we get the whole directory, then prune the things we do not want.
110 # Also, get the latest copy of the installation instructions and the
111 # faq in html, build plaintext versions of those documents.
112 cvs -Q export -ko -r$release_tag gcc
113 cd gcc
114 contrib/gcc_update --touch
115 cp ${GCCBASE}/gcc.pot gcc/po
116 cd ..
117 cvs -Q export -ko -Dnow wwwdocs/htdocs/install
118 cvs -Q export -ko -Dnow wwwdocs/htdocs/faq.html
119 #cvs -Q export -ko -Dnow wwwdocs/htdocs/bugs.html
120 mv gcc $release_name
121 release_docs $release_name $$
123 # Build a list of files in this release.
124 cd $release_name
125 find . -type f -print | sort > ../files_$release_name
126 ${STATEDIR}/bin/brik -Gb -f ../files_$release_name > ../.brik_$release_name
127 cp ../.brik_$release_name ./.brik
129 # Get back to the directory with the two releases in it.
130 cd ..
132 # Remove anything that is not part of the core
133 for file in $noncore_files; do
134 rm -rf $last_release_name/$file
135 rm -rf $release_name/$file
136 done
138 # Make the core tarball
139 tar cf - $release_name | gzip --best > gcc-core-$release_suffix.tar.gz
141 # make empty directories for directories that disappeared so that
142 # patch will delete any files in those directories when patching up to
143 # this release
144 case $last_release_name in
145 gcc-2.95*)
146 mkdir $release_name/xiberty
147 mkdir $release_name/contrib/fixinc
149 esac
151 # Diff the core modules
152 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name $release_name > gcc-core-$last_release_suffix-$release_suffix.diff
154 # Remove the core gunk
155 rm -rf $last_release_name
156 rm -rf $release_name
159 # Go back and get the full distributions.
160 if test $prerelease = yes; then
161 zcat ~ftp/pub/gcc/snapshots/egcs-1.1.2-prerelease/$last_release_name.tar.gz | tar xf -
162 else
163 zcat ~ftp/pub/gcc/releases/$last_release_name/$last_release_name.tar.gz | tar xf -
166 cvs -Q export -ko -r$release_tag gcc
167 cd gcc
168 contrib/gcc_update --touch
169 cp ${GCCBASE}/gcc.pot gcc/po
170 cd ..
171 cvs -Q export -ko -Dnow wwwdocs/htdocs/install
172 cvs -Q export -ko -Dnow wwwdocs/htdocs/faq.html
173 #cvs -Q export -ko -Dnow wwwdocs/htdocs/bugs.html
174 mv gcc $release_name
175 find $release_name/gcc/testsuite -type f -print | xargs rm -f
176 release_docs $release_name $$
179 # No need to regenerate the .brik file. We didn't delete it.
180 cp .brik_$release_name $release_name/.brik
182 # We don't need this anymore.
183 rm .brik_$release_name
184 rm .brik_$last_release_name
186 # Make tarballs
188 tar cf - $release_name/.brik $release_name/gcc/f $release_name/libf2c | gzip --best > gcc-g77-$release_suffix.tar.gz
189 tar cf - $release_name/.brik $release_name/gcc/java | gzip --best > gcc-java-$release_suffix.tar.gz
190 tar cf - $release_name/.brik $release_name/gcc/ch $release_name/libchill | gzip --best > gcc-chill-$release_suffix.tar.gz
191 #tar cf - $release_name/.brik $release_name/gcc/testsuite/g77.f-torture | gzip --best > gcc-g77-testsuite-$release_suffix.tar.gz
192 tar cf - $release_name/.brik $release_name/gcc/objc $release_name/libobjc | gzip --best > gcc-objc-$release_suffix.tar.gz
193 tar cf - $release_name/.brik $release_name/gcc/cp $release_name/libio $release_name/libstdc++ | gzip --best > gcc-g++-$release_suffix.tar.gz
194 #tar cf - $release_name/.brik $release_name/gcc/testsuite/g++.old-deja | gzip --best > gcc-g++-tests-$release_suffix.tar.gz
195 #tar cf - $release_name/.brik $release_name/gcc/testsuite | gzip --best > gcc-tests-$release_suffix.tar.gz
196 tar cf - $release_name | gzip --best > $release_name.tar.gz
197 # make empty directories for directories that disappeared so that
198 # patch will delete any files in those directories when patching up to
199 # this release
200 # make empty directories for directories that disappeared so that
201 # patch will delete any files in those directories when patching up to
202 # this release
203 case $last_release_name in
204 gcc-2.95*)
205 mkdir $release_name/xiberty
206 mkdir $release_name/contrib/fixinc
208 esac
210 # Now make diffs for g77, g77-testsuite objc, g++, g++-testsuite, testsuite,
211 # then the whole bloody thing. Add libobjc, java & chill for next major
212 #release.
213 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/f $release_name/gcc/f > gcc-g77-$last_release_suffix-$release_suffix.diff
214 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libf2c $release_name/libf2c >> gcc-g77-$last_release_suffix-$release_suffix.diff
216 #diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite/g77.f-torture $release_name/gcc/testsuite/g77.f-torture > gcc-g77-testsuite-$last_release_suffix-$release_suffix.diff
218 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/ch $release_name/gcc/ch > gcc-chill-$last_release_suffix-$release_suffix.diff
219 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libchill $release_name/libchill >> gcc-chill-$last_release_suffix-$release_suffix.diff
221 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/java $release_name/gcc/java > gcc-java-$last_release_suffix-$release_suffix.diff
222 #diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libf2c $release_name/libf2c >> gcc-java-$last_release_suffix-$release_suffix.diff
224 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/objc $release_name/gcc/objc > gcc-objc-$last_release_suffix-$release_suffix.diff
225 mkdir $last_release_name/libobjc
226 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libobjc $release_name/libobjc >> gcc-objc-$last_release_suffix-$release_suffix.diff
228 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/cp $release_name/gcc/cp > gcc-g++-$last_release_suffix-$release_suffix.diff
229 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libio $release_name/libio >> gcc-g++-$last_release_suffix-$release_suffix.diff
230 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libstdc++ $release_name/libstdc++ >> gcc-g++-$last_release_suffix-$release_suffix.diff
232 #diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite/g++.old-deja $release_name/gcc/testsuite/g++.old-deja > gcc-g++-tests-$last_release_suffix-$release_suffix.diff
234 #diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite $release_name/gcc/testsuite > gcc-tests-$last_release_suffix-$release_suffix.diff
236 diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name $release_name > gcc-$last_release_suffix-$release_suffix.diff
239 # Remove the old snapshot, we're done with it.
240 rm -rf $last_release_name
243 # Compress the diff files.
244 gzip --best *.diff
246 # bzip everything too
248 # Copy them to the FTP server XXX
250 # Update links on the ftp server XXX
252 # Announce it XXX