* class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
[official-gcc.git] / maintainer-scripts / update_web_docs
blob5a3d3290c866ef0eb37330a1e071473f03d2b265
1 #!/bin/sh -x
3 # Generate HTML documentation from GCC Texinfo docs.
4 # This version is for GCC 3.1 and later versions.
6 # Run this from /tmp.
7 CVSROOT=/cvs/gcc
8 export CVSROOT
10 PATH=/usr/local/bin:$PATH
12 WWWBASE=/www/gcc/htdocs
13 WWWBASE_PREFORMATTED=/www/gcc/htdocs-preformatted
14 WWWPREPROCESS='/www/gcc/bin/preprocess -r'
16 # Process options -rrelease and -ddirectory
17 RELEASE=""
18 SUBDIR=""
20 while [ $# -gt 0 ]; do
21 case $1 in
22 -r*)
23 if [ -n "$RELEASE" ]; then
24 echo "Multiple releases specified" >&2
25 exit 1
27 RELEASE="${1#-r}"
28 if [ -z "$RELEASE" ]; then
29 shift
30 RELEASE="$1"
31 if [ -z "$RELEASE" ]; then
32 echo "No release specified with -r" >&2
33 exit 1
37 -d*)
38 if [ -n "$SUBDIR" ]; then
39 echo "Multiple subdirectories specified" >&2
40 exit 1
42 SUBDIR="${1#-d}"
43 if [ -z "$SUBDIR" ]; then
44 shift
45 SUBDIR="$1"
46 if [ -z "$SUBDIR" ]; then
47 echo "No subdirectory specified with -d" >&2
48 exit 1
53 echo "Unknown argument \"$1\"" >&2
54 exit 1
56 esac
57 shift
58 done
60 if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then
61 echo "Release specified without subdirectory" >&2
62 exit 1
65 if [ -z "$SUBDIR" ]; then
66 DOCSDIR=$WWWBASE/onlinedocs
67 else
68 DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR
71 if [ ! -d $DOCSDIR ]; then
72 mkdir $DOCSDIR
75 if [ -z "$RELEASE" ]; then
76 RELEASE=HEAD
77 DO_THANKS_HTML=y
78 else
79 DO_THANKS_HTML=n
82 WORKDIR=/tmp/gcc-doc-update.$$
84 /bin/rm -rf $WORKDIR
85 /bin/mkdir $WORKDIR
86 cd $WORKDIR
88 # Find all the texi files in the repository, except those in directories
89 # we do not care about (texinfo, etc).
90 find $CVSROOT/gcc -name \*.texi,v -print | fgrep -v -f/home/gccadmin/scripts/doc_exclude | sed -e s#$CVSROOT/##g -e s#,v##g -e s#Attic/##g > FILES
93 # Checkout all the texi files.
94 cvs -Q co -r$RELEASE `cat FILES` gcc/gcc/doc/install.texi2html gcc/gcc/doc/include/texinfo.tex
96 # The directory to pass to -I; this is the one with texinfo.tex
97 # and fdl.texi.
98 includedir=gcc/gcc/doc/include
100 MANUALS="cpp chill cppinternals gcc gccint gcj g77 gnat-style libiberty porting"
102 # Now convert the relevant files from texi to HTML and PostScript.
103 for file in $MANUALS; do
104 filename=`find . -name ${file}.texi`
105 if [ "${filename}" ]; then
106 makeinfo --html -I ${includedir} -I `dirname ${filename}` ${filename}
107 texi2dvi -I ${includedir} ${filename} </dev/null && dvips -o ${file}.ps ${file}.dvi
108 mkdir -p $DOCSDIR/$file
110 done
112 # Then build a gzipped copy of each of the resulting .html and .ps files
113 for file in */*.html *.ps; do
114 cat $file | gzip --best > $file.gz
115 done
117 # On the 15th of the month, wipe all the old files from the
118 # web server.
119 today=`date +%d`
120 if test $today = 15; then
121 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm
122 for m in $MANUALS; do
123 rm $DOCSDIR/$m/*.html
124 done
127 # And copy the resulting html files to the web server
128 for file in */*.html *.ps; do
129 cat $DOCSDIR/$file |
130 sed -e '/^<meta name=generator/d' \
131 -e '/^%DVIPSSource:/d' > file1
132 cat $file |
133 sed -e '/^<meta name=generator/d' \
134 -e '/^%DVIPSSource:/d' > file2
135 if cmp -s file1 file2; then
137 else
138 cp $file $DOCSDIR/$file
139 cp $file.gz $DOCSDIR/$file.gz
141 done
143 news_file=g77/News.html
144 bugs_file=g77/Trouble.html
145 contrib_file=gcc/Contributors.html
147 cd $DOCSDIR
149 rm -f g77_news.html
150 rm -f g77_bugs.html
151 rm -f g77_news.html.gz
152 rm -f g77_bugs.html.gz
153 ln $news_file g77_news.html
154 ln $bugs_file g77_bugs.html
155 ln ${news_file}.gz g77_news.html.gz
156 ln ${bugs_file}.gz g77_bugs.html.gz
158 if [ "$DO_THANKS_HTML" = y ]; then
159 cd $WWWBASE
160 rm -f thanks.html
161 rm -f thanks.html.gz
162 ln onlinedocs/$contrib_file thanks.html
163 ln onlinedocs/${contrib_file}.gz thanks.html.gz
166 # Finally, generate the installation documentation (but only for CVS HEAD).
167 if [ "$RELEASE" = "HEAD" ]; then
168 SOURCEDIR=$WORKDIR/gcc/gcc/doc
169 DESTDIR=$WWWBASE_PREFORMATTED/install
170 export SOURCEDIR
171 export DESTDIR
172 $WORKDIR/gcc/gcc/doc/install.texi2html
174 # Preprocess the entire web site, not just the install docs!
175 echo "Invoking $WWWPREPROCESS"
176 $WWWPREPROCESS |grep -v '^ Warning: Keeping'
179 # Clean up behind us.
181 rm -rf $WORKDIR