X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=13ebe36b1c75992b996095d5c7e3ffce22411239;hb=1c83695b5b9ae3175c18908c1d58aeadb1f225ae;hp=35ddbdb3cc21962d57192a3bd516bb3741247d7d;hpb=6caa45bf8762fe38bb8d43a6181276f132f3c728;p=ghc-hetmet.git
diff --git a/aclocal.m4 b/aclocal.m4
index 35ddbdb..13ebe36 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -747,14 +747,28 @@ AS_VAR_POPDEF([fp_func])dnl
# FP_GEN_DOCBOOK_XML
# ------------------
# Generates a DocBook XML V4.2 document in conftest.xml.
+#
+# It took a lot of experimentation to find a document that will cause
+# xsltproc to fail with an error code when the relevant
+# stylesheets/DTDs are not found. I couldn't make xsltproc fail with
+# a single-file document, it seems a multi-file document is needed.
+# -- SDM 2009-06-03
+#
AC_DEFUN([FP_GEN_DOCBOOK_XML],
-[rm -f conftest.xml
+[rm -f conftest.xml conftest-book.xml
cat > conftest.xml << EOF
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [[
+
+]]>
- A DocBook Test Document
+&conftest-book;
+
+EOF
+cat >conftest-book.xml << EOF
+
+
A DocBook “Test Document”
A Chapter Title
This is a paragraph, referencing .
@@ -763,7 +777,6 @@ cat > conftest.xml << EOF
Another Chapter Title
This is another paragraph, referencing .
-
EOF
]) # FP_GEN_DOCBOOK_XML
@@ -793,33 +806,28 @@ fi
])# FP_PROG_XSLTPROC
-# FP_DIR_DOCBOOK_XSL(XSL-DIRS)
+# FP_DOCBOOK_XSL
# ----------------------------
-# Check which of the directories XSL-DIRS contains DocBook XSL stylesheets. The
-# output variable DIR_DOCBOOK_XSL will contain the first usable directory or
-# will be empty if none could be found.
-AC_DEFUN([FP_DIR_DOCBOOK_XSL],
+# Check that we can process a DocBook XML document to HTML using xsltproc.
+AC_DEFUN([FP_DOCBOOK_XSL],
[AC_REQUIRE([FP_PROG_XSLTPROC])dnl
if test -n "$XsltprocCmd"; then
- AC_CACHE_CHECK([for DocBook XSL stylesheet directory], fp_cv_dir_docbook_xsl,
+ AC_CACHE_CHECK([for DocBook XSL stylesheet], fp_cv_dir_docbook_xsl,
[FP_GEN_DOCBOOK_XML
fp_cv_dir_docbook_xsl=no
- for fp_var in $1; do
- if $XsltprocCmd ${fp_var}/html/docbook.xsl conftest.xml > /dev/null 2>&1; then
- fp_cv_dir_docbook_xsl=$fp_var
- break
- fi
- done
+ if $XsltprocCmd --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl conftest.xml > /dev/null 2>&1; then
+ fp_cv_dir_docbook_xsl=yes
+ fi
rm -rf conftest*])
fi
if test x"$fp_cv_dir_docbook_xsl" = xno; then
AC_MSG_WARN([cannot find DocBook XSL stylesheets, you will not be able to build the documentation])
- DIR_DOCBOOK_XSL=
+ HAVE_DOCBOOK_XSL=NO
else
- DIR_DOCBOOK_XSL=$fp_cv_dir_docbook_xsl
+ HAVE_DOCBOOK_XSL=YES
fi
-AC_SUBST([DIR_DOCBOOK_XSL])
-])# FP_DIR_DOCBOOK_XSL
+AC_SUBST([HAVE_DOCBOOK_XSL])
+])# FP_DOCBOOK_XSL
# FP_PROG_XMLLINT
@@ -841,7 +849,7 @@ AC_DEFUN([FP_CHECK_DOCBOOK_DTD],
if test -n "$XmllintCmd"; then
AC_MSG_CHECKING([for DocBook DTD])
FP_GEN_DOCBOOK_XML
- if $XmllintCmd --valid --noout conftest.xml > /dev/null 2>&1; then
+ if $XmllintCmd --nonet --valid --noout conftest.xml ; then
AC_MSG_RESULT([ok])
else
AC_MSG_RESULT([failed])