Rework building: VMS changes to handle extensions and product names
[oweals/openssl.git] / Configurations / platform / VMS.pm
1 package platform::VMS;
2
3 use strict;
4 use warnings;
5 use Carp;
6
7 use vars qw(@ISA);
8
9 require platform::BASE;
10 @ISA = qw(platform::BASE);
11
12 # Assume someone set @INC right before loading this module
13 use configdata;
14
15 # VMS has a cultural standard where all installed libraries are prefixed.
16 # For OpenSSL, the choice is 'ossl$' (this prefix was claimed in a
17 # conversation with VSI, Tuesday January 26 2016)
18 sub osslprefix          { 'OSSL$' }
19
20 sub binext              { '.EXE' }
21 sub dsoext              { '.EXE' }
22 sub shlibext            { '.EXE' }
23 sub libext              { '.OLB' }
24 sub defext              { '.OPT' }
25 sub objext              { '.OBJ' }
26 sub depext              { '.D' }
27 sub asmext              { '.ASM' }
28
29 # Other extra that aren't defined in platform::BASE
30 sub shlibvariant        { $target{shlib_variant} || '' }
31
32 sub optext              { '.OPT' }
33 sub optname             { return $_[1] }
34 sub opt                 { return $_[0]->optname($_[1]) . $_[0]->optext() }
35
36 # Other projects include the pointer size in the name of installed libraries,
37 # so we do too.
38 sub staticname {
39     # Non-installed libraries are *always* static, and their names remain
40     # the same, except for the mandatory extension
41     my $in_libname = platform::BASE->staticname($_[1]);
42     return $in_libname
43         unless ( grep { platform::BASE->staticname($_) eq $in_libname }
44                  @{$unified_info{install}->{libraries}} );
45
46     return platform::BASE::__concat($_[0]->osslprefix(),
47                                     platform::BASE->staticname($_[1]),
48                                     $target{pointer_size});
49 }
50
51 # To enable installation of multiple major OpenSSL releases, we include the
52 # version number in installed shared library names.
53 my $sover_filename =
54     join('', map { sprintf "%02d", $_ } split(m|\.|, $config{shlib_version}));
55 sub shlib_version_as_filename {
56     return $sover_filename;
57 }
58 sub sharedname {
59     return platform::BASE::__concat($_[0]->osslprefix(),
60                                     platform::BASE->sharedname($_[1]),
61                                     $_[0]->shlib_version_as_filename(),
62                                     ($_[0]->shlibvariant() // ''),
63                                     "_shr$target{pointer_size}");
64 }
65
66 1;