This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] find doxygen in user's PATH
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Subject: [v3] find doxygen in user's PATH
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Thu, 5 Apr 2001 17:25:51 -0400
Simple test to find doxygen in the path rather than calling it blindly.
This way we can warn a user who tries to "make doxygen" without having
doxygen installed.
Committed on trunk.
2001-04-05 Phil Edwards <pme@sources.redhat.com>
* docs/doxygen/run_doxygen: Check for the existence of Doxygen.
Index: docs/doxygen/run_doxygen
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/doxygen/run_doxygen,v
retrieving revision 1.2
diff -u -3 -p -r1.2 run_doxygen
--- run_doxygen 2001/03/25 02:28:07 1.2
+++ run_doxygen 2001/04/05 21:08:09
@@ -8,10 +8,31 @@
# $Id: run_doxygen,v 1.2 2001/03/25 02:28:07 pme Exp $
-# We could check that the version of doxygen is >= this variable, but that's
-# just a pain. Punt for now and rely on the maintainer to read this. :-)
+# We can check now that the version of doxygen is = this variable. We need
+# to check for the >= case eventually.
DOXYVER=1.2.6
+doxygen=
+find_doxygen() {
+ 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" && test $testing_version = $DOXYVER; then
+ doxygen="$maybedoxy"
+ break
+ 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>
@@ -74,6 +95,7 @@ srcdir=unset
outdir=unset
parse_options $*
+find_doxygen
if test $srcdir = unset || test $outdir = unset || test $mode = unset; then
# this could be better
@@ -96,7 +118,8 @@ test -d $outdir || (mkdir -p $outdir ; c
cd $srcdir
sed -e "s=@outdir@=${outdir}=" docs/doxygen/${mode}.cfg.in \
> ${outdir}/${mode}.cfg
- doxygen ${outdir}/${mode}.cfg
+ echo $doxygen ${outdir}/${mode}.cfg
+ $doxygen ${outdir}/${mode}.cfg
)
# mess with output files here?
@@ -107,4 +130,6 @@ echo :: ${outdir}/html_${mode}/index.htm
echo ::
exit 0
+
+# vim:ts=4:et:
--