Configure: recognise -static even if given through variables
authorRichard Levitte <levitte@openssl.org>
Tue, 23 Apr 2019 07:29:45 +0000 (09:29 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 23 Apr 2019 10:43:35 +0000 (12:43 +0200)
Fixes #8787

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8812)

Configure

index b330fd68875547a7d885f9e644c07bc1572ad421..ea784618ccfdc923b4b43a5a47d1c4b1569964eb 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -892,9 +892,6 @@ while (@argvcopy)
                 elsif (/^-static$/)
                         {
                         push @{$useradd{LDFLAGS}}, $_;
-                        $disabled{"pic"} = "forced";
-                        $disabled{"shared"} = "forced";
-                        $disabled{"threads"} = "forced";
                         }
                 elsif (/^-D(.*)$/)
                         {
@@ -1583,6 +1580,13 @@ if ($strict_warnings)
                 @{$clang_devteam_warn{CXXFLAGS}}
                         if (defined($predefined_CXX{__clang__}));
         }
+
+if (grep { $_ eq '-static' } @{$config{LDFLAGS}}) {
+    $disabled{"pic"} = "forced";
+    $disabled{"shared"} = "forced";
+    $disabled{"threads"} = "forced";
+}
+
 foreach my $idx (qw(CFLAGS CXXFLAGS))
         {
         $config{$idx} = [ map { $_ eq '--ossl-strict-warnings'