<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Wed, 2011-06-22 at 08:46 -0700, Dan Nicholson wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Wed, Jun 22, 2011 at 7:55 AM, Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>> wrote:
> Following the same pattern as XMLTO and friends.
> Allows all modules to use the same interface, variables
> and options to check for perl.
> Perl is used in libX11 and xserver.
>
> Signed-off-by: Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>>
Seems like a bit of overkill, but I guess there's not any harm besides
churning things more.
</PRE>
</BLOCKQUOTE>
Same here. You never know when usage will grow. I recall running around all the modules with docs to replace existing code.
<BLOCKQUOTE TYPE=CITE>
<PRE>
> ---
> xorg-macros.m4.in | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 58 insertions(+), 0 deletions(-)
>
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index d3b0b7e..756ff2d 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -494,6 +494,64 @@ m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
> AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
> ]) # XORG_WITH_XSLTPROC
>
> +# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
> +# ----------------------------------------
> +# Minimum version: 1.15.0
> +#
> +# PERL (Practical Extraction and Report Language) is a language optimized for
> +# scanning arbitrary text files, extracting information from those text files,
> +# and printing reports based on that information.
> +#
> +# When DEFAULT is not specified, --with-perl assumes 'auto'.
> +#
> +# Interface to module:
> +# HAVE_PERL: used in makefiles to conditionally scan text files
> +# PERL: returns the path of the perl program found
> +# returns the path set by the user in the environment
> +# --with-perl: 'yes' user instructs the module to use perl
> +# 'no' user instructs the module not to use perl
> +# have_perl: returns yes if perl found in PATH or no
> +#
> +# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
> +#
> +AC_DEFUN([XORG_WITH_PERL],[
> +AC_ARG_VAR([PERL], [Path to perl command])
> +m4_define([_defopt], m4_default([$2], [auto]))
> +AC_ARG_WITH(perl,
> + AS_HELP_STRING([--with-perl],
> + [Use perl for extracting information from files (default: ]_defopt[)]),
> + [use_perl=$withval], [use_perl=]_defopt)
> +m4_undefine([_defopt])
> +
> +if test "x$use_perl" = x"auto"; then
> + AC_PATH_PROG([PERL], [perl])
> + if test "x$PERL" = "x"; then
> + AC_MSG_WARN([perl not found - cannot extract information and report])
> + have_perl=no
> + else
> + have_perl=yes
> + fi
> +elif test "x$use_perl" = x"yes" ; then
> + AC_PATH_PROG([PERL], [perl])
> + if test "x$PERL" = "x"; then
> + AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
> + fi
> + have_perl=yes
> +elif test "x$use_perl" = x"no" ; then
> + if test "x$PERL" != "x"; then
> + AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
> + fi
> + have_perl=no
> +else
> + AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
> +fi
> +
> +# Checking for minimum version is not implemented
> +# but we want to keep the interface consistent with other commands
> +m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
Instead of AC_MSG_WARN, wouldn't it be better to spit the warning with
m4 so you can tell the person specifying the version that it's
unsupported? Once configure is built, nothing can be done about it. I
suggest:
</PRE>
</BLOCKQUOTE>
Ah, yes. Unlearning is harder than learning. The separation of roles, one creating the configuration versus one running it. Will do.<BR>
<BR>
Thanks!
<BLOCKQUOTE TYPE=CITE>
<PRE>
m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is
not implemented])])
Then you'd get something like this when autoconf is run:
configure.ac:17: warning: Checking for perl MIN-VERSION is not implemented
--
Dan
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>