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:44:38 +0000 (12:44 +0200)
Fixes #8787

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

(cherry picked from commit 4650d10ff6ad1048785a009349c8b5d6e922fc7a)

Configure

index cba080a99b36d268b015491a6ea878dafc4df334..84e3459fdf1a95c85a29f67daf314c2bf3c3cf90 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -860,9 +860,6 @@ while (@argvcopy)
                 elsif (/^-static$/)
                         {
                         push @{$useradd{LDFLAGS}}, $_;
-                        $disabled{"pic"} = "forced";
-                        $disabled{"shared"} = "forced";
-                        $disabled{"threads"} = "forced";
                         }
                 elsif (/^-D(.*)$/)
                         {
@@ -1560,6 +1557,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'