diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-11 00:01:33 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-11 00:01:33 +0000 |
commit | 2aad0282e79bee5d49dfd0f76d5c72f6c6912156 (patch) | |
tree | 9c37bc44363d015d83f53e9ff733daf4affc1973 /libstdc++-v3/scripts | |
parent | 90a6366aaa90e4e3c7bf9af1b57df621241589a0 (diff) | |
download | gcc-2aad0282e79bee5d49dfd0f76d5c72f6c6912156.tar.gz |
2008-02-10 Benjamin Kosnik <bkoz@redhat.com>
Convert documentation to DocBook.
* doc/Makefile.am (doc-doxygen-html): Changed to doc-html-doxygen.
(doc-doxygen-man): Changed to doc-man-doxygen.
(doc-performance): Changed to doc-html-performance.
(doc-xml-doxygen): New.
(doc-xml-single): New.
(doc-xml-validate): New.
(doc-html): New.
(doc-html-single): New.
(doc-fo): New.
(doc-pdf): New.
(doc-pdf-fop-xml): New.
(doc-pdf-fop-fo): New.
(doc-pdf-xmlto): New.
(doc-pdf-xmlroff): New.
(doc-pdf-prince): New.
* doc/xml: New directory.
* doc/xml/authors.xml: New.
* doc/xml/images: New directory.
* doc/xml/images/confdeps.png: Add.
* doc/xml/images/confdeps.dot: Add.
* doc/xml/faq.xml: New.
* doc/xml/api.xml: New.
* doc/xml/gnu: New directory.
* doc/xml/gnu/gpl-3.0.xml: New.
* doc/xml/gnu/fdl-1.2.xml: New.
* doc/xml/gnu/gpl-2.0.xml: New.
* doc/xml/manual: New directory.
* doc/xml/manual/mt_allocator.xml: New.
* doc/xml/manual/allocator.xml: New.
* doc/xml/manual/ctype.xml: New.
* doc/xml/manual/numerics.xml: New.
* doc/xml/manual/codecvt.xml: New.
* doc/xml/manual/concurrency.xml: New.
* doc/xml/manual/backwards_compatibility.xml: New.
* doc/xml/manual/intro.xml: New.
* doc/xml/manual/shared_ptr.xml: New.
* doc/xml/manual/abi.xml: New.
* doc/xml/manual/status_cxxtr1.xml: New.
* doc/xml/manual/auto_ptr.xml: New.
* doc/xml/manual/build.xml: New.
* doc/xml/manual/internals.xml: New.
* doc/xml/manual/parallel_mode.xml: New.
* doc/xml/manual/status_cxx1998.xml: New.
* doc/xml/manual/containers.xml: New.
* doc/xml/manual/io.xml: New.
* doc/xml/manual/appendix_porting.xml: New.
* doc/xml/manual/utilities.xml: New.
* doc/xml/manual/bitmap_allocator.xml: New.
* doc/xml/manual/support.xml: New.
* doc/xml/manual/configure.xml: New.
* doc/xml/manual/build_hacking.xml: New.
* doc/xml/manual/evolution.xml: New.
* doc/xml/manual/using.xml: New.
* doc/xml/manual/debug.xml: New.
* doc/xml/manual/localization.xml: New.
* doc/xml/manual/strings.xml: New.
* doc/xml/manual/debug_mode.xml: New.
* doc/xml/manual/locale.xml: New.
* doc/xml/manual/extensions.xml: New.
* doc/xml/manual/appendix_contributing.xml: New.
* doc/xml/manual/messages.xml: New.
* doc/xml/manual/diagnostics.xml: New.
* doc/xml/manual/appendix_free.xml: New.
* doc/xml/manual/algorithms.xml: New.
* doc/xml/manual/iterators.xml: New.
* doc/xml/manual/spine.xml: New.
* doc/xml/manual/test.xml: New.
* doc/xml/manual/status_cxx200x.xml: New.
* doc/xml/spine.xml: New.
* doc/xml/book.txml: New. Template file.
* doc/xml/chapter.txml: Same.
* doc/xml/class.txml: Same.
* doc/doxygen/guide.html: Removed, integrated into other docs.
* doc/doxygen/user.cfg.in: Clean up XML generation.
* doc/doxygen/run_doxygen: Move to..
* scripts/run_doxygen: ...here.
* configure: Regenerate.
* Makefile.in: Regenerate.
* src/Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
* po/Makefile.in: Regenerate.
* libmath/Makefile.in: Regenerate.
* include/Makefile.in: Regenerate.
* libsupc++/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/scripts')
-rw-r--r-- | libstdc++-v3/scripts/run_doxygen | 346 |
1 files changed, 346 insertions, 0 deletions
diff --git a/libstdc++-v3/scripts/run_doxygen b/libstdc++-v3/scripts/run_doxygen new file mode 100644 index 00000000000..48e40ba8615 --- /dev/null +++ b/libstdc++-v3/scripts/run_doxygen @@ -0,0 +1,346 @@ +#!/bin/bash + +# Runs doxygen and massages the output files. +# Copyright (C) 2001, 2002, 2003, 2004, 2008 Free Software Foundation, Inc. +# +# Synopsis: run_doxygen --mode=[html|man|xml] --host_alias=<alias> \ +# v3srcdir v3builddir +# +# Originally hacked together by Phil Edwards <pme@gcc.gnu.org> + + +# We can check now that the version of doxygen is >= this variable. +DOXYVER=1.5.4 + +find_doxygen() { + local -r v_required=`echo $DOXYVER | \ + awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'` + local testing_version doxygen maybedoxy v_found + # thank you goat book + set `IFS=:; X="$PATH:/usr/local/bin:/bin:/usr/bin"; echo $X` + for dir + do + # AC_EXEEXT could come in useful here + maybedoxy="$dir/doxygen" + test -f "$maybedoxy" && testing_version=`$maybedoxy --version` + if test -n "$testing_version"; then + v_found=`echo $testing_version | \ + awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'` + if test $v_found -ge $v_required; then + doxygen="$maybedoxy" + break + fi + fi + done + if test -z "$doxygen"; then + echo run_doxygen error: Could not find Doxygen $DOXYVER in path. 1>&2 + print_usage + fi + # We need to use other tools from the same package/version. + echo :: Using Doxygen tools from ${dir}. + PATH=$dir:$PATH + hash -r +} + +print_usage() { + cat 1>&2 <<EOF +Usage: run_doxygen --mode=MODE --host_alias=BUILD_ALIAS [<options>] + <v3-src-dir> <v3-build-dir> + MODE is one of: + html Generate user-level HTML library documentation. + man Generate user-level man pages. + xml Generate user-level XML pages. + + BUILD_ALIAS is the GCC build alias set at configure time. + +Note: Requires Doxygen ${DOXYVER} or later; get it at + ftp://ftp.stack.nl/pub/users/dimitri/doxygen-${DOXYVER}.src.tar.gz + +EOF + exit 1 +} + +parse_options() { + for o + do + # Blatantly ripped from autoconf, er, I mean, "gratefully standing + # on the shoulders of those giants who have gone before us." + case "$o" in + -*=*) arg=`echo "$o" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) arg= ;; + esac + + case "$o" in + --mode=*) + mode=$arg ;; + --host_alias=*) + host_alias=$arg ;; + --mode | --host_alias | --help | -h) + print_usage ;; + *) + # this turned out to be a mess, maybe change to --srcdir=, etc + if test $srcdir = unset; then + srcdir=$o + elif test $outdir = unset; then + builddir=${o} + outdir=${o}/doc/doxygen + else + echo run_doxygen error: Too many arguments 1>&2 + exit 1 + fi + ;; + esac + done +} + + +# script begins here +mode=unset +host_alias=unset +srcdir=unset +outdir=unset +do_html=false +do_man=false +do_xml=false +enabled_sections= +generate_tagfile= +DATEtext=`date '+%Y-%m-%d'` + +# Show how this script is called. +echo run_doxygen $* + +parse_options $* +find_doxygen + +if test $srcdir = unset || test $outdir = unset || test $mode = unset || test $host_alias = unset; then + # this could be better + echo run_doxygen error: You have not given enough information...! 1>&2 + print_usage +fi + +case x"$mode" in + xhtml) + do_html=true + enabled_sections=maint + generate_tagfile="$outdir/html/libstdc++.tag" + ;; + xman) + do_man=true + ;; + xxml) + do_xml=true + enabled_sections=maint + ;; + *) + echo run_doxygen error: $mode is an invalid mode 1>&2 + exit 1 ;; +esac + +mkdir -p $outdir +chmod u+w $outdir + +# work around a stupid doxygen bug +if $do_man; then + mkdir -p $outdir/man/man3/ext + chmod -R u+w $outdir/man/man3/ext +fi + +if $do_xml; then + mkdir -p $outdir/xml +fi + +( + set -e + cd $builddir + sed -e "s=@outdir@=${outdir}=g" \ + -e "s=@srcdir@=${srcdir}=g" \ + -e "s=@builddir@=${builddir}=g" \ + -e "s=@host_alias@=${host_alias}=g" \ + -e "s=@html_output_dir@=html=" \ + -e "s=@enabled_sections@=${enabled_sections}=" \ + -e "s=@do_html@=${do_html}=" \ + -e "s=@do_man@=${do_man}=" \ + -e "s=@do_xml@=${do_xml}=" \ + -e "s=@generate_tagfile@=${generate_tagfile}=" \ + ${srcdir}/doc/doxygen/user.cfg.in > ${outdir}/${mode}.cfg + echo :: NOTE that this may take some time... + echo doxygen ${outdir}/${mode}.cfg + doxygen ${outdir}/${mode}.cfg + echo :: Finished, exit code was $? +) +ret=$? +test $ret -ne 0 && exit $ret + +if $do_html; then + cd ${outdir}/html + + #doxytag -t libstdc++.tag . > /dev/null 2>&1 + sed -e '/<path>/d' libstdc++.tag > TEMP + mv TEMP libstdc++.tag + + sed -e "s=@DATE@=${DATEtext}=" \ + ${srcdir}/doc/doxygen/mainpage.html > index.html + + # The following bit of line noise changes annoying + # std::foo < typename _Ugly1, typename _Ugly2, .... _DefaultUgly17 > + # to user-friendly + # std::foo + # in the major "Compound List" page. + sed -e 's=\(::[[:alnum:]_]*\)< .* >=\1=' annotated.html > annstrip.html + mv annstrip.html annotated.html + + # Work around a bug in doxygen 1.3. +# for f in class*html struct*html; do + for f in class*html; do + sed '1,10s!^<title> Template!<title>Template !' $f > TEMP + mv TEMP $f + done + + cp ${srcdir}/doc/doxygen/tables.html tables.html + echo :: + echo :: HTML pages begin with + echo :: ${outdir}/html/index.html +fi + +# Mess with the man pages. We don't need documentation of the internal +# headers, since the man pages for those contain nothing useful anyhow. The +# man pages for doxygen modules need to be renamed (or deleted). And the +# generated #include lines need to be changed from the internal names to the +# standard ones (e.g., "#include <stl_tempbuf.h>" -> "#include <memory>"). +if $do_man; then +echo :: +echo :: Fixing up the man pages... +cd $outdir/man/man3 + +# here's the other end of the "stupid doxygen bug" mentioned above +rm -rf ext + +# File names with embedded spaces (EVIL!) need to be....? renamed or removed? +find . -name "* *" -print0 | xargs -0r rm # requires GNU tools + +# can leave SGIextensions.3 alone, it's an okay name +mv s20_3_1_base.3 Intro_functors.3 +mv s20_3_2_arithmetic.3 Arithmetic_functors.3 +mv s20_3_3_comparisons.3 Comparison_functors.3 +mv s20_3_4_logical.3 Logical_functors.3 +mv s20_3_5_negators.3 Negation_functors.3 +#mv s20_3_6_binder.3 Binder_functors.3 +mv s20_3_7_adaptors.3 Func_ptr_functors.3 +mv s20_3_8_memadaptors.3 Member_ptr_functors.3 +mv iterator_tags.3 Iterator_types.3 +mv std.3 Namespace_std.3 +mv __gnu_cxx.3 Namespace___gnu_cxx.3 + +# man pages are for functions/types/other entities, not source files +# directly. who the heck would type "man foo.h" anyhow? +find . -name "[a-z]*" -a ! -name "std_*" -print | xargs rm +rm -f *.h.3 *config* *.cc.3 *.tcc.3 *_t.3 +# this is used to examine what we would have deleted, for debugging +#mkdir trash +#find . -name "[a-z]*" -a ! -name "std_*" -print | xargs -i mv {} trash +#mv *.h.3 *config* *.cc.3 *.tcc.3 *_t.3 trash + +# Standardize the displayed header names. If anyone who knows perl cares +# enough to rewrite all this, feel free. This only gets run once a century, +# and I'm off getting coffee then anyhow, so I didn't care enough to make +# this super-fast. +g++ ${srcdir}/doc/doxygen/stdheader.cc -o ./stdheader +problematic=`egrep -l '#include <.*_.*>' [a-z]*.3` +for f in $problematic; do + # this is also slow, but safe and easy to debug + oldh=`sed -n '/fC#include </s/.*<\(.*\)>.*/\1/p' $f` + newh=`echo $oldh | ./stdheader` + sed "s=${oldh}=${newh}=" $f > TEMP + mv TEMP $f +done +rm stdheader + +# Some of the pages for generated modules have text that confuses certain +# implementations of man(1), e.g., Linux's. We need to have another top-level +# *roff tag to /stop/ the .SH NAME entry. +#problematic=`egrep --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3` +problematic='Containers.3 Sequences.3 Assoc_containers.3 Iterator_types.3' +for f in $problematic; do + sed '/^\.SH NAME/{ +n +a\ +\ +.SH SYNOPSIS + }' $f > TEMP + mv TEMP $f +done + +# Also, break this (generated) line up. It's ugly as sin. +problematic=`grep -l '[^^]Definition at line' *.3` +for f in $problematic; do + sed 's/Definition at line/\ +.PP\ +&/' $f > TEMP + mv TEMP $f +done + +cp ${srcdir}/doc/doxygen/Intro.3 C++Intro.3 + +# Why didn't I do this at the start? Were rabid weasels eating my brain? +# Who the fsck would "man std_vector" when the class isn't named that? + +# First, deal with nested namespaces. +for f in *__detail_*; do + newname=`echo $f | sed 's/__detail_/__detail::/'` + mv $f $newname +done +for f in *__parallel_*; do + newname=`echo $f | sed 's/__parallel_/__parallel::/'` + mv $f $newname +done + +# Then, clean up other top-level namespaces. +for f in std_tr1_*; do + newname=`echo $f | sed 's/^std_tr1_/std::tr1::/'` + mv $f $newname +done +for f in std_*; do + newname=`echo $f | sed 's/^std_/std::/'` + mv $f $newname +done +for f in __gnu_cxx_*; do + newname=`echo $f | sed 's/^__gnu_cxx_/__gnu_cxx::/'` + mv $f $newname +done +for f in __gnu_debug_*; do + newname=`echo $f | sed 's/^__gnu_debug_/__gnu_debug::/'` + mv $f $newname +done +for f in __gnu_parallel_*; do + newname=`echo $f | sed 's/^__gnu_parallel_/__gnu_parallel::/'` + mv $f $newname +done + +# Generic removal bits, where there are things in the generated man +# pages that need to be killed. +for f in *_libstdc__-v3_*; do + rm $f +done + +for f in *_src_*; do + rm $f +done + + +# Also, for some reason, typedefs don't get their own man pages. Sigh. +for f in ios streambuf istream ostream iostream stringbuf \ + istringstream ostringstream stringstream filebuf ifstream \ + ofstream fstream string; +do + echo ".so man3/std::basic_${f}.3" > std::${f}.3 + echo ".so man3/std::basic_${f}.3" > std::w${f}.3 +done + +echo :: +echo :: Man pages in ${outdir}/man +fi + +# all done +echo :: + +exit 0 |