aboutsummaryrefslogtreecommitdiff
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-10-25 15:55:15 +0200
committerRichard Levitte <levitte@openssl.org>2018-10-25 16:09:01 +0200
commitb3023ced6b6a4aece6f4d4ec1f6a93b1c03712b6 (patch)
tree8463c4dcd981aa83dfea897fbd30dcc3980e4eb3 /Configurations
parentf81b043ad856d8b9af5239a4978f8bd4b965dab9 (diff)
downloadopenssl-b3023ced6b6a4aece6f4d4ec1f6a93b1c03712b6.zip
openssl-b3023ced6b6a4aece6f4d4ec1f6a93b1c03712b6.tar.gz
openssl-b3023ced6b6a4aece6f4d4ec1f6a93b1c03712b6.tar.bz2
Windows: Produce a static version of the public libraries, always
When building shared libraries on Windows, we had a clash between 'libcrypto.lib' the static routine library and 'libcrypto.lib' the import library. We now change it so the static versions of our libraries get '_static' appended to their names. These will never get installed, but can still be used for our internal purposes, such as internal tests. When building non-shared, the renaming mechanism doesn't come into play. In that case, the static libraries 'libcrypto.lib' and 'libssl.lib' are installed, just as always. Fixes #7492 Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7496)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/windows-makefile.tmpl24
1 files changed, 7 insertions, 17 deletions
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 663aefc..44cc7d0 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -41,6 +41,8 @@
sub lib {
(my $lib = shift) =~ s/\.a$//;
+ $lib .= '_static'
+ if (defined $unified_info{sharednames}->{$lib});
return $lib . $libext;
}
@@ -75,7 +77,7 @@ MINOR={- $config{minor} -}
SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
-LIBS={- join(" ", map { lib($_) } @{$unified_info{libraries}}) -}
+LIBS={- join(" ", map { ( shlib_import($_), lib($_) ) } @{$unified_info{libraries}}) -}
SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
@@ -96,7 +98,7 @@ GENERATED={- # common0.tmpl provides @generated
$x }
@generated) -}
-INSTALL_LIBS={- join(" ", map { quotify1(lib($_)) } @{$unified_info{install}->{libraries}}) -}
+INSTALL_LIBS={- join(" ", map { quotify1(shlib_import($_) or lib($_)) } @{$unified_info{install}->{libraries}}) -}
INSTALL_SHLIBS={- join(" ", map { quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -}
INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -}
INSTALL_ENGINES={- join(" ", map { quotify1(dso($_)) } @{$unified_info{install}->{engines}}) -}
@@ -490,11 +492,6 @@ reconfigure reconf:
if ($disabled{shared}) {
return map { lib($_) } @_;
}
- foreach (@_) {
- (my $l = $_) =~ s/\.a$//;
- die "Linking with static variants of shared libraries is not supported in this configuration\n"
- if $l ne $_ && shlib($l);
- }
return map { shlib_import($_) or lib($_) } @_;
}
@@ -702,20 +699,13 @@ EOF
}
sub obj2lib {
my %args = @_;
- my $lib = $args{lib};
-
- # Because static libs and import libs are both named the same in native
- # Windows, we can't have both. We skip the static lib in that case,
- # as the shared libs are what we use anyway.
- return "" unless $disabled{"shared"} || $lib =~ /\.a$/;
-
- $lib =~ s/\.a$//;
+ my $lib = lib($args{lib});
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x } @{$args{objs}};
my $objs = join("\n", @objs);
my $deps = join(" ", @objs);
return <<"EOF";
-$lib$libext: $deps
- \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
+$lib: $deps
+ \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib @<<
$objs
<<
EOF