3 # Generates a DocBook XML V4.5 document in conftest.xml.
5 # It took a lot of experimentation to find a document that will cause
6 # xsltproc to fail with an error code when the relevant
7 # stylesheets/DTDs are not found. I couldn't make xsltproc fail with
8 # a single-file document, it seems a multi-file document is needed.
11 AC_DEFUN([FP_GEN_DOCBOOK_XML],
12 [rm -f conftest.xml conftest-book.xml
13 cat > conftest.xml << EOF
14 <?xml version="1.0" encoding="iso-8859-1"?>
15 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
16 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [[
17 <!ENTITY conftest-book SYSTEM "conftest-book.xml">
23 cat >conftest-book.xml << EOF
24 <?xml version="1.0" encoding="iso-8859-1"?>
25 <title>A DocBook “Test Document”</title>
27 <title>A Chapter Title</title>
28 <para>This is a paragraph, referencing <xref linkend="id-two"/>.</para>
31 <title>Another Chapter Title</title>
32 <para>This is another paragraph, referencing <xref linkend="id-one"/>.</para>
35 ]) # FP_GEN_DOCBOOK_XML
40 # Sets the output variable DblatexCmd to the full path of dblatex,
41 # which we use for building PDF and PS docs.
42 # DblatexCmd is empty if dblatex could not be found.
43 AC_DEFUN([FP_PROG_DBLATEX],
44 [AC_PATH_PROG([DblatexCmd], [dblatex])
45 if test -z "$DblatexCmd"; then
46 AC_MSG_WARN([cannot find dblatex in your PATH, you will not be able to build the PDF and PS documentation])
53 # Sets the output variable XsltprocCmd to the full path of the XSLT processor
54 # xsltproc. XsltprocCmd is empty if xsltproc could not be found.
55 AC_DEFUN([FP_PROG_XSLTPROC],
56 [AC_PATH_PROG([XsltprocCmd], [xsltproc])
57 if test -z "$XsltprocCmd"; then
58 AC_MSG_WARN([cannot find xsltproc in your PATH, you will not be able to build the HTML documentation])
64 # ----------------------------
65 # Check that we can process a DocBook XML document to HTML using xsltproc.
66 AC_DEFUN([FP_DOCBOOK_XSL],
67 [AC_REQUIRE([FP_PROG_XSLTPROC])dnl
68 if test -n "$XsltprocCmd"; then
69 AC_CACHE_CHECK([for DocBook XSL stylesheet], fp_cv_dir_docbook_xsl,
71 fp_cv_dir_docbook_xsl=no
72 if $XsltprocCmd --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl conftest.xml > /dev/null 2>&1; then
73 fp_cv_dir_docbook_xsl=yes
77 if test x"$fp_cv_dir_docbook_xsl" = xno; then
78 AC_MSG_WARN([cannot find DocBook XSL stylesheets, you will not be able to build the documentation])
83 AC_SUBST([HAVE_DOCBOOK_XSL])
89 # Sets the output variable XmllintCmd to the full path of the XSLT processor
90 # xmllint. XmllintCmd is empty if xmllint could not be found.
91 AC_DEFUN([FP_PROG_XMLLINT],
92 [AC_PATH_PROG([XmllintCmd], [xmllint])
93 if test -z "$XmllintCmd"; then
94 AC_MSG_WARN([cannot find xmllint in your PATH, you will not be able to validate your documentation])
99 # FP_CHECK_DOCBOOK_DTD
100 # --------------------
101 AC_DEFUN([FP_CHECK_DOCBOOK_DTD],
102 [AC_REQUIRE([FP_PROG_XMLLINT])dnl
103 if test -n "$XmllintCmd"; then
104 AC_MSG_CHECKING([for DocBook DTD])
106 if $XmllintCmd --nonet --valid --noout conftest.xml ; then
109 AC_MSG_RESULT([failed])
110 AC_MSG_WARN([cannot find a DTD for DocBook XML V4.5, you will not be able to validate your documentation])
111 AC_MSG_WARN([check your XML_CATALOG_FILES environment variable and/or /etc/xml/catalog])
115 ])# FP_CHECK_DOCBOOK_DTD
120 # Generates a formatting objects document in conftest.fo.
121 AC_DEFUN([FP_GEN_FO],
123 cat > conftest.fo << EOF
124 <?xml version="1.0"?>
125 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
126 <fo:layout-master-set>
127 <fo:simple-page-master master-name="blank">
129 </fo:simple-page-master>
130 </fo:layout-master-set>
131 <fo:page-sequence master-reference="blank">
132 <fo:flow flow-name="xsl-region-body">
145 # Set the output variable 'FopCmd' to the first working 'fop' in the current
146 # 'PATH'. Note that /usr/bin/fop is broken in SuSE 9.1 (unpatched), so try
147 # /usr/share/fop/fop.sh in that case (or no 'fop'), too.
148 AC_DEFUN([FP_PROG_FOP],
149 [AC_PATH_PROGS([FopCmd1], [fop fop.sh])
150 if test -n "$FopCmd1"; then
151 AC_CACHE_CHECK([for $FopCmd1 usability], [fp_cv_fop_usability],
153 if "$FopCmd1" -fo conftest.fo -ps conftest.ps > /dev/null 2>&1; then
154 fp_cv_fop_usability=yes
156 fp_cv_fop_usability=no
159 if test x"$fp_cv_fop_usability" = xyes; then
163 if test -z "$FopCmd"; then
164 AC_PATH_PROGS([FopCmd2], [fop.sh], , [/usr/share/fop])