]> granicus.if.org Git - neomutt/commitdiff
configure: Check for Docbook DTDs
authorRichard Russon <rich@flatcap.org>
Thu, 8 Feb 2018 10:54:41 +0000 (10:54 +0000)
committerGitHub <noreply@github.com>
Thu, 8 Feb 2018 10:54:41 +0000 (10:54 +0000)
* configure: Check for Docbook DTDs

Run xsltproc with a minimal Docbook file.
If this succeeds, then the docs will probably build correctly.

Co-authored-by: Pietro Cerutti <gahr@gahr.ch>
auto.def

index a80820ffad89eb4e3c9101a96a0e56ced076e1ce..1b9344240211eb3fce1664676a5f0ac8c03f9d4d 100644 (file)
--- a/auto.def
+++ b/auto.def
@@ -322,6 +322,27 @@ if {[get-define want-doc]} {
   if {![cc-check-progs xsltproc]} {
     user-error "Unable to find xsltproc"
   }
+
+  msg-checking "Checking for DocBook DTDs..."
+
+  writefile xslt_test.xsl {<?xml version="1.0"?>
+    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+      <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
+    </xsl:stylesheet>}
+
+  writefile xslt_test.xml {<?xml version="1.0" standalone="no"?>
+    <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+    <book />}
+
+  set err [catch {exec xsltproc --nonet xslt_test.xsl xslt_test.xml}]
+  file delete -- xslt_test.xsl xslt_test.xml
+  if {$err} {
+    msg-result "no"
+    user-error "Install DocBook DTDs or './configure --disable-doc'"
+  }
+  msg-result "yes"
+
   define BUILD_DOC
 }
 if {[get-define want-full-doc]} {define MAKEDOC_FULL}