3 # Generate HTML documentation from GCC Texinfo docs.
4 # This version is for GCC 3.1 and later 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
79 WORKDIR
=/tmp
/gcc-doc-update.$$
85 # Find all the texi files in the repository, except those in directories
86 # we do not care about (texinfo, etc).
87 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
90 # Checkout all the texi files.
91 cvs
-Q export -r$RELEASE `cat FILES` gcc
/gcc
/doc
/install.texi2html gcc
/gcc
/doc
/include
/texinfo.tex
93 # Build a tarball of the sources.
94 tar cf docs-sources.
tar gcc
96 # The directory to pass to -I; this is the one with texinfo.tex
98 includedir
=gcc
/gcc
/doc
/include
100 MANUALS
="cpp cppinternals fastjar gcc gccint gcj g77 gnat_ug_unx gnat_ug_vms gnat_ug_vxw gnat_ug_wnt gnat-style gnat_rm 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 tar cf
${file}-html.
tar ${file}/*.html
108 texi2dvi
-I ${includedir} ${filename} </dev/null && dvips -o ${file}.ps ${file}.dvi
109 mkdir
-p $DOCSDIR/$file
113 # Then build a gzipped copy of each of the resulting .html, .ps and .tar files
114 for file in */*.html
*.ps
*.
tar; do
115 cat $file |
gzip --best > $file.gz
118 # On the 15th of the month, wipe all the old files from the
121 if test $today = 15; then
122 find $DOCSDIR -type f
-maxdepth 1 -print |
grep -v index.html |
xargs rm
123 for m
in $MANUALS; do
124 rm $DOCSDIR/$m/*.html
128 # And copy the resulting files to the web server
129 for file in */*.html
*.ps
*.
tar; do
131 sed -e '/^<meta name=generator/d' \
132 -e '/^%DVIPSSource:/d' > file1
134 sed -e '/^<meta name=generator/d' \
135 -e '/^%DVIPSSource:/d' > file2
136 if cmp -s file1 file2
; then
139 cp $file $DOCSDIR/$file
140 cp $file.gz
$DOCSDIR/$file.gz
146 # Finally, generate the installation documentation (but only for CVS HEAD).
147 if [ "$RELEASE" = "HEAD" ]; then
148 SOURCEDIR
=$WORKDIR/gcc
/gcc
/doc
149 DESTDIR
=$WWWBASE_PREFORMATTED/install
152 $WORKDIR/gcc
/gcc
/doc
/install.texi2html
154 # Preprocess the entire web site, not just the install docs!
155 echo "Invoking $WWWPREPROCESS"
156 $WWWPREPROCESS |
grep -v '^ Warning: Keeping'
159 # Clean up behind us.