#!/bin/sh
#
usage() {
cat <&2
exit 1
fi
module="$1"
shift
document="$1"
shift
quiet="1"
if test $verbose = "1"; then
quiet="0"
fi
if test $uninstalled = yes; then
# this does not work from buiddir!=srcdir
gtkdocdir=`dirname $0`
# traditional Bourne shells may not support -e here, use -f
if test ! -f $gtkdocdir/gtk-doc.xsl; then
# try to src dir (set from makefiles) too
if test -f $ABS_TOP_SRCDIR/gtk-doc.xsl; then
gtkdocdir=$ABS_TOP_SRCDIR
fi
fi
styledir=$gtkdocdir/style
#echo "uninstalled, gtkdocdir=$gtkdocdir, cwd=$PWD"
else
# the first two are needed to resolve datadir
prefix=/usr
datarootdir=${prefix}/share
gtkdocdir=${datarootdir}/gtk-doc/data
styledir=$gtkdocdir
fi
# we could do "$path_option $PWD "
# to avoid needing rewriting entities that are copied from the header
# into docs under xml
if test "X$searchpath" = "X"; then
path_arg=
else
path_arg="--path $searchpath"
fi
# profiling
profile_args=""
if test "$GTKDOC_PROFILE" != ""; then
profile_args="--profile"
fi
#echo /usr/bin/xsltproc $path_arg --nonet --xinclude \
# --stringparam gtkdoc.bookname $module \
# --stringparam gtkdoc.version "1.25" \
# "$@" $gtkdocdir/gtk-doc.xsl "$document"
/usr/bin/xsltproc 2>profile.txt $profile_args $path_arg --nonet --xinclude \
--stringparam gtkdoc.bookname $module \
--stringparam gtkdoc.version "1.25" \
--stringparam chunk.quietly $quiet \
--stringparam chunker.output.quiet $quiet \
"$@" $gtkdocdir/gtk-doc.xsl "$document" || exit $?
# profiling
if test "$GTKDOC_PROFILE" != ""; then
cat profile.txt | gprof2dot.py -e 0.01 -n 0.01 | dot -Tpng -o profile.png
else
rm profile.txt
fi
# copy navigation images and stylesheets to html directory ...
cp -f $styledir/*.png $styledir/*.css ./
echo "timestamp" > ../html.stamp