summaryrefslogtreecommitdiffstats
path: root/Configurations/platform
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-10-23 14:36:23 +0200
committerRichard Levitte <levitte@openssl.org>2019-01-21 19:31:32 +0100
commit957689611b355f3514bd9051829f3a9a0d9d4517 (patch)
treed06ccfcc19187f292a11c7e1a3fa58363f1e5365 /Configurations/platform
parentd7e4932eaf53a82a2606a73282d9c8a242c1a39d (diff)
Rework building: Windows changes to handle extensions and product names
Add platform::Windows, which is a generic Windows module, and platform::Windows::MSVC, which is a module specifically for MS Visual C. This reworks Configurations/windows-makeffile.tmpl to work out product names in platform::Windows. Something to be noted is that the new functionality ignores the *_extension config attributes, as they were never used. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7473)
Diffstat (limited to 'Configurations/platform')
-rw-r--r--Configurations/platform/Windows.pm65
-rw-r--r--Configurations/platform/Windows/MSVC.pm33
2 files changed, 98 insertions, 0 deletions
diff --git a/Configurations/platform/Windows.pm b/Configurations/platform/Windows.pm
new file mode 100644
index 0000000000..3e13f6e86f
--- /dev/null
+++ b/Configurations/platform/Windows.pm
@@ -0,0 +1,65 @@
+package platform::Windows;
+
+use strict;
+use warnings;
+use Carp;
+
+use vars qw(@ISA);
+
+require platform::BASE;
+@ISA = qw(platform::BASE);
+
+# Assume someone set @INC right before loading this module
+use configdata;
+
+sub binext { '.exe' }
+sub dsoext { '.dll' }
+sub shlibext { '.dll' }
+sub libext { '.lib' }
+sub defext { '.def' }
+sub objext { '.obj' }
+sub depext { '.d' }
+sub asmext { '.asm' }
+
+# Other extra that aren't defined in platform::BASE
+sub resext { '.res' }
+sub shlibextimport { '.lib' }
+sub shlibvariant { $target{shlib_variant} || '' }
+
+sub staticname {
+ # Non-installed libraries are *always* static, and their names remain
+ # the same, except for the mandatory extension
+ my $in_libname = platform::BASE->staticname($_[1]);
+ return $in_libname
+ unless ( grep { platform::BASE->staticname($_) eq $in_libname }
+ @{$unified_info{install}->{libraries}} );
+
+ # To make sure not to clash with an import library, we make the static
+ # variant of our installed libraries get '_static' added to their names.
+ return platform::BASE->staticname($_[1])
+ . ($disabled{shared} ? '' : '_static');
+}
+
+# To mark forward compatibility, we include the OpenSSL major release version
+# number in the installed shared library names.
+(my $sover_filename = $config{shlib_version}) =~ s|\.|_|g;
+sub shlib_version_as_filename {
+ return $sover_filename
+}
+sub sharedname {
+ return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
+ "-",
+ $_[0]->shlib_version_as_filename(),
+ ($_[0]->shlibvariant() // ''));
+}
+
+sub sharedname_import {
+ return platform::BASE::__isshared($_[1]) ? $_[1] : undef;
+}
+
+sub sharedlib_import {
+ return platform::BASE::__concat($_[0]->sharedname_import($_[1]),
+ $_[0]->shlibextimport());
+}
+
+1;
diff --git a/Configurations/platform/Windows/MSVC.pm b/Configurations/platform/Windows/MSVC.pm
new file mode 100644
index 0000000000..6109749221
--- /dev/null
+++ b/Configurations/platform/Windows/MSVC.pm
@@ -0,0 +1,33 @@
+package platform::Windows::MSVC;
+
+use strict;
+use warnings;
+use Carp;
+
+use vars qw(@ISA);
+
+require platform::Windows;
+@ISA = qw(platform::Windows);
+
+# Assume someone set @INC right before loading this module
+use configdata;
+
+sub pdbext { '.pdb' }
+
+sub staticlibpdb {
+ return platform::BASE::__concat($_[0]->staticname($_[1]), $_[0]->pdbext());
+}
+
+sub sharedlibpdb {
+ return platform::BASE::__concat($_[0]->sharedname($_[1]), $_[0]->pdbext());
+}
+
+sub dsopdb {
+ return platform::BASE::__concat($_[0]->dsoname($_[1]), $_[0]->pdbext());
+}
+
+sub binpdb {
+ return platform::BASE::__concat($_[0]->binname($_[1]), $_[0]->pdbext());
+}
+
+1;