[util/macros] factorize tests for xmlto

Rémi Cardona remi at gentoo.org
Sun Jan 3 10:26:04 PST 2010


Le 03/01/2010 18:16, Matthieu Herrb a écrit :
> So I'm proposing to add a generic test to xorg-macros.m4 and replace the 3
> lines that are found in app/xfs, lib/libXcomposite, lib/libXfont, lib/libXi
> and lib/libXtst by XORG_WITH_XMLTO: like this:

ACK on the idea, we've had a couple issues in Gentoo as well. Thanks for
tackling this :)

> --- a/configure.ac
> +++ b/configure.ac
> @@ -46,9 +46,7 @@ AC_CANONICAL_HOST
>  XORG_DEFAULT_OPTIONS
>  
>  # xmlto is used to convert doc/design.xml from DocBook to PDF/HTML
> -AC_ARG_VAR([XMLTO], [Path to xmlto command])
> -AC_PATH_PROG([XMLTO], [xmlto])
> -AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
> +XORG_WITH_XMLTO
>  
>  AC_CHECK_HEADERS([stdint.h])

Reviewed-by: Rémi Cardona <remi at gentoo.org>

> +# XORG_CHECK_XMLTO
> +# ----------------
> +# Minimum version: 1.4.2
> +#
> +# xmlto checks
> +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"no" ; then
> +   AC_PATH_PROG([XMLTO], [xmlto])
> +   if test "x$XMLTO" = "x" -a ! -f $srcdir/man/Xcomposite.man ; then
> +        AC_MSG_WARN([xmlto not found - cannot create man pages without it])
> +   fi
> +else
> +   if ! test "x$XMLTO" = "x"; then 
> +      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
> +      unset XMLTO
> +   fi
> +fi
> +AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
> +]) # XORG_CHECK_XMLTO
> +

I'd use "if test A != B" instead of "if ! test A = B". It's a bit easier
to read (100% subjective, I admit) and it's what the rest of the file uses.

But even without that nitpick :

Reviewed-by: Rémi Cardona <remi at gentoo.org>

Cheers


More information about the xorg-devel mailing list