util/perl/OpenSSL/config.pm: Add VMS specific C compiler settings
authorRichard Levitte <levitte@openssl.org>
Mon, 22 Feb 2021 06:37:06 +0000 (07:37 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 23 Feb 2021 08:35:04 +0000 (09:35 +0100)
That includes proper compiler version detection.

Partially fixes #14247

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14270)

util/perl/OpenSSL/config.pm

index 841ef4b6aa167ac4bdb7d889fd3415849250578c..d09d017c87ae230afe6b64dd5d73a86700e5b6f6 100755 (executable)
@@ -337,6 +337,19 @@ sub determine_compiler_settings {
 
     # Vendor specific overrides, only if we didn't determine the compiler here
     if ( ! $cc ) {
+        if ( $SYSTEM eq 'OpenVMS' ) {
+            my $v = `CC/VERSION NLA0:`;
+            if ($? == 0) {
+                my ($vendor, $version) =
+                    ( $v =~ m/^([A-Z]+) C V([0-9\.-]+) on / );
+                my ($major, $minor, $patch) =
+                    ( $version =~ m/^([0-9]+)\.([0-9]+)-0*?(0|[1-9][0-9]*)$/ );
+                $CC = 'CC';
+                $CCVENDOR = $vendor;
+                $CCVER = ( $major * 100 + $minor ) * 100 + $patch;
+            }
+        }
+
         if ( ${SYSTEM} eq 'AIX' ) {
             # favor vendor cc over gcc
             if (IPC::Cmd::can_run('cc')) {