[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
39-fix-variable-defined.patch
From: |
Akim Demaille |
Subject: |
39-fix-variable-defined.patch |
Date: |
Sun, 11 Mar 2001 19:09:15 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* automake.in (&variable_defined): Some callers, e.g.,
&am_primary_prefixes, really want to know if the variable is
defined for any condition, not `TRUE' by default.
(&am_primary_prefixes): Give a more precise error message.
Index: automake.in
--- automake.in Sun, 11 Mar 2001 10:38:56 +0100 akim (am/f/39_automake.i 1.158
755)
+++ automake.in Sun, 11 Mar 2001 10:53:23 +0100 akim (am/f/39_automake.i 1.158
755)
@@ -5694,8 +5694,6 @@ sub variable_defined ($$)
{
my ($var, $cond) = @_;
- $cond ||= 'TRUE';
-
# Unfortunately we can't just check for $conditional{VAR}{COND}
# as this would make perl create $condition{VAR}, which we
# don't want.
@@ -5710,7 +5708,7 @@ sub variable_defined ($$)
}
if ($var_is_am{$var}
- || !exists $conditional{$var}{$cond})
+ || ($cond && !exists $conditional{$var}{$cond}))
{
# The variable is not defined for the given condition.
return 0;
@@ -6923,15 +6921,26 @@ sub am_primary_prefixes
if ($varname =~ /^(nobase_)?(dist_|nodist_)?(.*)_$primary$/)
{
my ($base, $dist, $X) = ($1 || '', $2 || '', $3 || '');
- if (($dist ne '' && ! $can_dist)
- || (! defined $valid{$X} && ! &variable_defined ("${X}dir")))
+ if ($dist ne '' && ! $can_dist)
+ {
+ # Note that a configure variable is always legitimate.
+ # It is natural to name such variables after the
+ # primary, so we explicitly allow it.
+ if (! defined $configure_vars{$varname})
+ {
+ &am_line_error ($varname,
+ "invalid variable `$varname': dist is
forbidden");
+ }
+ }
+ elsif (! defined $valid{$X} && ! &variable_defined ("${X}dir"))
{
# Note that a configure variable is always legitimate.
# It is natural to name such variables after the
# primary, so we explicitly allow it.
if (! defined $configure_vars{$varname})
{
- &am_line_error ($varname, "invalid variable `$varname'");
+ &am_line_error ($varname,
+ "invalid variable `$varname'");
}
}
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 39-fix-variable-defined.patch,
Akim Demaille <=