[PATCH] Add XORG_WITH_XMLTO to factorize xmlto tests.

Matthieu Herrb matthieu.herrb at laas.fr
Tue Jan 5 14:04:25 PST 2010


This also allow to configure with --without-xmlto to ignore
a 3rd party xmlto tool on systems that normally don't have it,
in order to have reproducable builds.

Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
---
 xorg-macros.m4.in |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 20d0c70..85d353f 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -310,6 +310,51 @@ AC_SUBST(MAKE_PDF)
 AC_SUBST(MAKE_HTML)
 ]) # XORG_CHECK_DOCBOOK
 
+# XORG_WITH_XMLTO
+# ----------------
+# Minimum version: 1.5.0
+#
+# Checks for the availability of the xmlto command.
+# Adds a --with-xmlto argument to configure that can be used to 
+# disable xmlto or specify a specific path to the executable.
+# defines the HAVE_XMLTO automake conditionnal according to the result.
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+AC_ARG_WITH(xmlto, 
+	AS_HELP_STRING([--with-xmlto],
+	   [Use xmlto to regenerate documentation (default: auto)]),
+	   [use_xmlto=$withval], [use_xmlto=auto])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - cannot create man pages without it])
+	have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then 
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   if test -x $use_xmlto ; then
+      XMLTO=$use_xmlto
+      have_xmlto=yes
+   else
+      AC_MSG_ERROR([specified xmlto $use_xmlto doesn't exist])
+   fi
+fi
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_CHECK_XMLTO
+
 # XORG_CHECK_MALLOC_ZERO
 # ----------------------
 # Minimum version: 1.0.0
-- 
1.6.5.3


-- 
Matthieu Herrb


More information about the xorg-devel mailing list