summaryrefslogtreecommitdiffstats
path: root/Configurations/descrip.mms.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-11-09 20:01:51 +0100
committerRichard Levitte <levitte@openssl.org>2016-11-10 15:51:42 +0100
commit186a31e510d1326063cfeca17e58fadec236ad2a (patch)
tree229bc2215ceeac6eac726c455a52be262e19b82d /Configurations/descrip.mms.tmpl
parent42e055e12496a0eab72c64de845aa5bb18a9c4a2 (diff)
Building: make it possible to force linking with static OpenSSL libs
Very simply, support having the .a extension to denote depending on static libraries. Note that this is not supported on native Windows when building shared libraries, as there is not static library then, just an import library with the same name. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1889)
Diffstat (limited to 'Configurations/descrip.mms.tmpl')
-rw-r--r--Configurations/descrip.mms.tmpl23
1 files changed, 14 insertions, 9 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 5a6e8d1d48..cde5144a69 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -525,6 +525,17 @@ configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{bu
use File::Basename;
use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
+ # Helper function to figure out dependencies on libraries
+ # It takes a list of library names and outputs a list of dependencies
+ sub compute_lib_depends {
+ if ($disabled{shared}) {
+ return map { $_ =~ /\.a$/ ? $`.".OLB" : $_.".OLB" } @_;
+ }
+ return map { $_ =~ /\.a$/
+ ? $`.".OLB"
+ : $unified_info{sharednames}->{$_}.".EXE" } @_;
+ }
+
sub generatesrc {
my %args = @_;
my $generator = join(" ", @{$args{generator}});
@@ -627,9 +638,7 @@ EOF
my $libd = dirname($lib);
my $libn = basename($lib);
(my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i;
- my @deps = map {
- $disabled{shared} ? $_.".OLB"
- : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my @deps = compute_lib_depends(@{$args{deps}});
my $deps = join(", -\n\t\t", @deps);
my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
@@ -675,9 +684,7 @@ EOF
my $libn = basename($lib);
(my $libn_nolib = $libn) =~ s/^lib//;
my @objs = map { "$_.OBJ" } @{$args{objs}};
- my @deps = map {
- $disabled{shared} ? $_.".OLB"
- : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my @deps = compute_lib_depends(@{$args{deps}});
my $deps = join(", -\n\t\t", @objs, @deps);
my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
@@ -727,9 +734,7 @@ EOF
my $bind = dirname($bin);
my $binn = basename($bin);
my @objs = map { "$_.OBJ" } @{$args{objs}};
- my @deps = map {
- $disabled{shared} ? $_.".OLB"
- : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my @deps = compute_lib_depends(@{$args{deps}});
my $deps = join(", -\n\t\t", @objs, @deps);
# The "[]" hack is because in .OPT files, each line inherits the
# previous line's file spec as default, so if no directory spec