Configuration: rework how dependency making is handled
[openssl.git] / Configurations / platform / Unix.pm
1 package platform::Unix;
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 sub binext              { $target{exe_extension} || '' }
16 sub dsoext              { $target{dso_extension} || platform->shlibextsimple()
17                               || '.so' }
18 # Because these are also used in scripts and not just Makefile, we must
19 # convert $(SHLIB_VERSION_NUMBER) to the actual number.
20 sub shlibext            { (my $x = $target{shared_extension}
21                                || '.so.$(SHLIB_VERSION_NUMBER)')
22                               =~ s|\.\$\(SHLIB_VERSION_NUMBER\)
23                                   |.$config{shlib_version}|x;
24                           $x; }
25 sub libext              { $target{lib_extension} || '.a' }
26 sub defext              { $target{def_extension} || '.ld' }
27 sub objext              { $target{obj_extension} || '.o' }
28 sub depext              { $target{obj_extension} || '.d' }
29
30 # Other extra that aren't defined in platform::BASE
31 sub shlibextsimple      { (my $x = $target{shared_extension} || '.so')
32                               =~ s|\.\$\(SHLIB_VERSION_NUMBER\)||;
33                           $x; }
34 sub shlibvariant        { $target{shlib_variant} || "" }
35 sub makedepcmd          { $disabled{makedepend} ? undef : $config{makedepcmd} }
36
37 # No conversion of assembler extension on Unix
38 sub asm {
39     return $_[1];
40 }
41
42 # At some point, we might decide that static libraries are called something
43 # other than the default...
44 sub staticname {
45     # Non-installed libraries are *always* static, and their names remain
46     # the same, except for the mandatory extension
47     my $in_libname = platform::BASE->staticname($_[1]);
48     return $in_libname if $unified_info{attributes}->{$_[1]}->{noinst};
49
50     # We currently return the same name anyway...  but we might choose to
51     # append '_static' or '_a' some time in the future.
52     return platform::BASE->staticname($_[1]);
53 }
54
55 sub sharedname {
56     return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
57                                     ($_[0]->shlibvariant() // ''));
58 }
59
60 sub sharedname_simple {
61     return platform::BASE::__isshared($_[1]) ? $_[1] : undef;
62 }
63
64 sub sharedlib_simple {
65     return platform::BASE::__concat($_[0]->sharedname_simple($_[1]),
66                                     $_[0]->shlibextsimple());
67 }
68
69 sub sharedlib_import {
70     return undef;
71 }
72
73 1;