summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-11-29 13:16:53 +0100
committerRichard Levitte <levitte@openssl.org>2017-12-08 00:36:21 +0100
commit89bea0830de908c6713166ff376ab767b91a2dfd (patch)
tree0b8b90da1ae0ad91a7111d2a9c14fdc2c62708c3 /Configure
parent7ecdf18d80cba14ad1afa6c0d18574d2ad2929c3 (diff)
Make it possible to add env var assignments as Configure options
In other words, make the following possible: ./config CC=clang or ./Configure CC=clang linux-x86_64 Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4818)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure16
1 files changed, 14 insertions, 2 deletions
diff --git a/Configure b/Configure
index 6f2aee38ca..9624af4820 100755
--- a/Configure
+++ b/Configure
@@ -538,6 +538,14 @@ my @seed_sources = ();
while (@argvcopy)
{
$_ = shift @argvcopy;
+
+ # Support env variable assignments among the options
+ if (m|^(\w+)=(.+)?$|)
+ {
+ $config{perlenv}->{$1} = $2;
+ next;
+ }
+
# VMS is a case insensitive environment, and depending on settings
# out of our control, we may receive options uppercased. Let's
# downcase at least the part before any equal sign.
@@ -2529,8 +2537,12 @@ sub env
{
my $name = shift;
- return $config{perlenv}->{$name} if exists $config{perlenv}->{$name};
- $config{perlenv}->{$name} = $ENV{$name};
+ # Note that if $ENV{$name} doesn't exist or is undefined,
+ # $config{perlenv}->{$name} will be created with the value
+ # undef. This is intentional.
+
+ $config{perlenv}->{$name} = $ENV{$name}
+ if ! exists $config{perlenv}->{$name};
return $config{perlenv}->{$name};
}