[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bug in AC_CACHE_VAL (maybe)
From: |
Tim Van Holder |
Subject: |
RE: Bug in AC_CACHE_VAL (maybe) |
Date: |
Fri, 19 Jan 2001 19:19:00 +0100 |
Actually, the 2.49 version you sent does not seem to work; the
resulting configure script has '%:@' in it, instead of the right
bracket. It seems the $@ gets evaluated by m4. This is with the
current (2001/01/19 19:00 CET) CVS autoconf. The 2.13 version
has the same problem.
Also, thumbing through acgeneral.m4 seems to suggest @%:@ is
used to get a #, not a ]. With address@hidden:@ quoted to address@hidden:@],
this
results in the use of $#, which happens to give the required
result in your test (as the number of args isn't 6); but if
you had also tried AC_PROG_PERL(4), you'd have probably found
it resulted in the wrong result ('no' instead of 'perl').
-- New mail!
Aha, so it should be @:>@ then! ... WORKS :-)
So, the final(tm) version of the macro is:
dnl AC_PROG_PERL([MIN-VERSION])
AC_DEFUN(AC_PROG_PERL,
[# find perl binary
AC_MSG_CHECKING([for perl])
AC_CACHE_VAL(ac_cv_prog_PERL,
[ifelse([$1],,,
[echo "configure:__oline__: ...version $1 required"
>&AS_MESSAGE_LOG_FD])
# allow user to override
if test -n "$PERL"; then
ac_try="$PERL"
else
ac_try="perl perl5"
fi
for ac_prog in $ac_try; do
echo "configure:__oline__: trying $ac_prog" >&AS_MESSAGE_LOG_FD
if ($ac_prog -e 'printf "found version %g\n", $[@:>@];
ifelse([$1],,,
[exit($[@:>@] < $1)])') 1>&AS_MESSAGE_LOG_FD 2>&1; then
ac_cv_prog_PERL=$ac_prog
break
fi
done])dnl
PERL="$ac_cv_prog_PERL"
if test -n "$PERL"; then
AC_MSG_RESULT($PERL)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(PERL)dnl
])dnl