mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-05 11:30:07 +08:00
729e3d3f01
2001-11-02 Phil Edwards <pme@gcc.gnu.org> * config/io/c_io_stdio.h: Correct grammar in comments. * docs/doxygen/Intro.3: Expand "top-level" man page. * docs/doxygen/doxygroups.cc: New module definitions (comments). * docs/doxygen/mainpage.doxy: Tweaks. * docs/doxygen/run_doxygen: Update Doxygen version, massage man pages. Add @file hooks so that headers are considered to be documented. * include/bits/basic_ios.h, include/bits/basic_file.h, include/bits/basic_string.h, include/bits/boost_concept_check.h, include/bits/char_traits.h, include/bits/codecvt.h, include/bits/concept_check.h, include/bits/cpp_type_traits.h, include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h, include/bits/indirect_array.h, include/bits/ios_base.h, include/bits/locale_facets.h, include/bits/localefwd.h, include/bits/mask_array.h, include/bits/pthread_allocimpl.h, include/bits/slice.h, include/bits/slice_array.h, include/bits/std_algorithm.h, include/bits/std_bitset.h, include/bits/std_complex.h, include/bits/std_deque.h, include/bits/std_fstream.h, include/bits/std_functional.h, include/bits/std_iomanip.h, include/bits/std_ios.h, include/bits/std_iosfwd.h, include/bits/std_iostream.h, include/bits/std_istream.h, include/bits/std_iterator.h, include/bits/std_limits.h, include/bits/std_list.h, include/bits/std_locale.h, include/bits/std_map.h, include/bits/std_memory.h, include/bits/std_numeric.h, include/bits/std_ostream.h, include/bits/std_queue.h, include/bits/std_set.h, include/bits/std_sstream.h, include/bits/std_stack.h, include/bits/std_streambuf.h, include/bits/std_string.h, include/bits/std_utility.h, include/bits/std_valarray.h, include/bits/std_vector.h, include/bits/stl_algo.h, include/bits/stl_alloc.h, include/bits/stl_bvector.h, include/bits/stl_construct.h, include/bits/stl_deque.h, include/bits/stl_heap.h, include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h, include/bits/stl_iterator_base_types.h, include/bits/stl_list.h, include/bits/stl_map.h, include/bits/stl_multimap.h, include/bits/stl_multiset.h, include/bits/stl_numeric.h, include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h, include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h, include/bits/stl_relops.h, include/bits/stl_set.h, include/bits/stl_stack.h, include/bits/stl_tempbuf.h, include/bits/stl_threads.h, include/bits/stl_tree.h, include/bits/stl_uninitialized.h, include/bits/stl_vector.h, include/bits/stream_iterator.h, include/bits/streambuf_iterator.h, include/bits/stringfwd.h, include/bits/type_traits.h, include/bits/valarray_array.h, include/bits/valarray_meta.h: Add hooks, tweak comments only. * include/bits/stl_algobase.h (swap, min, iter_swap): Also document these functions. * include/bits/stl_function.h: Tweak link comments. From-SVN: r46717
181 lines
5.1 KiB
Bash
181 lines
5.1 KiB
Bash
#!/bin/sh
|
|
|
|
# Runs doxygen and massages the output files.
|
|
#
|
|
# Synopsis: run_doxygen --mode=[user|maint] v3srcdir v3builddir
|
|
#
|
|
# Originally hacked together by Phil Edwards <pme@sources.redhat.com>
|
|
|
|
|
|
# We can check now that the version of doxygen is >= this variable.
|
|
DOXYVER=1.2.10
|
|
doxygen=
|
|
|
|
find_doxygen() {
|
|
v_required=`echo $DOXYVER | \
|
|
awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'`
|
|
testing_version=
|
|
# 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
|
|
}
|
|
|
|
print_usage() {
|
|
cat 1>&2 <<EOF
|
|
Usage: run_doxygen --mode=MODE [<options>] <src-dir> <output-dir>
|
|
MODE is one of:
|
|
maint Generate maintainers' documentation (lots more;
|
|
exposes non-public members, etc).
|
|
user Generate user-level library documentation.
|
|
|
|
more options when i think of them
|
|
|
|
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 ;;
|
|
--mode | --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
|
|
outdir=${o}/docs/doxygen
|
|
else
|
|
echo run_doxygen error: Too many arguments 1>&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
|
|
# script begins here
|
|
mode=unset
|
|
srcdir=unset
|
|
outdir=unset
|
|
|
|
parse_options $*
|
|
find_doxygen
|
|
|
|
if test $srcdir = unset || test $outdir = unset || test $mode = 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
|
|
xuser | xmaint) ;; # ochen khorosho
|
|
*)
|
|
echo run_doxygen error: $mode is an invalid mode 1>&2
|
|
exit 1 ;;
|
|
esac
|
|
|
|
rm -rf $outdir
|
|
mkdir -p $outdir
|
|
chmod u+w $outdir
|
|
(
|
|
set -e
|
|
cd $srcdir
|
|
sed -e "s=@outdir@=${outdir}=" \
|
|
-e "s=@srcdir@=${srcdir}=" \
|
|
docs/doxygen/${mode}.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 $?
|
|
)
|
|
|
|
# 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>").
|
|
cd $outdir/man/man3 && {
|
|
echo :: Fixing up the man pages...
|
|
|
|
# File names with embedded spaces (EVIL!) need to be....? renamed or removed?
|
|
find . -name "* *" -print0 | xargs -0 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 std.3 Namespace_Std.3
|
|
|
|
# man pages are for functions/types/other entities, not source files directly
|
|
find . -name "[a-z]*" -a ! -name "std_*" -print | xargs rm
|
|
rm -f *.h.3 *config* *.cc.3 *.tcc.3
|
|
|
|
# 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}/docs/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 '/#include </s/.*<\(.*\)>.*/\1/p' $f`
|
|
newh=`echo $oldh | ./stdheader`
|
|
sed "s=${oldh}=${newh}=" $f > TEMP
|
|
mv TEMP $f
|
|
done
|
|
rm stdheader
|
|
|
|
cp ${srcdir}/docs/doxygen/Intro.3 .
|
|
|
|
}
|
|
|
|
# all done
|
|
echo ::
|
|
echo :: Doxygen output begins with
|
|
echo :: ${outdir}/html_${mode}/index.html
|
|
echo ::
|
|
echo :: Man pages in ${outdir}/man
|
|
echo ::
|
|
|
|
exit 0
|
|
|
|
# vim:ts=4:et:
|
|
|