Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
package platform::Unix;
|
|
|
|
|
|
|
|
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 { $target{exe_extension} || '' }
|
2019-05-19 07:24:21 +08:00
|
|
|
sub dsoext { $target{dso_extension} || platform->shlibextsimple()
|
|
|
|
|| '.so' }
|
Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
# Because these are also used in scripts and not just Makefile, we must
|
|
|
|
# convert $(SHLIB_VERSION_NUMBER) to the actual number.
|
|
|
|
sub shlibext { (my $x = $target{shared_extension}
|
|
|
|
|| '.so.$(SHLIB_VERSION_NUMBER)')
|
|
|
|
=~ s|\.\$\(SHLIB_VERSION_NUMBER\)
|
|
|
|
|.$config{shlib_version}|x;
|
|
|
|
$x; }
|
|
|
|
sub libext { $target{lib_extension} || '.a' }
|
|
|
|
sub defext { $target{def_extension} || '.ld' }
|
|
|
|
sub objext { $target{obj_extension} || '.o' }
|
|
|
|
sub depext { $target{obj_extension} || '.d' }
|
|
|
|
|
|
|
|
# Other extra that aren't defined in platform::BASE
|
|
|
|
sub shlibextsimple { (my $x = $target{shared_extension} || '.so')
|
|
|
|
=~ s|\.\$\(SHLIB_VERSION_NUMBER\)||;
|
|
|
|
$x; }
|
|
|
|
sub shlibvariant { $target{shlib_variant} || "" }
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
sub makedepcmd { $disabled{makedepend} ? undef : $config{makedepcmd} }
|
Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
|
|
|
|
# No conversion of assembler extension on Unix
|
|
|
|
sub asm {
|
|
|
|
return $_[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
# At some point, we might decide that static libraries are called something
|
|
|
|
# other than the default...
|
|
|
|
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]);
|
2021-06-16 12:09:41 +08:00
|
|
|
return $in_libname
|
|
|
|
if $unified_info{attributes}->{libraries}->{$_[1]}->{noinst};
|
Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
|
|
|
|
# We currently return the same name anyway... but we might choose to
|
|
|
|
# append '_static' or '_a' some time in the future.
|
|
|
|
return platform::BASE->staticname($_[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub sharedname {
|
|
|
|
return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
|
|
|
|
($_[0]->shlibvariant() // ''));
|
|
|
|
}
|
|
|
|
|
|
|
|
sub sharedname_simple {
|
|
|
|
return platform::BASE::__isshared($_[1]) ? $_[1] : undef;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub sharedlib_simple {
|
2021-09-15 15:11:41 +08:00
|
|
|
# This function returns the simplified shared library name (no version
|
|
|
|
# or variant in the shared library file name) if the simple variants of
|
|
|
|
# the base name or the suffix differ from the full variants of the same.
|
|
|
|
|
|
|
|
# Note: if $_[1] isn't a shared library name, then $_[0]->sharedname()
|
|
|
|
# and $_[0]->sharedname_simple() will return undef. This needs being
|
|
|
|
# accounted for.
|
|
|
|
my $name = $_[0]->sharedname($_[1]);
|
|
|
|
my $simplename = $_[0]->sharedname_simple($_[1]);
|
|
|
|
my $ext = $_[0]->shlibext();
|
|
|
|
my $simpleext = $_[0]->shlibextsimple();
|
|
|
|
|
|
|
|
return undef unless defined $simplename && defined $name;
|
|
|
|
return undef if ($name eq $simplename && $ext eq $simpleext);
|
|
|
|
return platform::BASE::__concat($simplename, $simpleext);
|
Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
}
|
|
|
|
|
2021-01-15 19:20:25 +08:00
|
|
|
sub sharedlib_import {
|
|
|
|
return undef;
|
|
|
|
}
|
|
|
|
|
Rework building: Unix changes to handle extensions and product names
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)
2018-10-23 21:09:57 +08:00
|
|
|
1;
|