URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [maintainer-scripts/] [update_web_docs_svn] - Rev 821
Go to most recent revision | Compare with Previous | Blame | View Log
#!/bin/sh# Generate HTML documentation from GCC Texinfo docs.# This version is for GCC 3.1 and later versions.set -e# Run this from /tmp.SVNROOT=${SVNROOT:-"file:///svn/gcc"}export SVNROOTPATH=/usr/local/bin:$PATHMANUALS="cppcppinternalsfastjargccgccgogccintgcjgfortrangfc-internalsgnat_ug_unxgnat_ug_vmsgnat_ug_vxwgnat_ug_wntgnat_ugn_unwgnat-stylegnat_rmlibgomplibquadmathlibibertyporting"WWWBASE=/www/gcc/htdocsWWWBASE_PREFORMATTED=/www/gcc/htdocs-preformattedWWWPREPROCESS='/www/gcc/bin/preprocess -r'# Process options -rrelease and -ddirectoryRELEASE=""SUBDIR=""while [ $# -gt 0 ]; docase $1 in-r*)if [ -n "$RELEASE" ]; thenecho "Multiple releases specified" >&2exit 1fiRELEASE="${1#-r}"if [ -z "$RELEASE" ]; thenshiftRELEASE="$1"if [ -z "$RELEASE" ]; thenecho "No release specified with -r" >&2exit 1fifi;;-d*)if [ -n "$SUBDIR" ]; thenecho "Multiple subdirectories specified" >&2exit 1fiSUBDIR="${1#-d}"if [ -z "$SUBDIR" ]; thenshiftSUBDIR="$1"if [ -z "$SUBDIR" ]; thenecho "No subdirectory specified with -d" >&2exit 1fifi;;*)echo "Unknown argument \"$1\"" >&2exit 1;;esacshiftdoneif [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; thenecho "Release specified without subdirectory" >&2exit 1fiif [ -z "$SUBDIR" ]; thenDOCSDIR=$WWWBASE/onlinedocselseDOCSDIR=$WWWBASE/onlinedocs/$SUBDIRfiif [ ! -d $DOCSDIR ]; thenmkdir $DOCSDIRchmod g+w $DOCSDIRfiif [ -z "$RELEASE" ]; thenRELEASE=trunkfiWORKDIR=/tmp/gcc-doc-update.$$rm -rf $WORKDIRmkdir $WORKDIRcd $WORKDIRif [ "$RELEASE" = "trunk" ]; thensvn -q export $SVNROOT/$RELEASE gccelsesvn -q export $SVNROOT/tags/$RELEASE gccfi# Remove all unwanted files. This is needed (a) to build the Ada# generator programs with the installed library, not the new one and# (b) to avoid packaging all the sources instead of only documentation# sources.find gcc -type f \( -name '*.texi' \-o -path gcc/gcc/doc/install.texi2html \-o -path gcc/gcc/doc/include/texinfo.tex \-o -path gcc/gcc/ada/xgnatugn.adb \-o -path gcc/gcc/ada/ug_words \-o -path gcc/gcc/BASE-VER \-o -path gcc/gcc/DEV-PHASE \-o -print0 \) | xargs -0 rm -f# Build a tarball of the sources.tar cf docs-sources.tar gcc# The directory to pass to -I; this is the one with texinfo.tex# and fdl.texi.includedir=gcc/gcc/doc/include# Generate gnat_ugn_unwif [ -f gcc/gcc/ada/xgnatugn.adb ]; thengnatmake -q gcc/gcc/ada/xgnatugn./xgnatugn unw gcc/gcc/ada/gnat_ugn.texi \gcc/gcc/ada/ug_words gnat_ugn_unw.texifi# Generate gcc-vers.texi.(echo "@set version-GCC $(cat gcc/gcc/BASE-VER)"if [ "$(cat gcc/gcc/DEV-PHASE)" = "experimental" ]; thenecho "@set DEVELOPMENT"elseecho "@clear DEVELOPMENT"fiecho "@set srcdir $WORKDIR/gcc/gcc"echo "@set VERSION_PACKAGE (GCC)"echo "@set BUGURL @uref{http://gcc.gnu.org/bugs/}") > $includedir/gcc-vers.texi# Generate libquadmath-vers.texi.echo "@set BUGURL @uref{http://gcc.gnu.org/bugs/}" \> $includedir/libquadmath-vers.texi# Now convert the relevant files from texi to HTML, PDF and PostScript.for file in $MANUALS; dofilename=`find . -name ${file}.texi`if [ "${filename}" ]; thenincludes="-I ${includedir} -I `dirname ${filename}`"if [ "$file" = "gnat_ugn_unw" ]; thenincludes="$includes -I gcc/gcc/ada"fimakeinfo --html $includes -o ${file} ${filename}tar cf ${file}-html.tar ${file}/*.htmltexi2dvi $includes -o ${file}.dvi ${filename} </dev/null >/dev/null && dvips -o ${file}.ps ${file}.dvitexi2pdf $includes -o ${file}.pdf ${filename} </dev/nullmkdir -p $DOCSDIR/$filefidone# Then build a gzipped copy of each of the resulting .html, .ps and .tar filesfor file in */*.html *.ps *.pdf *.tar; docat $file | gzip --best > $file.gzdone# On the 15th of the month, wipe all the old files from the# web server.today=`date +%d`if test $today = 15; thenfind $DOCSDIR -type f -maxdepth 1 -print | grep -v index.html | xargs rmfor m in $MANUALS; dorm -f $DOCSDIR/$m/*.html $DOCSDIR/$m/*.html.gzdonefi# And copy the resulting files to the web serverfor file in */*.html *.ps *.pdf *.tar; doif [ -f $DOCSDIR/$file ]; thencat $DOCSDIR/$file |sed -e '/^<meta name=generator/d' \-e '/^%DVIPSSource:/d' > file1ficat $file |sed -e '/^<meta name=generator/d' \-e '/^%DVIPSSource:/d' > file2if cmp -s file1 file2; then:elsecp $file $DOCSDIR/$filecp $file.gz $DOCSDIR/$file.gzfidonecd $DOCSDIR# Finally, generate the installation documentationif [ "$RELEASE" = "trunk" ]; thenSOURCEDIR=$WORKDIR/gcc/gcc/docDESTDIR=$WWWBASE_PREFORMATTED/installexport SOURCEDIRexport DESTDIR$WORKDIR/gcc/gcc/doc/install.texi2html# Preprocess the entire web site, not just the install docs!echo "Invoking $WWWPREPROCESS"$WWWPREPROCESS |grep -v '^ Warning: Keeping'fi# Clean up behind us.rm -rf $WORKDIR
Go to most recent revision | Compare with Previous | Blame | View Log
