9dd4ed28eb
Add platform::Unix, which is a generic Unix module to support product name and extensions functionlity. However, this isn't quite enough, as mingw and Cygwin builds are done using the same templates, but since shared libraries work as on Windows and are named accordingly, platform::mingw and platform::Cygwin were also added to provide the necessary tweaks. This reworks Configurations/unix-Makefile.tmpl to work out product names in platform::Unix et al terms. In this one, we currently do care about the *_extension config attributes, and the modules adapt accordingly where it matters. This change also affected crypto/include/internal/dso_conf.h.in, since the DSO extension is meant to be the same as the short shared library extension, which isn't '.so' everywhere. 'shared_extension' attributes that had the value '.so.\$(SHLIB_VERSION_NUMBER)' are removed, platform::Unix provides an extension where the shared library version number is hard-coded instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7473)
45 lines
1.4 KiB
Perl
45 lines
1.4 KiB
Perl
package platform::mingw;
|
|
|
|
use strict;
|
|
use warnings;
|
|
use Carp;
|
|
|
|
use vars qw(@ISA);
|
|
|
|
require platform::Unix;
|
|
@ISA = qw(platform::Unix);
|
|
|
|
# Assume someone set @INC right before loading this module
|
|
use configdata;
|
|
|
|
sub binext { '.exe' }
|
|
sub objext { '.obj' }
|
|
sub libext { '.a' }
|
|
sub dsoext { '.dll' }
|
|
sub defext { '.def' }
|
|
sub shlibext { '.dll' }
|
|
sub shlibextimport { $target{shared_import_extension} || '.dll.a' }
|
|
sub shlibextsimple { undef }
|
|
sub makedepprog { $disabled{makedepend} ? undef : $config{makedepprog} }
|
|
|
|
(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(),
|
|
($config{target} eq "mingw64"
|
|
? "-x64" : ""));
|
|
}
|
|
|
|
# With Mingw and other DLL producers, there isn't really any "simpler"
|
|
# shared library name. However, there is a static import library, so
|
|
# we return that instead.
|
|
sub sharedlib_simple {
|
|
return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
|
|
$_[0]->shlibextimport());
|
|
}
|
|
|
|
1;
|