From d7acec2d3a3abe79814ceb72e2c0d4d95ed31d37 Mon Sep 17 00:00:00 2001 From: Andreas Boll Date: Tue, 12 Jan 2016 13:59:40 +0100 Subject: Fix XORG_WITH_XMLTO to work with xmlto >= 0.0.27 Starting with xmlto version 0.0.27 the return code of xmlto --skip-validation txt conftest.xml is non-zero if conftest.xml is an empty file. As a consequence the macro XORG_WITH_XMLTO returns "xmlto cannot generate text format, this format skipped" and therefore libraries like libxi, libxdmcp and others won't convert docbook XML to text format. This changed behavior was introduced with the following change in xmlto: xmlto.in: use correctly exit code from xsltproc See also: https://fedorahosted.org/xmlto/changeset/77 This patch fixes this by additionally testing xmlto with a non-empty XML file. More details can be found at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613674 Thanks to Peter Pearse, Helmut Grohne and Gaetan Nadon. v2: To maintain compatibility with older xorg tarballs don't replace the original test with the empty XML file but instead add a fallback to additionally test with a non-empty XML file if the original test fails. Use the alternate solution with to skip compatibility issues with different docbook versions. Signed-off-by: Andreas Boll Reviewed-by: Gaetan Nadon Signed-off-by: Julien Cristau --- xorg-macros.m4.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xorg-macros.m4.in') diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index 9b3c503..2ed7837 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -426,13 +426,24 @@ m4_ifval([$1], fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. 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])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + 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]) -- cgit v1.2.3