[PATCH util-macros] XORG_WITH_XMLTO: add HAVE_XMLTO_TEXT for text output format

Gaetan Nadon memsize at videotron.ca
Thu Jun 24 15:25:08 PDT 2010

The xmlto program has dependencies when converting docbook XML
to text format. It requires either lynx, links or w3m
text web browsers.

Users want to skip the text format to avoid having to install these.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
 xorg-macros.m4.in |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index a0d94f8..2dbf615 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -355,6 +355,10 @@ AC_SUBST(MAKE_HTML)
 # --with-xmlto:	'yes' user instructs the module to use xmlto
 #		'no' user instructs the module not to use xmlto
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
@@ -386,6 +390,8 @@ elif test "x$use_xmlto" = x"no" ; then
    AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+# Test for un minimum version of xmlto, if provided.
 [if test "$have_xmlto" = yes; then
     # scrape the xmlto version
@@ -400,6 +406,17 @@ m4_ifval([$1],
             AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+# Test for the ability of xmlto to generate a text target
+cat > conftest.xml << "EOF"
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])

I added an unrelated comment in the test above for readability.

More information about the xorg-devel mailing list