autoconf-patches
[Top][All Lists]
Advanced

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

Re: AC_PROG_PERL (macro, docs, used in configure.in)


From: Pavel Roskin
Subject: Re: AC_PROG_PERL (macro, docs, used in configure.in)
Date: Tue, 30 Jan 2001 17:58:36 -0500 (EST)

Hello, Akim!

> I'm not sure I understand the relationship with the present problem.
> IMHO, AC_PROG_PERL as I posted is what we want: people will not always
> want the full path, and it is not in the `tradition' of AC_PROG_CC,
> AC_PROG_AWK etc. to set the var to a path.  What we want is
> AC_PATH_PROGing $PERL once computed.  Indeed, it probably means doing
> some magic around AC_PATH_PROG.

A problem with Autoconf is that is overloads names of shell variables.
$PERL can be a result of very different tests, possibly involving
additional paths and reject values. The same applies to e.g.
$ac_cv_func_crypt.

You are right, we have a tradition behind those names. I don't think we
can find a solution before 2.50.

But if we concentrate AC_PROG_PERL, the magic is actually very simple:

_________________________
--- configure.in
+++ configure.in
@@ -31,6 +31,7 @@
 AC_SUBST([PERLSCRIPTS])dnl
 if test -n "$PERL"; then
   PERLSCRIPTS=autoscan
+  AC_PATH_PROG([PERL], [$PERL], [$PERL])
 else
   AC_MSG_WARN([autoscan will not be built since perl >= 5.004 was not found])
 fi
_________________________

That's it. It works. Feel free to apply along with the whole patch.

Changelog:
        * configure.in: If perl is found, find its full path.

> Note: I'm ready to debate about AC_PATH_PROG skipping non absolute
> envvars, but I'd like to first understand what the author meant when
> s/he did this.

It's was "he", David J. MacKenzie.

$ cvs log -r1.73 acgeneral.m4
...
revision 1.73
date: 1994/05/10 15:03:49;  author: djm;  state: Exp;  lines: +64 -40
 (AC_PREFIX): Call AC_PROGRAM_PATH instead of
        duplicating it.
        (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): If the user set the variable
        in the environment, cache that value.
        (AC_PREPARE, AC_CHECKING, AC_VERBOSE): Use file descriptors 4 and
        5 for checking and results messages.  Idea from metaconfig 3.0.

The key word here is "cache". If the value for AC_PROGRAM_PATH doesn't
begin with slash, it's discarded as invalid.

Also try

cvs diff -r 1.72 -r 1.73 acgeneral.m4

The comment in the diff says "Let the user override the test with a
path". There was no such possibility at all prior to that patch, both in
(todays names) AC_PATH_PROG and AC_CHECK_PROG.

I believe, it's justified add AC_MSG_ERROR for the variables without path.
The user can always unset the variable if it's not set on purpose.

On the other hand, it would force us to use a diffefent name for perl with
full path, e.g.

AC_PATH_PROG([PERL_PATH], [$PERL])
AC_SUBST([PERL_PATH])

But it can be another patch.

Regards,
Pavel Roskin




reply via email to

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