--- /dev/null
+dnl AS_DOCBOOK([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl checks if xsltproc can build docbook documentation
+dnl (which is possible if the catalog is set up properly
+dnl I also tried checking for a specific version and type of docbook
+dnl but xsltproc seemed to happily run anyway, so we can't check for that
+dnl and version
+dnl this macro takes inspiration from
+dnl http://www.movement.uklinux.net/docs/docbook-autotools/configure.html
+AC_DEFUN(AS_DOCBOOK,
+[
+ XSLTPROC_FLAGS=--nonet
+ DOCBOOK_ROOT=
+ TYPE_LC=xml
+ TYPE_UC=XML
+ VERSION=4.1.2
+
+ if test ! -f /etc/xml/catalog; then
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+ do
+ if test -d "$i"; then
+ DOCBOOK_ROOT=$i
+ fi
+ done
+ else
+ XML_CATALOG=/etc/xml/catalog
+ CAT_ENTRY_START='<!--'
+ CAT_ENTRY_END='-->'
+ fi
+
+ dnl We need xsltproc to process the test
+ AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+ XSLTPROC_WORKS=no
+ if test -n "$XSLTPROC"; then
+ AC_MSG_CHECKING([whether xsltproc docbook processing works])
+
+ if test -n "$XML_CATALOG"; then
+ DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ else
+ DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+ fi
+ $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook $TYPE_UC V$VERSION//EN" "http://www.oasis-open.org/docbook/$TYPE_LC/$VERSION/docbookx.dtd">
+<book id="test">
+</book>
+END
+ if test "$?" = 0; then
+ XSLTPROC_WORKS=yes
+ fi
+ AC_MSG_RESULT($XSLTPROC_WORKS)
+ fi
+
+ if test "x$XSLTPROC_WORKS" == "xyes"; then
+ dnl execute ACTION-IF-FOUND
+ ifelse([$1], , :, [$1])
+ else
+ dnl execute ACTION-IF-NOT-FOUND
+ ifelse([$2], , :, [$2])
+ fi
+
+ AC_SUBST(XML_CATALOG)
+ AC_SUBST(XSLTPROC_FLAGS)
+ AC_SUBST(DOCBOOK_ROOT)
+ AC_SUBST(CAT_ENTRY_START)
+ AC_SUBST(CAT_ENTRY_END)
+])
HAVE_GTK_DOC=false
fi
fi
+
# don't you love undocumented command line options?
GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
AC_SUBST(HAVE_GTK_DOC)
AC_CHECK_PROG(HAVE_JADETEX, jadetex, true, false)
AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, true, false)
+dnl check if we can process docbook stuff
+AS_DOCBOOK(HAVE_DOCBOOK=true, HAVE_DOCBOOK=false)
+
dnl check for image conversion tools
AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
if test "x$HAVE_FIG2DEV" = "xfalse" ; then
dnl check if we can generate HTML
if test "x$HAVE_DOCBOOK2HTML" = "xtrue" && \
+ test "x$HAVE_DOCBOOK" = "xtrue" && \
test "x$HAVE_FIG2DEV_PNG" = "xtrue"; then
DOC_HTML=true
AC_MSG_NOTICE(Will output HTML documentation)
dnl check if we can generate PS
if test "x$HAVE_DOCBOOK2PS" = "xtrue" && \
+ test "x$HAVE_DOCBOOK" = "xtrue" && \
test "x$HAVE_JADETEX" = "xtrue" && \
test "x$HAVE_FIG2DEV_EPS" = "xtrue" && \
test "x$HAVE_PNGTOPNM" = "xtrue" && \
dnl check if we can generate PDF - using only ps2pdf
if test "x$DOC_PS" = "xtrue" && \
+ test "x$HAVE_DOCBOOK" = "xtrue" && \
test "x$HAVE_PS2PDF" = "xtrue"; then
DOC_PDF=true
AC_MSG_NOTICE(Will output PDF documentation)
AC_HELP_STRING([--enable-docs-build],[enable building of documentation]),
[case "${enableval}" in
yes)
- if test "x$HAVE_GTK_DOC" = "xtrue" ; then
+ if test "x$HAVE_GTK_DOC" = "xtrue" && \
+ test "x$HAVE_DOCBOOK" = "xtrue"; then
BUILD_DOCS=yes
else
BUILD_DOCS=no
BUILD_PLUGIN_DOCS=no
AM_CONDITIONAL(HAVE_GTK_DOC, $HAVE_GTK_DOC)
+AM_CONDITIONAL(HAVE_DOCBOOK, $HAVE_DOCBOOK)
AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
AM_CONDITIONAL(BUILD_PLUGIN_DOCS, test "x$BUILD_PLUGIN_DOCS" = "xyes")
AM_CONDITIONAL(DOC_HTML, $DOC_HTML)