From 01ef7c69d91259e5904f26b6b4630243d548232a Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Thu, 24 Jun 2010 18:12:45 -0400 Subject: 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 Signed-off-by: Gaetan Nadon --- xorg-macros.m4.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 -- cgit v1.2.3