Mercurial > hg > CbC > CbC_gcc
annotate maintainer-scripts/update_web_docs_svn @ 143:76e1cf5455ef
add cbc_gc test
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 19:24:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1 #!/bin/sh |
0 | 2 |
3 # Generate HTML documentation from GCC Texinfo docs. | |
111 | 4 # |
5 # If you want to run this on a machine different from gcc.gnu.org, you | |
6 # may need to adjust SVNROOT and WWWBASE below (or override them via the | |
7 # environment). | |
0 | 8 |
9 set -e | |
10 | |
11 # Run this from /tmp. | |
12 SVNROOT=${SVNROOT:-"file:///svn/gcc"} | |
13 export SVNROOT | |
14 | |
15 PATH=/usr/local/bin:$PATH | |
16 | |
17 MANUALS="cpp | |
18 cppinternals | |
19 fastjar | |
20 gcc | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
21 gccgo |
0 | 22 gccint |
23 gcj | |
24 gfortran | |
25 gfc-internals | |
111 | 26 gnat_ugn |
0 | 27 gnat-style |
28 gnat_rm | |
29 libgomp | |
111 | 30 libitm |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
31 libquadmath |
0 | 32 libiberty |
33 porting" | |
34 | |
111 | 35 CSS=/gcc.css |
36 | |
37 WWWBASE=${WWWBASE:-"/www/gcc/htdocs"} | |
0 | 38 WWWBASE_PREFORMATTED=/www/gcc/htdocs-preformatted |
39 WWWPREPROCESS='/www/gcc/bin/preprocess -r' | |
40 | |
41 # Process options -rrelease and -ddirectory | |
42 RELEASE="" | |
43 SUBDIR="" | |
44 | |
45 while [ $# -gt 0 ]; do | |
46 case $1 in | |
47 -r*) | |
48 if [ -n "$RELEASE" ]; then | |
49 echo "Multiple releases specified" >&2 | |
50 exit 1 | |
51 fi | |
52 RELEASE="${1#-r}" | |
53 if [ -z "$RELEASE" ]; then | |
54 shift | |
55 RELEASE="$1" | |
56 if [ -z "$RELEASE" ]; then | |
57 echo "No release specified with -r" >&2 | |
58 exit 1 | |
59 fi | |
60 fi | |
61 ;; | |
62 -d*) | |
63 if [ -n "$SUBDIR" ]; then | |
64 echo "Multiple subdirectories specified" >&2 | |
65 exit 1 | |
66 fi | |
67 SUBDIR="${1#-d}" | |
68 if [ -z "$SUBDIR" ]; then | |
69 shift | |
70 SUBDIR="$1" | |
71 if [ -z "$SUBDIR" ]; then | |
72 echo "No subdirectory specified with -d" >&2 | |
73 exit 1 | |
74 fi | |
75 fi | |
76 ;; | |
77 *) | |
78 echo "Unknown argument \"$1\"" >&2 | |
79 exit 1 | |
80 ;; | |
81 esac | |
82 shift | |
83 done | |
84 | |
85 if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then | |
86 echo "Release specified without subdirectory" >&2 | |
87 exit 1 | |
88 fi | |
89 | |
90 if [ -z "$SUBDIR" ]; then | |
91 DOCSDIR=$WWWBASE/onlinedocs | |
92 else | |
93 DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR | |
94 fi | |
95 | |
111 | 96 if [ ! -d $WWWBASE ]; then |
97 echo "WWW base directory \"$WWWBASE\" does not exist." >&2 | |
98 exit 1 | |
99 fi | |
100 | |
0 | 101 if [ ! -d $DOCSDIR ]; then |
102 mkdir $DOCSDIR | |
111 | 103 chmod g+w $DOCSDIR |
0 | 104 fi |
105 | |
106 if [ -z "$RELEASE" ]; then | |
107 RELEASE=trunk | |
108 fi | |
109 | |
110 WORKDIR=/tmp/gcc-doc-update.$$ | |
111 | |
112 rm -rf $WORKDIR | |
113 mkdir $WORKDIR | |
114 cd $WORKDIR | |
115 if [ "$RELEASE" = "trunk" ]; then | |
116 svn -q export $SVNROOT/$RELEASE gcc | |
117 else | |
118 svn -q export $SVNROOT/tags/$RELEASE gcc | |
119 fi | |
120 | |
111 | 121 # Remove all unwanted files. This is needed to avoid packaging all the |
122 # sources instead of only documentation sources. | |
123 # Note that we have to preserve gcc/jit/docs since the jit docs are | |
124 # not .texi files (Makefile, .rst and .png), and the jit docs use | |
125 # include directives to pull in content from jit/jit-common.h and | |
126 # jit/notes.txt, so we have to preserve those also. | |
0 | 127 find gcc -type f \( -name '*.texi' \ |
128 -o -path gcc/gcc/doc/install.texi2html \ | |
129 -o -path gcc/gcc/doc/include/texinfo.tex \ | |
130 -o -path gcc/gcc/BASE-VER \ | |
131 -o -path gcc/gcc/DEV-PHASE \ | |
111 | 132 -o -path "gcc/gcc/ada/doc/gnat_ugn/*.png" \ |
133 -o -path "gcc/gcc/jit/docs/*" \ | |
134 -o -path "gcc/gcc/jit/jit-common.h" \ | |
135 -o -path "gcc/gcc/jit/notes.txt" \ | |
0 | 136 -o -print0 \) | xargs -0 rm -f |
137 | |
138 # Build a tarball of the sources. | |
139 tar cf docs-sources.tar gcc | |
140 | |
141 # The directory to pass to -I; this is the one with texinfo.tex | |
142 # and fdl.texi. | |
143 includedir=gcc/gcc/doc/include | |
144 | |
145 # Generate gcc-vers.texi. | |
146 ( | |
147 echo "@set version-GCC $(cat gcc/gcc/BASE-VER)" | |
148 if [ "$(cat gcc/gcc/DEV-PHASE)" = "experimental" ]; then | |
149 echo "@set DEVELOPMENT" | |
150 else | |
151 echo "@clear DEVELOPMENT" | |
152 fi | |
153 echo "@set srcdir $WORKDIR/gcc/gcc" | |
154 echo "@set VERSION_PACKAGE (GCC)" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
155 echo "@set BUGURL @uref{http://gcc.gnu.org/bugs/}" |
0 | 156 ) > $includedir/gcc-vers.texi |
157 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
158 # Generate libquadmath-vers.texi. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
159 echo "@set BUGURL @uref{http://gcc.gnu.org/bugs/}" \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
160 > $includedir/libquadmath-vers.texi |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
161 |
0 | 162 # Now convert the relevant files from texi to HTML, PDF and PostScript. |
163 for file in $MANUALS; do | |
164 filename=`find . -name ${file}.texi` | |
165 if [ "${filename}" ]; then | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
166 includes="-I ${includedir} -I `dirname ${filename}`" |
111 | 167 if [ "$file" = "gnat_ugn" ]; then |
168 includes="$includes -I gcc/gcc/ada -I gcc/gcc/ada/doc/gnat_ugn" | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
169 fi |
111 | 170 makeinfo --html --css-ref $CSS $includes -o ${file} ${filename} |
0 | 171 tar cf ${file}-html.tar ${file}/*.html |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
172 texi2dvi $includes -o ${file}.dvi ${filename} </dev/null >/dev/null && dvips -o ${file}.ps ${file}.dvi |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
173 texi2pdf $includes -o ${file}.pdf ${filename} </dev/null |
0 | 174 mkdir -p $DOCSDIR/$file |
175 fi | |
176 done | |
177 | |
111 | 178 # The jit is a special-case, using sphinx rather than texinfo. |
179 # Specifically, the jit docs need sphinx 1.0 or later. | |
180 # | |
181 # The jit/docs Makefile uses the executable $(SPHINXBUILD), | |
182 # defaulting to "sphinx-build". | |
183 # | |
184 # sphinx is packaged in Fedora and EPEL 6 within "python-sphinx", | |
185 # and in openSUSE within "python-Sphinx". | |
186 # | |
187 # For EPEL6, python-sphinx is sphinx 0.6.6, which is missing various | |
188 # directives (e.g. ":c:macro:"), so we need the variant | |
189 # python-sphinx10 package. The latter installs its executable as | |
190 # /usr/bin/sphinx-1.0-build | |
191 # so we need to override SPHINXBUILD with this when invoking "make". | |
192 pushd gcc/gcc/jit/docs | |
193 make SPHINXBUILD=/usr/bin/sphinx-1.0-build html | |
194 popd | |
195 cp -a gcc/gcc/jit/docs/_build/html jit | |
196 mkdir -p $DOCSDIR/jit | |
197 | |
198 # Work around makeinfo generated file names and references with | |
199 # "_002d" instead of "-". | |
200 find . -name '*.html' | while read f; do | |
201 # Do this for the contents of each file. | |
202 sed -i -e 's/_002d/-/g' "$f" | |
203 # And rename files if necessary. | |
204 ff=`echo $f | sed -e 's/_002d/-/g'`; | |
205 if [ "$f" != "$ff" ]; then | |
206 printf "Renaming %s to %s\n" "$f" "$ff" | |
207 mv "$f" "$ff" | |
208 fi | |
209 done | |
210 | |
0 | 211 # Then build a gzipped copy of each of the resulting .html, .ps and .tar files |
212 for file in */*.html *.ps *.pdf *.tar; do | |
213 cat $file | gzip --best > $file.gz | |
214 done | |
215 | |
216 # On the 15th of the month, wipe all the old files from the | |
217 # web server. | |
218 today=`date +%d` | |
219 if test $today = 15; then | |
220 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm | |
221 for m in $MANUALS; do | |
222 rm -f $DOCSDIR/$m/*.html $DOCSDIR/$m/*.html.gz | |
223 done | |
224 fi | |
225 | |
226 # And copy the resulting files to the web server | |
227 for file in */*.html *.ps *.pdf *.tar; do | |
228 if [ -f $DOCSDIR/$file ]; then | |
229 cat $DOCSDIR/$file | | |
230 sed -e '/^<meta name=generator/d' \ | |
231 -e '/^%DVIPSSource:/d' > file1 | |
232 fi | |
233 cat $file | | |
234 sed -e '/^<meta name=generator/d' \ | |
235 -e '/^%DVIPSSource:/d' > file2 | |
236 if cmp -s file1 file2; then | |
237 : | |
238 else | |
239 cp $file $DOCSDIR/$file | |
240 cp $file.gz $DOCSDIR/$file.gz | |
241 fi | |
242 done | |
243 | |
111 | 244 # Again, the jit is a special case, with nested subdirectories |
245 # below "jit", and with some non-HTML files (.png images from us, | |
246 # plus .css and .js supplied by sphinx, and source files, renamed | |
247 # from .rst to .txt). | |
248 find jit \ | |
249 -name "*.html" -o -name "*.png" \ | |
250 -o -name "*.css" -o -name "*.js" \ | |
251 -o -name "*.txt" | | |
252 while read file ; do | |
253 # Note that $file here will contain path fragments beginning | |
254 # with "jit/", e.g. "jit/cp/topics/functions.html" | |
255 mkdir -p $(dirname $DOCSDIR/$file) | |
256 cp $file $DOCSDIR/$file | |
257 done | |
258 | |
0 | 259 cd $DOCSDIR |
260 | |
261 # Finally, generate the installation documentation | |
262 if [ "$RELEASE" = "trunk" ]; then | |
263 SOURCEDIR=$WORKDIR/gcc/gcc/doc | |
264 DESTDIR=$WWWBASE_PREFORMATTED/install | |
265 export SOURCEDIR | |
266 export DESTDIR | |
267 $WORKDIR/gcc/gcc/doc/install.texi2html | |
268 | |
269 # Preprocess the entire web site, not just the install docs! | |
270 echo "Invoking $WWWPREPROCESS" | |
271 $WWWPREPROCESS |grep -v '^ Warning: Keeping' | |
272 fi | |
273 | |
274 # Clean up behind us. | |
275 | |
276 rm -rf $WORKDIR |