Skip to content

Commit 0ee7b9f

Browse files
committed
Configure: allow conditions and variable values to have variable references
This will allow building variables on other variables, and to have conditions based on variable contents. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from openssl#9166)
1 parent 26de4ec commit 0ee7b9f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Configure

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ if ($builder eq "unified") {
18811881
qr/^\s*IF\[((?:\\.|[^\\\]])*)\]\s*$/
18821882
=> sub {
18831883
if (! @skip || $skip[$#skip] > 0) {
1884-
push @skip, !! $1;
1884+
push @skip, !! $expand_variables->($1);
18851885
} else {
18861886
push @skip, -1;
18871887
}
@@ -1890,7 +1890,7 @@ if ($builder eq "unified") {
18901890
=> sub { die "ELSIF out of scope" if ! @skip;
18911891
die "ELSIF following ELSE" if abs($skip[$#skip]) == 2;
18921892
$skip[$#skip] = -1 if $skip[$#skip] != 0;
1893-
$skip[$#skip] = !! $1
1893+
$skip[$#skip] = !! $expand_variables->($1)
18941894
if $skip[$#skip] == 0; },
18951895
qr/^\s*ELSE\s*$/
18961896
=> sub { die "ELSE out of scope" if ! @skip;
@@ -1902,7 +1902,9 @@ if ($builder eq "unified") {
19021902
qr/^\s*${variable_re}\s*=\s*(.*?)\s*$/
19031903
=> sub {
19041904
if (!@skip || $skip[$#skip] > 0) {
1905-
$variables{$1} = $2;
1905+
my $n = $1;
1906+
my $v = $2;
1907+
$variables{$n} = $expand_variables->($v);
19061908
}
19071909
},
19081910
qr/^\s*SUBDIRS\s*=\s*(.*)\s*$/

0 commit comments

Comments
 (0)