Configure: Better detection of '-static' in @{$config{LDFLAGS}}
authorRichard Levitte <levitte@openssl.org>
Fri, 17 Jan 2020 11:47:44 +0000 (12:47 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 23 Jan 2020 17:01:50 +0000 (18:01 +0100)
@{$config{LDFLAGS}} isn't necessarily split up in pieces, so we need
to check for '-static' with a regexp rather than with an exact string
match.

Fixes #10867

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10878)

Configure

index 1e86bfa198e6efb6aa3758179c3236c27a017241..696f15ab0f915f4cd8f2f3e5e2622bba4426581b 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1513,7 +1513,7 @@ if ($strict_warnings)
                 }
         }
 
-if (grep { $_ eq '-static' } @{$config{LDFLAGS}}) {
+if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
     disable('static', 'pic', 'threads');
 }