[gtk-doc] pdf: look for dblatex for pdf generation



commit 7af53e1e569221af8d3f826734696c8c5192936a
Author: Stefan Kost <ensonic users sf net>
Date:   Tue Jul 7 17:35:04 2009 +0100

    pdf: look for dblatex for pdf generation
    
    If the user has dblatex use it to generate pdfs. Seems to work much better than
    using fop.

 configure.in    |   15 +++++++++------
 gtkdoc-mkpdf.in |   20 +++++++++++++-------
 2 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/configure.in b/configure.in
index 002e326..7d86bc7 100644
--- a/configure.in
+++ b/configure.in
@@ -77,11 +77,14 @@ if test -z "$XSLTPROC"; then
 fi
 
 dnl
-dnl Check for fop (for pdf output)
+dnl Check for dblatex/fop (for pdf output)
 dnl
-AC_PATH_PROG([FOP], [fop])
-if test -z "$FOP"; then
-  AC_MSG_WARN([fop not found, so no pdf output from xml])
+AC_PATH_PROG([DBLATEX], [dblatex])
+if test -z "$DBLATEX"; then
+  AC_PATH_PROG([FOP], [fop])
+  if test -z "$FOP"; then
+    AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
+  fi
 fi
 
 dnl check for DocBook DTD and stylesheets in the local catalog.
@@ -226,8 +229,8 @@ test -n "$PYTHON" \
 test -n "$JADE" \
     && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
     || AC_MSG_NOTICE([   SGML support disabled, no jade processor available])
-test -n "$FOP" \
-    && AC_MSG_NOTICE([** XML PDF support enabled, using $FOP]) \
+test -n "$DBLATEX$FOP" \
+    && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
     || AC_MSG_NOTICE([   XML PDF support disabled, no fop available])
 test "x$gdu_cv_have_gdu" = "xyes" \
     && AC_MSG_NOTICE([** Gnome-doc-utils support enabled]) \
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
index 14a92cb..0f4d607 100644
--- a/gtkdoc-mkpdf.in
+++ b/gtkdoc-mkpdf.in
@@ -7,7 +7,7 @@ Usage: gtkdoc-mkpdf [--path=SEARCH_PATH] MODULE DRIVER_FILE [BACKEND_OPTIONS...]
 #echo "args $0\n";
 
 cleanexit() {
-  rm $module.fo
+  rm -f $module.fo
   exit $1
 }
 
@@ -67,12 +67,18 @@ else
 fi
 
 if $is_xml; then
-  @XSLTPROC@ $path_arg --nonet --xinclude \
-      --stringparam gtkdoc.bookname $module \
-      --stringparam gtkdoc.version "@VERSION@" \
-      "$@" -o $module.fo $gtkdocdir/gtk-doc-fo.xsl $document || cleanexit $?
-  # fop dies too easily :(
-  # @FOP@ $module.fo $module.pdf
+  if test -n "@DBLATEX@"; then
+    dblatex $document -o$module.pdf
+  else
+    if test -n "@FOP@"; then
+      @XSLTPROC@ $path_arg --nonet --xinclude \
+          --stringparam gtkdoc.bookname $module \
+          --stringparam gtkdoc.version "@VERSION@" \
+          "$@" -o $module.fo $gtkdocdir/gtk-doc-fo.xsl $document || cleanexit $?
+      # fop dies too easily :(
+      # @FOP@ $module.fo $module.pdf
+    fi
+  fi
 else
   # not very good output
   # also for xxx-docs.sgml it will produce xxx-docs.pdf



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]