From 03f30c552a07eb7686a9fc099b06653548afa941 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 19 Aug 2019 08:54:00 +0200 Subject: [PATCH] Configure, build.info: make it possible to use variables in indexes That will make it possible to assign different goals for translation units depending on need. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9637) --- Configure | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/Configure b/Configure index 4415e1d6bc..7e6091e633 100755 --- a/Configure +++ b/Configure @@ -1742,11 +1742,19 @@ if ($builder eq "unified") { my $value = ''; my $value_rest = shift; + if ($ENV{CONFIGURE_DEBUG_VARIABLE_EXPAND}) { + print STDERR + "DEBUG[\$expand_variables] Parsed '$value_rest' into:\n" + } while ($value_rest =~ /(? sub { push @{$ordinals{$1}}, tokenize($expand_variables->($2)) + => sub { push @{$ordinals{$expand_variables->($1)}}, + tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, qr/^\s*SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ - => sub { push @{$sources{$1}}, tokenize($expand_variables->($2)) + => sub { push @{$sources{$expand_variables->($1)}}, + tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, qr/^\s*SHARED_SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ - => sub { push @{$shared_sources{$1}}, + => sub { push @{$shared_sources{$expand_variables->($1)}}, tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ - => sub { push @{$includes{$1}}, tokenize($expand_variables->($2)) + => sub { push @{$includes{$expand_variables->($1)}}, + tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, - qr/^\s*DEFINE\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/ - => sub { push @{$defines{$1}}, tokenize($expand_variables->($2)) + qr/^\s*DEFINE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ + => sub { push @{$defines{$expand_variables->($1)}}, + tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/ - => sub { push @{$depends{$1}}, tokenize($expand_variables->($2)) + => sub { push @{$depends{$expand_variables->($1)}}, + tokenize($expand_variables->($2)) if !@skip || $skip[$#skip] > 0 }, qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ - => sub { push @{$generate{$1}}, $2 + => sub { push @{$generate{$expand_variables->($1)}}, $2 if !@skip || $skip[$#skip] > 0 }, qr/^\s*(?:#.*)?$/ => sub { }, "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" }, -- 2.34.1