[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make AM_MISSING_PROG (more) portable
From: |
Stepan Kasal |
Subject: |
Re: make AM_MISSING_PROG (more) portable |
Date: |
Wed, 10 Aug 2005 10:06:02 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Mon, Aug 08, 2005 at 09:38:32AM +0200, Ralf Wildenhues wrote:
> AC_DEFUN([AM_MISSING_PROG],
> [AC_REQUIRE([AM_MISSING_HAS_RUN])
> -$1=${$1-"${am_missing_run}$2"}
> +test "${$1+set}" = set || $1="${am_missing_run}$2"
> AC_SUBST($1)])
well, first you read in the autoconf manual:
> | test "${var+set}" = set || var='${indirection}'
> (aren't there, by the way, superfluous quotes on the right hand side?)
The example is right, it doesn't mean
var=${indirection}
It means cases when the _literal_ string contains braces.
But in lines like:
> | ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
the parentheses are part of variable expansions, so this is OK.
Perhaps the Autoconf manual could be more clear about it, but when you
study the node "Shell Substitutions" you'll see it.
Well, the value of am_missing_run contains "${SHELL}", but again, it
doesn't seem to matter, since it is brought in by expansion, it wasn't
literal part of the assignment.
Thus, in this case, the node (autoconf)Assignments would advice:
var=${var="$default"}
while AM_MISSING_PROG uses:
var=${var-"$default"}
(Please look at the subtitle `${VAR=EXPANDED-VALUE}' in node
"Shell Substitutions", which described the bug in Ultrix shell.)
The autoconf manual uses the term "double assignment" in connection
with the former workaround. I think this term is unfortunate, because
it is not "xored twice"; instead, the fix relies on the fact that the
8th bit is fixed on expansion.
So it seems that the latter workaround also works, and better illustrates
how the fix works. But before I'd fix the Autoconf manual, I should try
it on an Ultrix. But I don't have access to any.
To sum up, I don't see anything which could be improved in Automake.
The Autoconf manual could be improved, but I don't think it's worth it now.
For Autoconf 3, we might comment out some of the problems described in
"Shell Substitutions", and thus the recipe in "Assignments" will be
simplified.
Have a nice day,
Stepan