3 # Generate HTML documentation from GCC Texinfo docs.
4 # This version is for GCC 3.0.x and earlier versions.
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
20 while [ $# -gt 0 ]; do
23 if [ -n "$RELEASE" ]; then
24 echo "Multiple releases specified" >&2
28 if [ -z "$RELEASE" ]; then
31 if [ -z "$RELEASE" ]; then
32 echo "No release specified with -r" >&2
38 if [ -n "$SUBDIR" ]; then
39 echo "Multiple subdirectories specified" >&2
43 if [ -z "$SUBDIR" ]; then
46 if [ -z "$SUBDIR" ]; then
47 echo "No subdirectory specified with -d" >&2
53 echo "Unknown argument \"$1\"" >&2
60 if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then
61 echo "Release specified without subdirectory" >&2
65 if [ -z "$SUBDIR" ]; then
66 DOCSDIR=$WWWBASE/onlinedocs
68 DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR
71 if [ ! -d $DOCSDIR ]; then
75 if [ -z "$RELEASE" ]; then
82 WORKDIR=/tmp/gcc-doc-update.$$
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/texinfo.tex gcc/gcc/doc/texinfo.tex gcc/gcc/doc/include/texinfo.tex
96 # Find the directory to pass to -I; this is the one with texinfo.tex
98 texitexloc=`find . -name texinfo.tex`
99 includedir=${texitexloc%/*}
101 # Now convert the relevant files from texi to HTML and PostScript.
102 for file in cpp chill cppinternals gcc gcj g77 gnat-style libiberty \
103 objc-features porting; do
104 filename=`find . -name ${file}.texi`
105 if [ "${filename}" ]; then
106 /usr/local/bin/texi2html -glossary -menu -split_chapter -I ${includedir} ${filename}
107 texi2dvi -I ${includedir} ${filename} </dev/null && dvips -o ${file}.ps ${file}.dvi
111 # Then build a gzipped copy of each of the resulting .html and .ps files
112 for file in *.html *.ps; do
113 cat $file | gzip --best > $file.gz
116 # On the 15th of the month, wipe all the old files from the
119 if test $today = 15; then
120 find $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rm
123 # And copy the resulting html files to the web server
124 for file in *.html *.ps; do
126 sed -e '/^<!-- Created on/d' \
127 -e '/^by <I>GCC Administrator<\/I> on/d' \
128 -e '/^%DVIPSSource:/d' > file1
130 sed -e '/^<!-- Created on/d' \
131 -e '/^by <I>GCC Administrator<\/I> on/d' \
132 -e '/^%DVIPSSource:/d' > file2
133 if cmp -s file1 file2; then
136 cp $file ${file}.gz $DOCSDIR
140 news_file=`grep "News About GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
141 bugs_file=`grep "Known Causes of Trouble with GNU Fortran" $DOCSDIR/g77_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
142 contrib_file=`grep "Contributors to GCC" $DOCSDIR/gcc_toc.html | sed -e '/HREF=.*[^.]/ s#^.*HREF="##g' | sed -e 's%#SEC.*%%g'`
148 rm -f g77_news.html.gz
149 rm -f g77_bugs.html.gz
150 ln $news_file g77_news.html
151 ln $bugs_file g77_bugs.html
152 ln ${news_file}.gz g77_news.html.gz
153 ln ${bugs_file}.gz g77_bugs.html.gz
155 if [ "$DO_THANKS_HTML" = y ]; then
159 ln onlinedocs/$contrib_file thanks.html
160 ln onlinedocs/${contrib_file}.gz thanks.html.gz
163 # Finally, generate the installation documentation (but only for CVS HEAD).
164 if [ "$RELEASE" = "HEAD" ]; then
165 SOURCEDIR=$WORKDIR/gcc/gcc/doc
166 DESTDIR=$WWWBASE_PREFORMATTED/install
169 $WORKDIR/gcc/gcc/doc/install.texi2html
171 # Preprocess the entire web site, not just the install docs!
172 echo "Invoking $WWWPREPROCESS"
173 $WWWPREPROCESS |grep -v '^ Warning: Keeping'
176 # Clean up behind us.