summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2010-06-24 18:12:45 -0400
committerGaetan Nadon <memsize@videotron.ca>2010-06-25 18:47:13 -0400
commit01ef7c69d91259e5904f26b6b4630243d548232a (patch)
treead4b39313d890e974fb8f5bb4d57d7631fb1ad2d
parentfe878c0ce0b9093c13714ec6662b0c99a9a2d1d4 (diff)
XORG_WITH_XMLTO: add HAVE_XMLTO_TEXT for text output format
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. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r--xorg-macros.m4.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index a0d94f8..a1a0961 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.
#
AC_DEFUN([XORG_WITH_XMLTO],[
@@ -386,6 +390,8 @@ elif test "x$use_xmlto" = x"no" ; then
else
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
fi
+
+# Test for a minimum version of xmlto, if provided.
m4_ifval([$1],
[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])
fi])
fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+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])
]) # XORG_WITH_XMLTO