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