autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "use strict" in autoscan.


From: Russ Allbery
Subject: Re: "use strict" in autoscan.
Date: 22 Jan 2001 19:19:20 -0800
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Tim Van Holder <address@hidden> writes:

> A 2.50-ready version was posted in bug-autoconf on 2001/01/19 (by me;
> subject is 'RE: Bug in AC_CACHE_VAL (maybe)').  Jim's version (as
> included in help2man, for example) did not work with the current
> autoconf.

You don't want to do it the way that you did in that macro; don't try to
compare $] to some value.  The version numbering system has changed and
may change again.  Instead, you want to do something like:

changequote(<<,>>)dnl
inn_perl_command='print $]'
changequote([,])dnl
AC_DEFUN([INN_PERL_VERSION],
[AC_CACHE_CHECK(for Perl version, inn_cv_perl_version,
[if $_PATH_PERL -e 'require $1;' > /dev/null 2>&1 ; then
    inn_cv_perl_version=`$_PATH_PERL -e "$inn_perl_command"`
else
    AC_MSG_ERROR(Perl $1 or greater is required)
fi])])

That requires some version of Perl 5; if people don't care and can make do
with Perl 4, they can just use AC_PATH_PROG(perl) since they're pretty
unlikely to find any earlier version any more.  Of course, modifying the
above to do the search through several Perl names and to return no rather
than dying would be better for a macro that's part of autoconf, and for
2.50 you'd want to use the digraph for ] rather than the changequote
method used above.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]