2016-01-30 02:25:40 +00:00
|
|
|
##
|
|
|
|
## Makefile for OpenSSL
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
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 13:09:57 +00:00
|
|
|
our $makedepprog = platform->makedepprog();
|
2016-02-20 15:27:27 +00:00
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
|
2016-02-15 16:42:14 +00:00
|
|
|
|
2018-06-14 09:45:15 +00:00
|
|
|
# Shared AIX support is special. We put libcrypto[64].so.ver into
|
|
|
|
# libcrypto.a and use libcrypto_a.a as static one.
|
|
|
|
sub sharedaix { !$disabled{shared} && $config{target} =~ /^aix/ }
|
|
|
|
|
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 13:09:57 +00:00
|
|
|
our $sover_dirname = platform->shlib_version_as_filename();
|
2017-04-18 14:24:23 +00:00
|
|
|
|
2016-06-26 12:09:23 +00:00
|
|
|
# This makes sure things get built in the order they need
|
|
|
|
# to. You're welcome.
|
|
|
|
sub dependmagic {
|
|
|
|
my $target = shift;
|
|
|
|
|
|
|
|
return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
|
|
|
|
}
|
2016-02-20 15:27:27 +00:00
|
|
|
'';
|
2016-01-30 02:25:40 +00:00
|
|
|
-}
|
|
|
|
PLATFORM={- $config{target} -}
|
|
|
|
OPTIONS={- $config{options} -}
|
|
|
|
CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
|
|
|
|
SRCDIR={- $config{sourcedir} -}
|
|
|
|
BLDDIR={- $config{builddir} -}
|
|
|
|
|
2018-12-06 23:32:43 +00:00
|
|
|
VERSION={- "$config{full_version}" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
MAJOR={- $config{major} -}
|
|
|
|
MINOR={- $config{minor} -}
|
Switch to MAJOR.MINOR.PATCH versioning and version 3.0.0-dev
We're strictly use version numbers of the form MAJOR.MINOR.PATCH.
Letter releases are things of days past.
The most central change is that we now express the version number with
three macros, one for each part of the version number:
OPENSSL_VERSION_MAJOR
OPENSSL_VERSION_MINOR
OPENSSL_VERSION_PATCH
We also provide two additional macros to express pre-release and build
metadata information (also specified in semantic versioning):
OPENSSL_VERSION_PRE_RELEASE
OPENSSL_VERSION_BUILD_METADATA
To get the library's idea of all those values, we introduce the
following functions:
unsigned int OPENSSL_version_major(void);
unsigned int OPENSSL_version_minor(void);
unsigned int OPENSSL_version_patch(void);
const char *OPENSSL_version_pre_release(void);
const char *OPENSSL_version_build_metadata(void);
Additionally, for shared library versioning (which is out of scope in
semantic versioning, but that we still need):
OPENSSL_SHLIB_VERSION
We also provide a macro that contains the release date. This is not
part of the version number, but is extra information that we want to
be able to display:
OPENSSL_RELEASE_DATE
Finally, also provide the following convenience functions:
const char *OPENSSL_version_text(void);
const char *OPENSSL_version_text_full(void);
The following macros and functions are deprecated, and while currently
existing for backward compatibility, they are expected to disappear:
OPENSSL_VERSION_NUMBER
OPENSSL_VERSION_TEXT
OPENSSL_VERSION
OpenSSL_version_num()
OpenSSL_version()
Also, this function is introduced to replace OpenSSL_version() for all
indexes except for OPENSSL_VERSION:
OPENSSL_info()
For configuration, the option 'newversion-only' is added to disable all
the macros and functions that are mentioned as deprecated above.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7724)
2018-09-27 13:56:35 +00:00
|
|
|
SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
|
2016-01-30 02:25:40 +00:00
|
|
|
SHLIB_TARGET={- $target{shared_target} -}
|
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 13:09:57 +00:00
|
|
|
|
|
|
|
LIBS={- join(" ", map { platform->staticlib($_) // () } @{$unified_info{libraries}}) -}
|
|
|
|
SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
|
|
|
|
SHLIB_INFO={- join(" ", map { my $x = platform->sharedlib($_);
|
|
|
|
my $y = platform->sharedlib_simple($_);
|
|
|
|
$x ? "\"$x;$y\"" : () }
|
|
|
|
@{$unified_info{libraries}}) -}
|
2019-01-30 23:06:50 +00:00
|
|
|
MODULES={- join(" ", map { platform->dso($_) } @{$unified_info{modules}}) -}
|
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 13:09:57 +00:00
|
|
|
PROGRAMS={- join(" ", map { platform->bin($_) } @{$unified_info{programs}}) -}
|
2016-01-30 02:25:40 +00:00
|
|
|
SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
|
2016-03-09 00:17:27 +00:00
|
|
|
{- output_off() if $disabled{makedepend}; "" -}
|
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 13:09:57 +00:00
|
|
|
DEPS={- join(" ", map { platform->isobj($_) ? platform->dep($_) : () }
|
2016-02-18 18:41:57 +00:00
|
|
|
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
|
|
|
|
keys %{$unified_info{sources}}); -}
|
2016-03-09 00:17:27 +00:00
|
|
|
{- output_on() if $disabled{makedepend}; "" -}
|
Configuration: Simplify generating list of generated files in build file templates
Computing the value of the GENERATED variable in the build file
templates is somewhat overcomplicated, and because of possible
duplication errors, changes are potentially error prone.
Looking more closely at how this list is determined, it can be
observed that the exact list of files to check is consistently
available in all the values found in the %unified_info tables
'depends', 'sources' and 'shared_sources', and all that's needed is to
filter those values so only those present as keys in the 'generate'
table are left.
This computation is also common for all build files, so due to its
apparent complexity, we move it to common0.tmpl, with the result left
in a global variable (@generated), to be consumed by all build file
templates.
common0.tmpl is included among the files to process when creating
build files, but unlike common.tmpl, it comes first of all.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5930)
2018-04-11 11:13:22 +00:00
|
|
|
GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}}) -}
|
|
|
|
GENERATED={- # common0.tmpl provides @generated
|
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 13:09:57 +00:00
|
|
|
join(" ", map { platform->convertext($_) } @generated ) -}
|
|
|
|
|
2018-11-07 10:02:06 +00:00
|
|
|
INSTALL_LIBS={-
|
|
|
|
join(" ", map { platform->staticlib($_) // () }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_SHLIBS={-
|
|
|
|
join(" ", map { platform->sharedlib($_) // () }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_SHLIB_INFO={-
|
|
|
|
join(" ", map { my $x = platform->sharedlib($_);
|
|
|
|
my $y = platform->sharedlib_simple($_);
|
|
|
|
$x ? "\"$x;$y\"" : () }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_ENGINES={-
|
|
|
|
join(" ", map { platform->dso($_) }
|
2019-01-30 23:06:50 +00:00
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{$_}->{engine} }
|
|
|
|
@{$unified_info{modules}})
|
2018-11-07 10:02:06 +00:00
|
|
|
-}
|
|
|
|
INSTALL_PROGRAMS={-
|
|
|
|
join(" ", map { platform->bin($_) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{programs}})
|
|
|
|
-}
|
Build: use attributes to indicate installed script classes
We have two classes of scripts to be installed, those that are
installed as "normal" programs, and those that are installed as "misc"
scripts. These classes are installed in different locations, so the
build file templates must pay attention.
Because we didn't have the tools to indicate what scripts go where, we
had these scripts hard coded in the build template files, with the
maintenance issues that may cause. Now that we have attributes, those
can be used to classify the installed scripts, and have the build file
templates simply check the attributes to know what's what.
Furthermore, the 'tsget.pl' script exists both as 'tsget.pl' and
'tsget', which is done by installing a symbolic link (or copy). This
link name is now given through an attribute, which results in even
less hard coding in the Unix Makefile template.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7581)
2018-11-07 10:05:17 +00:00
|
|
|
BIN_SCRIPTS={-
|
|
|
|
join(" ", map { my $x = $unified_info{attributes}->{$_}->{linkname};
|
|
|
|
$x ? "$_:$x" : $_ }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& !$unified_info{attributes}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}})
|
|
|
|
-}
|
|
|
|
MISC_SCRIPTS={-
|
|
|
|
join(" ", map { my $x = $unified_info{attributes}->{$_}->{linkname};
|
|
|
|
$x ? "$_:$x" : $_ }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}})
|
|
|
|
-}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2017-06-15 17:31:01 +00:00
|
|
|
APPS_OPENSSL={- use File::Spec::Functions;
|
|
|
|
catfile("apps","openssl") -}
|
|
|
|
|
2016-02-12 20:14:03 +00:00
|
|
|
# DESTDIR is for package builders so that they can configure for, say,
|
|
|
|
# /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
2016-01-30 02:25:40 +00:00
|
|
|
# Normally it is left empty.
|
2016-02-12 20:14:03 +00:00
|
|
|
DESTDIR=
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
# Do not edit these manually. Use Configure with --prefix or --openssldir
|
|
|
|
# to change this! Short explanation in the top comment in Configure
|
|
|
|
INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
|
|
|
|
#
|
|
|
|
our $prefix = $config{prefix} || "/usr/local";
|
|
|
|
$prefix -}
|
|
|
|
OPENSSLDIR={- #
|
|
|
|
# The logic here is that if no --openssldir was given,
|
|
|
|
# OPENSSLDIR will get the value from $prefix plus "/ssl".
|
|
|
|
# If --openssldir was given and the value is an absolute
|
|
|
|
# path, OPENSSLDIR will get its value without change.
|
|
|
|
# If the value from --openssldir is a relative path,
|
|
|
|
# OPENSSLDIR will get $prefix with the --openssldir
|
|
|
|
# value appended as a subdirectory.
|
|
|
|
#
|
|
|
|
use File::Spec::Functions;
|
|
|
|
our $openssldir =
|
|
|
|
$config{openssldir} ?
|
|
|
|
(file_name_is_absolute($config{openssldir}) ?
|
|
|
|
$config{openssldir}
|
|
|
|
: catdir($prefix, $config{openssldir}))
|
|
|
|
: catdir($prefix, "ssl");
|
|
|
|
$openssldir -}
|
2018-02-23 11:10:42 +00:00
|
|
|
LIBDIR={- our $libdir = $config{libdir};
|
|
|
|
unless ($libdir) {
|
|
|
|
#
|
|
|
|
# if $prefix/lib$target{multilib} is not an existing
|
|
|
|
# directory, then assume that it's not searched by linker
|
|
|
|
# automatically, in which case adding $target{multilib} suffix
|
|
|
|
# causes more grief than we're ready to tolerate, so don't...
|
|
|
|
our $multilib =
|
|
|
|
-d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
|
|
|
|
$libdir = "lib$multilib";
|
|
|
|
}
|
|
|
|
file_name_is_absolute($libdir) ? "" : $libdir -}
|
|
|
|
# $(libdir) is chosen to be compatible with the GNU coding standards
|
|
|
|
libdir={- file_name_is_absolute($libdir)
|
|
|
|
? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
|
|
|
|
ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
|
2019-02-05 22:18:50 +00:00
|
|
|
MODULESDIR=$(libdir)/ossl-modules
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-10-12 15:05:35 +00:00
|
|
|
# Convenience variable for those who want to set the rpath in shared
|
|
|
|
# libraries and applications
|
2018-02-23 11:10:42 +00:00
|
|
|
LIBRPATH=$(libdir)
|
2016-10-12 15:05:35 +00:00
|
|
|
|
2016-02-13 16:55:48 +00:00
|
|
|
MANDIR=$(INSTALLTOP)/share/man
|
2016-02-19 09:38:15 +00:00
|
|
|
DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
|
|
|
|
HTMLDIR=$(DOCDIR)/html
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-02-15 12:37:17 +00:00
|
|
|
# MANSUFFIX is for the benefit of anyone who may want to have a suffix
|
|
|
|
# appended after the manpage file section number. "ssl" is popular,
|
|
|
|
# resulting in files such as config.5ssl rather than config.5.
|
|
|
|
MANSUFFIX=
|
2016-01-30 02:25:40 +00:00
|
|
|
HTMLSUFFIX=html
|
|
|
|
|
2017-06-29 15:40:19 +00:00
|
|
|
# For "optional" echo messages, to get "real" silence
|
|
|
|
ECHO = echo
|
2016-01-30 02:25:40 +00:00
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
##### User defined commands and flags ################################
|
|
|
|
|
|
|
|
# We let the C compiler driver to take care of .s files. This is done in
|
|
|
|
# order to be excused from maintaining a separate set of architecture
|
|
|
|
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
|
|
|
|
# gcc, then the driver will automatically translate it to -xarch=v8plus
|
|
|
|
# and pass it down to assembler. In any case, we do not define AS or
|
|
|
|
# ASFLAGS for this reason.
|
|
|
|
|
|
|
|
CROSS_COMPILE={- $config{CROSS_COMPILE} -}
|
|
|
|
CC=$(CROSS_COMPILE){- $config{CC} -}
|
|
|
|
CXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -}
|
|
|
|
CPPFLAGS={- our $cppflags1 = join(" ",
|
|
|
|
(map { "-D".$_} @{$config{CPPDEFINES}}),
|
|
|
|
(map { "-I".$_} @{$config{CPPINCLUDES}}),
|
|
|
|
@{$config{CPPFLAGS}}) -}
|
|
|
|
CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
|
|
|
|
CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
|
|
|
|
LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
|
|
|
|
EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
|
|
|
|
|
|
|
|
MAKEDEPEND={- $config{makedepprog} -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2018-07-08 10:00:06 +00:00
|
|
|
PERL={- $config{PERL} -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
AR=$(CROSS_COMPILE){- $config{AR} -}
|
|
|
|
ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
|
|
|
|
RANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -}
|
|
|
|
RC= $(CROSS_COMPILE){- $config{RC} -}
|
|
|
|
RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -}
|
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
RM= rm -f
|
2016-02-15 21:12:24 +00:00
|
|
|
RMDIR= rmdir
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
TAR= {- $target{TAR} || "tar" -}
|
|
|
|
TARFLAGS= {- $target{TARFLAGS} -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
BASENAME= openssl
|
|
|
|
NAME= $(BASENAME)-$(VERSION)
|
2018-11-24 10:27:50 +00:00
|
|
|
# Relative to $(SRCDIR)
|
2016-01-30 02:25:40 +00:00
|
|
|
TARFILE= ../$(NAME).tar
|
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
##### Project flags ##################################################
|
|
|
|
|
|
|
|
# Variables starting with CNF_ are common variables for all product types
|
|
|
|
|
|
|
|
CNF_CPPFLAGS={- our $cppflags2 =
|
|
|
|
join(' ', $target{cppflags} || (),
|
|
|
|
(map { "-D".$_} @{$target{defines}},
|
|
|
|
@{$config{defines}}),
|
|
|
|
(map { "-I".$_} @{$target{includes}},
|
|
|
|
@{$config{includes}}),
|
|
|
|
@{$config{cppflags}}) -}
|
|
|
|
CNF_CFLAGS={- join(' ', $target{cflags} || (),
|
|
|
|
@{$config{cflags}}) -}
|
|
|
|
CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
|
|
|
|
@{$config{cxxflags}}) -}
|
|
|
|
CNF_LDFLAGS={- join(' ', $target{lflags} || (),
|
|
|
|
@{$config{lflags}}) -}
|
|
|
|
CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
|
|
|
|
@{$config{ex_libs}}) -}
|
|
|
|
|
|
|
|
# Variables starting with LIB_ are used to build library object files
|
|
|
|
# and shared libraries.
|
|
|
|
# Variables starting with DSO_ are used to build DSOs and their object files.
|
|
|
|
# Variables starting with BIN_ are used to build programs and their object
|
|
|
|
# files.
|
|
|
|
|
2018-03-09 11:39:01 +00:00
|
|
|
LIB_CPPFLAGS={- our $lib_cppflags =
|
|
|
|
join(' ', $target{lib_cppflags} || (),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
$target{shared_cppflag} || (),
|
|
|
|
(map { '-D'.$_ }
|
2019-02-13 03:21:59 +00:00
|
|
|
@{$config{lib_defines} || ()},
|
|
|
|
@{$config{shared_defines} || ()}),
|
2018-03-09 11:39:01 +00:00
|
|
|
@{$config{lib_cppflags}},
|
|
|
|
@{$config{shared_cppflag}});
|
|
|
|
join(' ', $lib_cppflags,
|
|
|
|
(map { '-D'.$_ }
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
'OPENSSLDIR="\"$(OPENSSLDIR)\""',
|
2019-02-05 22:18:50 +00:00
|
|
|
'ENGINESDIR="\"$(ENGINESDIR)\""',
|
|
|
|
'MODULESDIR="\"$(MODULESDIR)\""'),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
|
|
|
|
$target{shared_cflag} || (),
|
|
|
|
@{$config{lib_cflags}},
|
|
|
|
@{$config{shared_cflag}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
|
|
|
|
$target{shared_cxxflag} || (),
|
|
|
|
@{$config{lib_cxxflags}},
|
|
|
|
@{$config{shared_cxxflag}},
|
|
|
|
'$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
|
|
|
|
LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
|
|
|
|
$config{shared_ldflag} || (),
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
|
|
|
|
$target{module_cppflags} || (),
|
2019-02-13 03:21:59 +00:00
|
|
|
(map { '-D'.$_ }
|
|
|
|
@{$config{dso_defines} || ()},
|
|
|
|
@{$config{module_defines} || ()}),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
@{$config{dso_cppflags}},
|
|
|
|
@{$config{module_cppflags}},
|
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
|
|
|
|
$target{module_cflags} || (),
|
|
|
|
@{$config{dso_cflags}},
|
|
|
|
@{$config{module_cflags}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
DSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (),
|
|
|
|
$target{module_cxxflags} || (),
|
|
|
|
@{$config{dso_cxxflags}},
|
|
|
|
@{$config{module_cxxflag}},
|
|
|
|
'$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
|
|
|
|
DSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (),
|
|
|
|
$target{module_ldflags} || (),
|
|
|
|
@{$config{dso_ldflags}},
|
|
|
|
@{$config{module_ldflags}},
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
|
2019-02-13 03:21:59 +00:00
|
|
|
(map { '-D'.$_ } @{$config{bin_defines} || ()}),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
@{$config{bin_cppflags}},
|
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
|
|
|
|
@{$config{bin_cflags}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
BIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (),
|
|
|
|
@{$config{bin_cxxflags}},
|
|
|
|
'$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
|
|
|
|
BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
|
|
|
|
@{$config{bin_lflags}},
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
|
|
|
|
# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
|
|
|
|
CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
|
|
|
|
$cppflags2 =~ s|([\\"])|\\$1|g;
|
2018-03-09 11:39:01 +00:00
|
|
|
$lib_cppflags =~ s|([\\"])|\\$1|g;
|
|
|
|
join(' ', $lib_cppflags || (), $cppflags2 || (),
|
|
|
|
$cppflags1 || ()) -}
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
PERLASM_SCHEME= {- $target{perlasm_scheme} -}
|
|
|
|
|
|
|
|
# For x86 assembler: Set PROCESSOR to 386 if you want to support
|
|
|
|
# the 80386.
|
|
|
|
PROCESSOR= {- $config{processor} -}
|
|
|
|
|
2016-07-28 21:05:32 +00:00
|
|
|
# We want error [and other] messages in English. Trouble is that make(1)
|
|
|
|
# doesn't pass macros down as environment variables unless there already
|
|
|
|
# was corresponding variable originally set. In other words we can only
|
|
|
|
# reassign environment variables, but not set new ones, not in portable
|
|
|
|
# manner that is. That's why we reassign several, just to be sure...
|
|
|
|
LC_ALL=C
|
|
|
|
LC_MESSAGES=C
|
|
|
|
LANG=C
|
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
# The main targets ###################################################
|
|
|
|
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('all'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
|
2016-06-26 12:09:23 +00:00
|
|
|
{- dependmagic('build_libs'); -}: build_libs_nodep
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('build_modules'); -}: build_modules_nodep
|
2016-07-08 15:58:36 +00:00
|
|
|
{- dependmagic('build_programs'); -}: build_programs_nodep
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-06-26 12:09:23 +00:00
|
|
|
build_generated: $(GENERATED_MANDATORY)
|
2016-02-18 18:41:57 +00:00
|
|
|
build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
|
2019-01-30 23:06:50 +00:00
|
|
|
build_modules_nodep: $(MODULES)
|
2016-07-08 15:58:36 +00:00
|
|
|
build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
|
|
|
|
|
|
|
|
# Kept around for backward compatibility
|
|
|
|
build_apps build_tests: build_programs
|
2016-02-13 17:15:51 +00:00
|
|
|
|
2017-06-16 01:46:41 +00:00
|
|
|
# Convenience target to prebuild all generated files, not just the mandatory
|
|
|
|
# ones
|
|
|
|
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
|
2018-04-11 08:11:07 +00:00
|
|
|
@ : {- output_off() if $disabled{makedepend}; "" -}
|
|
|
|
@echo "Warning: consider configuring with no-makedepend, because if"
|
|
|
|
@echo " target system doesn't have $(PERL),"
|
|
|
|
@echo " then make will fail..."
|
|
|
|
@ : {- output_on() if $disabled{makedepend}; "" -}
|
2017-06-16 01:46:41 +00:00
|
|
|
|
2016-04-18 12:09:36 +00:00
|
|
|
test: tests
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils
|
2016-04-14 12:44:15 +00:00
|
|
|
@ : {- output_off() if $disabled{tests}; "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
( cd test; \
|
2017-10-09 15:57:13 +00:00
|
|
|
mkdir -p test-runs; \
|
2016-01-30 02:25:40 +00:00
|
|
|
SRCTOP=../$(SRCDIR) \
|
|
|
|
BLDTOP=../$(BLDDIR) \
|
2017-10-09 15:57:13 +00:00
|
|
|
RESULT_D=test-runs \
|
2016-05-27 15:18:57 +00:00
|
|
|
PERL="$(PERL)" \
|
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 13:09:57 +00:00
|
|
|
EXE_EXT={- platform->binext() -} \
|
2018-04-26 17:22:30 +00:00
|
|
|
OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines 2>/dev/null && pwd` \
|
2016-11-03 16:08:10 +00:00
|
|
|
OPENSSL_DEBUG_MEMORY=on \
|
2016-01-30 02:25:40 +00:00
|
|
|
$(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
|
2016-04-14 12:44:15 +00:00
|
|
|
@ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
@echo "Tests are not supported with your chosen Configure options"
|
|
|
|
@ : {- output_on() if !$disabled{tests}; "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
list-tests:
|
2016-06-16 22:23:43 +00:00
|
|
|
@ : {- output_off() if $disabled{tests}; "" -}
|
|
|
|
@SRCTOP="$(SRCDIR)" \
|
|
|
|
$(PERL) $(SRCDIR)/test/run_tests.pl list
|
|
|
|
@ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
@echo "Tests are not supported with your chosen Configure options"
|
|
|
|
@ : {- output_on() if !$disabled{tests}; "" -}
|
|
|
|
|
|
|
|
install: install_sw install_ssldirs install_docs
|
|
|
|
|
|
|
|
uninstall: uninstall_docs uninstall_sw
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
libclean:
|
2016-02-15 21:13:41 +00:00
|
|
|
@set -e; for s in $(SHLIB_INFO); do \
|
2018-04-13 19:41:14 +00:00
|
|
|
if [ "$$s" = ";" ]; then continue; fi; \
|
2016-02-15 21:13:41 +00:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
2018-04-13 19:41:14 +00:00
|
|
|
$(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
|
|
|
|
$(RM) apps/$$s1; \
|
|
|
|
$(RM) test/$$s1; \
|
|
|
|
$(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
|
2016-02-15 21:13:41 +00:00
|
|
|
$(RM) $$s1; \
|
|
|
|
if [ "$$s1" != "$$s2" ]; then \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) $(RM) $$s2; \
|
2016-02-15 21:13:41 +00:00
|
|
|
$(RM) $$s2; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
$(RM) $(LIBS)
|
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 13:09:57 +00:00
|
|
|
$(RM) *{- platform->defext() -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
clean: libclean
|
2019-01-30 23:06:50 +00:00
|
|
|
$(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(SCRIPTS)
|
2018-04-13 21:24:01 +00:00
|
|
|
$(RM) $(GENERATED_MANDATORY) $(GENERATED)
|
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 13:09:57 +00:00
|
|
|
-$(RM) `find . -name .git -prune -o -name '*{- platform->depext() -}' -print`
|
|
|
|
-$(RM) `find . -name .git -prune -o -name '*{- platform->objext() -}' -print`
|
2016-06-16 22:23:43 +00:00
|
|
|
$(RM) core
|
2017-03-11 13:56:44 +00:00
|
|
|
$(RM) tags TAGS doc-nits
|
2017-12-14 20:16:41 +00:00
|
|
|
$(RM) -r test/test-runs
|
2016-06-16 22:23:43 +00:00
|
|
|
$(RM) openssl.pc libcrypto.pc libssl.pc
|
2018-08-18 15:45:08 +00:00
|
|
|
-$(RM) `find . -name .git -prune -o -type l -print`
|
2016-06-16 22:23:43 +00:00
|
|
|
$(RM) $(TARFILE)
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-06-13 20:02:11 +00:00
|
|
|
distclean: clean
|
2016-06-16 22:23:43 +00:00
|
|
|
$(RM) configdata.pm
|
|
|
|
$(RM) Makefile
|
2016-06-13 20:02:11 +00:00
|
|
|
|
2016-02-21 15:09:36 +00:00
|
|
|
# We check if any depfile is newer than Makefile and decide to
|
2016-03-18 19:52:29 +00:00
|
|
|
# concatenate only if that is true.
|
2016-02-20 16:29:23 +00:00
|
|
|
depend:
|
2016-03-09 00:17:27 +00:00
|
|
|
@: {- output_off() if $disabled{makedepend}; "" -}
|
2018-03-15 17:06:18 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/add-depends.pl {-
|
|
|
|
defined $makedepprog && $makedepprog =~ /\/makedepend/
|
|
|
|
? 'makedepend' : 'gcc' -}
|
2016-03-09 00:17:27 +00:00
|
|
|
@: {- output_on() if $disabled{makedepend}; "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
# Install helper targets #############################################
|
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_sw: install_dev install_engines install_runtime
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-02-15 21:13:41 +00:00
|
|
|
uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
install_docs: install_man_docs install_html_docs
|
|
|
|
|
|
|
|
uninstall_docs: uninstall_man_docs uninstall_html_docs
|
2019-05-27 12:20:20 +00:00
|
|
|
$(RM) -r $(DESTDIR)$(DOCDIR)
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-02-13 16:55:48 +00:00
|
|
|
install_ssldirs:
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
|
2016-08-01 21:15:50 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
|
2016-06-16 22:23:43 +00:00
|
|
|
@set -e; for x in dummy $(MISC_SCRIPTS); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2018-07-23 11:25:45 +00:00
|
|
|
x1=`echo "$$x" | cut -f1 -d:`; \
|
|
|
|
x2=`echo "$$x" | cut -f2 -d:`; \
|
|
|
|
fn=`basename $$x1`; \
|
|
|
|
$(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
|
|
|
cp $$x1 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
|
2016-06-16 22:23:43 +00:00
|
|
|
chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
|
|
|
|
$(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
|
2018-07-23 11:25:45 +00:00
|
|
|
if [ "$$x1" != "$$x2" ]; then \
|
|
|
|
ln=`basename "$$x2"`; \
|
|
|
|
: {- output_off() unless windowsdll(); "" -}; \
|
|
|
|
$(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
|
|
|
cp $(DESTDIR)$(OPENSSLDIR)/misc/$$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
|
|
|
|
: {- output_on() unless windowsdll();
|
|
|
|
output_off() if windowsdll(); "" -}; \
|
|
|
|
$(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
|
|
|
ln -sf $$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
|
|
|
|
: {- output_on() if windowsdll(); "" -}; \
|
|
|
|
fi; \
|
2016-06-16 22:23:43 +00:00
|
|
|
done
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
|
2016-06-16 22:23:43 +00:00
|
|
|
@cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
|
|
|
|
@chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
|
2016-08-01 21:18:25 +00:00
|
|
|
@mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
|
2016-09-09 22:05:41 +00:00
|
|
|
@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
|
2016-08-01 21:18:25 +00:00
|
|
|
cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
|
|
|
|
chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
|
|
|
|
fi
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
|
2016-09-09 22:05:41 +00:00
|
|
|
@cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
|
|
|
|
@chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
|
|
|
|
@mv -f $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist
|
|
|
|
@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
|
2016-09-09 22:05:41 +00:00
|
|
|
cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
|
|
|
|
chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
|
|
|
|
fi
|
2016-02-13 16:55:48 +00:00
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
install_dev: install_runtime_libs
|
2016-01-30 02:25:40 +00:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Installing development files"
|
2016-02-12 20:14:03 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
|
2018-10-15 15:38:26 +00:00
|
|
|
@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2016-07-14 19:11:46 +00:00
|
|
|
@cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
|
|
|
|
@chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
|
2018-10-15 15:38:26 +00:00
|
|
|
@ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
@set -e; for i in $(SRCDIR)/include/openssl/*.h \
|
|
|
|
$(BLDDIR)/include/openssl/*.h; do \
|
|
|
|
fn=`basename $$i`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
|
|
|
|
chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2018-02-23 11:10:42 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for l in $(INSTALL_LIBS); do \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$l`; \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
|
|
|
|
cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
|
|
|
|
$(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
|
|
|
|
chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(libdir)/$$fn.new \
|
|
|
|
$(DESTDIR)$(libdir)/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-02-22 12:52:46 +00:00
|
|
|
@ : {- output_off() if $disabled{shared}; "" -}
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for s in $(INSTALL_SHLIB_INFO); do \
|
2016-02-15 17:39:49 +00:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
|
|
|
fn1=`basename $$s1`; \
|
|
|
|
fn2=`basename $$s2`; \
|
2018-06-14 09:45:15 +00:00
|
|
|
: {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
|
2016-02-15 17:39:49 +00:00
|
|
|
if [ "$$fn1" != "$$fn2" ]; then \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
|
|
|
|
ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fi; \
|
2018-06-14 09:45:15 +00:00
|
|
|
: {- output_off() unless windowsdll() or sharedaix(); output_on() if windowsdll(); "" -}; \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "install $$s2 -> $(DESTDIR)$(libdir)/$$fn2"; \
|
|
|
|
cp $$s2 $(DESTDIR)$(libdir)/$$fn2.new; \
|
|
|
|
chmod 755 $(DESTDIR)$(libdir)/$$fn2.new; \
|
|
|
|
mv -f $(DESTDIR)$(libdir)/$$fn2.new \
|
|
|
|
$(DESTDIR)$(libdir)/$$fn2; \
|
2018-06-14 09:45:15 +00:00
|
|
|
: {- output_off() if windowsdll(); output_on() if sharedaix(); "" -}; \
|
|
|
|
a=$(DESTDIR)$(libdir)/$$fn2; \
|
|
|
|
$(ECHO) "install $$s1 -> $$a"; \
|
|
|
|
if [ -f $$a ]; then ( trap "rm -rf /tmp/ar.$$$$" INT 0; \
|
|
|
|
mkdir /tmp/ar.$$$$; ( cd /tmp/ar.$$$$; \
|
|
|
|
cp -f $$a $$a.new; \
|
|
|
|
for so in `$(AR) t $$a`; do \
|
|
|
|
$(AR) x $$a $$so; \
|
|
|
|
chmod u+w $$so; \
|
|
|
|
strip -X32_64 -e $$so; \
|
|
|
|
$(AR) r $$a.new $$so; \
|
|
|
|
done; \
|
|
|
|
)); fi; \
|
|
|
|
$(AR) r $$a.new $$s1; \
|
|
|
|
mv -f $$a.new $$a; \
|
|
|
|
: {- output_off() if sharedaix(); output_on(); "" -}; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-02-22 12:52:46 +00:00
|
|
|
@ : {- output_on() if $disabled{shared}; "" -}
|
2018-02-23 11:10:42 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)/pkgconfig
|
|
|
|
@$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
|
|
|
|
@cp libcrypto.pc $(DESTDIR)$(libdir)/pkgconfig
|
|
|
|
@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
|
|
|
|
@$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
|
|
|
|
@cp libssl.pc $(DESTDIR)$(libdir)/pkgconfig
|
|
|
|
@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
|
|
|
|
@$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
|
|
|
|
@cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
|
|
|
|
@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
uninstall_dev: uninstall_runtime_libs
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Uninstalling development files"
|
2018-10-15 15:38:26 +00:00
|
|
|
@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2016-07-14 19:11:46 +00:00
|
|
|
@$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
|
2018-10-15 15:38:26 +00:00
|
|
|
@ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
@set -e; for i in $(SRCDIR)/include/openssl/*.h \
|
|
|
|
$(BLDDIR)/include/openssl/*.h; do \
|
|
|
|
fn=`basename $$i`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-02-15 21:12:24 +00:00
|
|
|
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
|
|
|
|
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for l in $(INSTALL_LIBS); do \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$l`; \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-02-22 12:52:46 +00:00
|
|
|
@ : {- output_off() if $disabled{shared}; "" -}
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for s in $(INSTALL_SHLIB_INFO); do \
|
2016-02-15 17:39:49 +00:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
|
|
|
fn1=`basename $$s1`; \
|
|
|
|
fn2=`basename $$s2`; \
|
|
|
|
: {- output_off() if windowsdll(); "" -}; \
|
2018-06-14 09:45:15 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/$$fn2; \
|
|
|
|
if [ "$$fn1" != "$$fn2" -a -f "$(DESTDIR)$(libdir)/$$fn1" ]; then \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/$$fn1; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fi; \
|
2016-02-15 17:39:49 +00:00
|
|
|
: {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/$$fn2; \
|
2016-02-19 21:23:28 +00:00
|
|
|
: {- output_on() unless windowsdll(); "" -}; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-03-04 04:43:15 +00:00
|
|
|
@ : {- output_on() if $disabled{shared}; "" -}
|
2018-02-23 11:10:42 +00:00
|
|
|
$(RM) $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
|
|
|
|
$(RM) $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
|
|
|
|
-$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
|
|
|
|
-$(RMDIR) $(DESTDIR)$(libdir)
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2019-01-30 23:06:50 +00:00
|
|
|
install_engines: install_runtime_libs build_modules
|
2016-01-30 02:25:40 +00:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2016-07-06 16:50:47 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
|
2019-01-30 23:06:50 +00:00
|
|
|
@$(ECHO) "*** Installing ENGINE modules"
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$e`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
|
2016-07-06 16:50:47 +00:00
|
|
|
cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
|
|
|
|
chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
|
|
|
|
$(DESTDIR)$(ENGINESDIR)/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
uninstall_engines:
|
2019-01-30 23:06:50 +00:00
|
|
|
@$(ECHO) "*** Uninstalling ENGINE modules"
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$e`; \
|
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 13:09:57 +00:00
|
|
|
if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
|
2016-02-19 09:39:12 +00:00
|
|
|
continue; \
|
|
|
|
fi; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
|
2016-07-06 16:50:47 +00:00
|
|
|
$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-07-06 16:50:47 +00:00
|
|
|
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
install_runtime: install_programs
|
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_runtime_libs: build_libs
|
2016-01-30 02:25:40 +00:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2016-07-19 11:24:57 +00:00
|
|
|
@ : {- output_off() if windowsdll(); "" -}
|
2018-02-23 11:10:42 +00:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
|
2018-11-19 09:21:49 +00:00
|
|
|
@ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -}
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
|
|
|
|
@ : {- output_on() unless windowsdll(); "" -}
|
2018-10-25 07:09:20 +00:00
|
|
|
@$(ECHO) "*** Installing runtime libraries"
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$s" = "dummy" ]; then continue; fi; \
|
2016-02-15 21:13:41 +00:00
|
|
|
fn=`basename $$s`; \
|
2016-07-19 11:24:57 +00:00
|
|
|
: {- output_off() unless windowsdll(); "" -}; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
2019-02-13 15:52:04 +00:00
|
|
|
chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
2016-02-12 20:14:03 +00:00
|
|
|
mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
|
|
|
|
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-07-19 11:24:57 +00:00
|
|
|
: {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
|
2018-02-23 11:10:42 +00:00
|
|
|
$(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
|
|
|
|
cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
|
|
|
|
chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(libdir)/$$fn.new \
|
|
|
|
$(DESTDIR)$(libdir)/$$fn; \
|
2016-07-19 11:24:57 +00:00
|
|
|
: {- output_on() if windowsdll(); "" -}; \
|
2016-01-30 04:45:29 +00:00
|
|
|
done
|
2018-10-25 07:09:20 +00:00
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_programs: install_runtime_libs build_programs
|
2018-10-25 07:09:20 +00:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
|
|
|
|
@$(ECHO) "*** Installing runtime programs"
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$x`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
|
|
|
chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
|
|
|
|
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2016-03-21 07:11:14 +00:00
|
|
|
@set -e; for x in dummy $(BIN_SCRIPTS); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$x`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
|
|
|
chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
|
|
|
|
mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
|
|
|
|
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
uninstall_runtime: uninstall_programs uninstall_runtime_libs
|
|
|
|
|
|
|
|
uninstall_programs:
|
|
|
|
@$(ECHO) "*** Uninstalling runtime programs"
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for x in dummy $(INSTALL_PROGRAMS); \
|
2016-01-30 02:25:40 +00:00
|
|
|
do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$x`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done;
|
2016-03-21 07:11:14 +00:00
|
|
|
@set -e; for x in dummy $(BIN_SCRIPTS); \
|
2016-01-30 02:25:40 +00:00
|
|
|
do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
fn=`basename $$x`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-01-30 02:25:40 +00:00
|
|
|
done
|
2018-10-25 07:09:20 +00:00
|
|
|
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
|
|
|
|
|
|
|
|
uninstall_runtime_libs:
|
|
|
|
@$(ECHO) "*** Uninstalling runtime libraries"
|
2016-07-14 19:13:24 +00:00
|
|
|
@ : {- output_off() unless windowsdll(); "" -}
|
2016-07-08 12:52:09 +00:00
|
|
|
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
|
2016-03-21 07:11:14 +00:00
|
|
|
if [ "$$s" = "dummy" ]; then continue; fi; \
|
2016-02-15 21:13:41 +00:00
|
|
|
fn=`basename $$s`; \
|
2017-06-29 15:40:19 +00:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
|
2016-02-12 20:14:03 +00:00
|
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
|
2016-01-30 04:45:29 +00:00
|
|
|
done
|
2016-07-14 19:13:24 +00:00
|
|
|
@ : {- output_on() unless windowsdll(); "" -}
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
install_man_docs:
|
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Installing manpages"
|
2017-03-06 20:17:32 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/process_docs.pl \
|
|
|
|
--destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX)
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
uninstall_man_docs:
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Uninstalling manpages"
|
2017-03-06 20:17:32 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/process_docs.pl \
|
|
|
|
--destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX) \
|
|
|
|
--remove
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
install_html_docs:
|
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Installing HTML manpages"
|
2017-03-06 20:17:32 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/process_docs.pl \
|
|
|
|
--destdir=$(DESTDIR)$(HTMLDIR) --type=html
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
uninstall_html_docs:
|
2017-06-29 15:40:19 +00:00
|
|
|
@$(ECHO) "*** Uninstalling manpages"
|
2017-03-06 20:17:32 +00:00
|
|
|
$(PERL) $(SRCDIR)/util/process_docs.pl \
|
|
|
|
--destdir=$(DESTDIR)$(HTMLDIR) --type=html --remove
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Developer targets (note: these are only available on Unix) #########
|
|
|
|
|
2016-02-11 19:00:57 +00:00
|
|
|
update: generate errors ordinals
|
|
|
|
|
2016-05-01 13:09:20 +00:00
|
|
|
generate: generate_apps generate_crypto_bn generate_crypto_objects \
|
2017-10-31 19:06:39 +00:00
|
|
|
generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2018-06-18 20:09:20 +00:00
|
|
|
.PHONY: doc-nits
|
2019-02-19 19:29:53 +00:00
|
|
|
doc-nits: build_generated
|
2019-06-06 11:12:49 +00:00
|
|
|
(cd $(SRCDIR); $(PERL) util/find-doc-nits -n -p -s ) >doc-nits
|
2018-06-18 20:09:20 +00:00
|
|
|
@if [ -s doc-nits ] ; then cat doc-nits ; exit 1; \
|
|
|
|
else echo 'doc-nits: no errors.'; rm doc-nits ; fi
|
2017-01-12 13:20:54 +00:00
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
# Test coverage is a good idea for the future
|
|
|
|
#coverage: $(PROGRAMS) $(TESTPROGRAMS)
|
|
|
|
# ...
|
|
|
|
|
|
|
|
lint:
|
|
|
|
lint -DLINT $(INCLUDES) $(SRCS)
|
|
|
|
|
Don't let 'generate' target depend on generated files, act directly instead
One of the 'generate' targets depended on $(SRCDIR)/apps/progs.h,
which depended on... nothing. This meant it never got regenerated
once it existed, regardless of need. Of course, we could have it
depend on all the files checked to generate it, but they also depend
on progs.h, so we'd end up getting cricular dependencies, which makes
make unhappy.
Furthermore, and this applies for the other generated files, having
them as targets means that they may be regenerated on the fly in some
cases, and since they get written to the source tree, this isn't such
a good idea if that tree is read-only (which is a possible situation
in an out-of-tree build).
So, we move all the actions to the 'generate' targets themselves, thus
making sure they get regenerated in a controlled manner and regardless
of dependencies.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-19 19:04:51 +00:00
|
|
|
generate_apps:
|
|
|
|
( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
|
|
|
|
< apps/openssl.cnf > apps/openssl-vms.cnf )
|
|
|
|
|
|
|
|
generate_crypto_bn:
|
|
|
|
( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
|
|
|
|
|
|
|
|
generate_crypto_objects:
|
2018-02-27 20:14:18 +00:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
|
|
|
|
crypto/objects/objects.txt \
|
|
|
|
crypto/objects/obj_mac.num \
|
|
|
|
> crypto/objects/obj_mac.new && \
|
|
|
|
mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
|
Don't let 'generate' target depend on generated files, act directly instead
One of the 'generate' targets depended on $(SRCDIR)/apps/progs.h,
which depended on... nothing. This meant it never got regenerated
once it existed, regardless of need. Of course, we could have it
depend on all the files checked to generate it, but they also depend
on progs.h, so we'd end up getting cricular dependencies, which makes
make unhappy.
Furthermore, and this applies for the other generated files, having
them as targets means that they may be regenerated on the fly in some
cases, and since they get written to the source tree, this isn't such
a good idea if that tree is read-only (which is a possible situation
in an out-of-tree build).
So, we move all the actions to the 'generate' targets themselves, thus
making sure they get regenerated in a controlled manner and regardless
of dependencies.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-19 19:04:51 +00:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
|
|
|
|
crypto/objects/objects.txt \
|
|
|
|
crypto/objects/obj_mac.num \
|
2018-02-27 20:14:18 +00:00
|
|
|
> include/openssl/obj_mac.h )
|
2016-04-24 00:01:25 +00:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
|
|
|
|
include/openssl/obj_mac.h \
|
2018-02-27 20:14:18 +00:00
|
|
|
> crypto/objects/obj_dat.h )
|
Don't let 'generate' target depend on generated files, act directly instead
One of the 'generate' targets depended on $(SRCDIR)/apps/progs.h,
which depended on... nothing. This meant it never got regenerated
once it existed, regardless of need. Of course, we could have it
depend on all the files checked to generate it, but they also depend
on progs.h, so we'd end up getting cricular dependencies, which makes
make unhappy.
Furthermore, and this applies for the other generated files, having
them as targets means that they may be regenerated on the fly in some
cases, and since they get written to the source tree, this isn't such
a good idea if that tree is read-only (which is a possible situation
in an out-of-tree build).
So, we move all the actions to the 'generate' targets themselves, thus
making sure they get regenerated in a controlled manner and regardless
of dependencies.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-19 19:04:51 +00:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
|
|
|
|
crypto/objects/obj_mac.num \
|
|
|
|
crypto/objects/obj_xref.txt \
|
|
|
|
> crypto/objects/obj_xref.h )
|
2016-02-11 19:00:57 +00:00
|
|
|
|
2016-05-01 13:09:20 +00:00
|
|
|
generate_crypto_conf:
|
|
|
|
( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
|
|
|
|
> crypto/conf/conf_def.h )
|
|
|
|
|
|
|
|
generate_crypto_asn1:
|
|
|
|
( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
|
|
|
|
> crypto/asn1/charmap.h )
|
|
|
|
|
2017-10-31 19:06:39 +00:00
|
|
|
generate_fuzz_oids:
|
|
|
|
( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
|
|
|
|
crypto/objects/obj_dat.h \
|
|
|
|
> fuzz/oids.txt )
|
|
|
|
|
2017-06-07 19:12:03 +00:00
|
|
|
# Set to -force to force a rebuild
|
|
|
|
ERROR_REBUILD=
|
2016-01-30 02:25:40 +00:00
|
|
|
errors:
|
2018-06-12 06:56:21 +00:00
|
|
|
( b=`pwd`; set -e; cd $(SRCDIR); \
|
|
|
|
$(PERL) util/ck_errf.pl -strict -internal; \
|
2018-02-07 18:23:39 +00:00
|
|
|
$(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
|
2018-06-12 06:56:21 +00:00
|
|
|
( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
|
2017-06-07 19:12:03 +00:00
|
|
|
for E in *.ec ; do \
|
2018-06-12 06:56:21 +00:00
|
|
|
$(PERL) ../util/ck_errf.pl -strict \
|
|
|
|
-conf $$E `basename $$E .ec`.c; \
|
2018-02-07 18:23:39 +00:00
|
|
|
$(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
|
2017-06-07 19:12:03 +00:00
|
|
|
-conf $$E `basename $$E .ec`.c ; \
|
|
|
|
done )
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2018-09-14 13:28:39 +00:00
|
|
|
{- use File::Basename;
|
|
|
|
|
|
|
|
our @sslheaders =
|
|
|
|
qw( include/openssl/ssl.h
|
|
|
|
include/openssl/ssl2.h
|
|
|
|
include/openssl/ssl3.h
|
|
|
|
include/openssl/sslerr.h
|
|
|
|
include/openssl/tls1.h
|
|
|
|
include/openssl/dtls1.h
|
|
|
|
include/openssl/srtp.h );
|
|
|
|
our @cryptoheaders =
|
|
|
|
qw( include/internal/dso.h
|
|
|
|
include/internal/o_dir.h
|
|
|
|
include/internal/o_str.h
|
|
|
|
include/internal/err.h
|
|
|
|
include/internal/sslconf.h );
|
2019-01-31 17:55:30 +00:00
|
|
|
our @cryptoskipheaders = ( @sslheaders,
|
2018-09-14 13:28:39 +00:00
|
|
|
qw( include/openssl/conf_api.h
|
|
|
|
include/openssl/ebcdic.h
|
|
|
|
include/openssl/opensslconf.h
|
|
|
|
include/openssl/symhacks.h ) );
|
|
|
|
foreach my $f ( glob(catfile($config{sourcedir},
|
|
|
|
'include','openssl','*.h')) ) {
|
|
|
|
my $fn = "include/openssl/" . basename($f);
|
|
|
|
push @cryptoheaders, $fn unless grep { $_ eq $fn } @cryptoskipheaders;
|
|
|
|
}
|
|
|
|
"";
|
|
|
|
-}
|
|
|
|
CRYPTOHEADERS={- join(" \\\n\t", sort @cryptoheaders) -}
|
|
|
|
SSLHEADERS={- join(" \\\n\t", sort @sslheaders) -}
|
2016-01-30 02:25:40 +00:00
|
|
|
ordinals:
|
2018-09-14 13:28:39 +00:00
|
|
|
( cd $(SRCDIR); \
|
|
|
|
$(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
|
|
|
|
--ordinals util/libcrypto.num \
|
|
|
|
--symhacks include/openssl/symhacks.h \
|
|
|
|
$(CRYPTOHEADERS) )
|
|
|
|
( cd $(SRCDIR); \
|
|
|
|
$(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
|
|
|
|
--ordinals util/libssl.num \
|
|
|
|
--symhacks include/openssl/symhacks.h \
|
|
|
|
$(SSLHEADERS))
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
test_ordinals:
|
|
|
|
( cd test; \
|
|
|
|
SRCTOP=../$(SRCDIR) \
|
|
|
|
BLDTOP=../$(BLDDIR) \
|
|
|
|
$(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
|
|
|
|
|
|
|
|
tags TAGS: FORCE
|
|
|
|
rm -f TAGS tags
|
|
|
|
-ctags -R .
|
|
|
|
-etags `find . -name '*.[ch]' -o -name '*.pm'`
|
|
|
|
|
|
|
|
# Release targets (note: only available on Unix) #####################
|
|
|
|
|
|
|
|
tar:
|
2018-11-24 10:27:50 +00:00
|
|
|
(cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)')
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
# Helper targets #####################################################
|
|
|
|
|
2016-09-07 18:56:20 +00:00
|
|
|
link-utils: $(BLDDIR)/util/opensslwrap.sh
|
2016-01-30 02:25:40 +00:00
|
|
|
|
2016-02-19 01:30:51 +00:00
|
|
|
$(BLDDIR)/util/opensslwrap.sh: configdata.pm
|
2016-01-30 02:25:40 +00:00
|
|
|
@if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
|
|
|
|
mkdir -p "$(BLDDIR)/util"; \
|
|
|
|
ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
|
|
|
|
fi
|
2016-09-07 18:56:20 +00:00
|
|
|
|
2016-02-18 18:41:57 +00:00
|
|
|
FORCE:
|
2016-01-30 02:25:40 +00:00
|
|
|
|
|
|
|
# Building targets ###################################################
|
|
|
|
|
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 13:09:57 +00:00
|
|
|
libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // () } @{$unified_info{libraries}}) -}
|
2016-01-30 02:25:40 +00:00
|
|
|
libcrypto.pc:
|
|
|
|
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
|
|
|
echo 'exec_prefix=$${prefix}'; \
|
2018-02-23 11:10:42 +00:00
|
|
|
if [ -n "$(LIBDIR)" ]; then \
|
|
|
|
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
|
|
|
else \
|
|
|
|
echo 'libdir=$(libdir)'; \
|
|
|
|
fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
echo 'includedir=$${prefix}/include'; \
|
2017-07-19 08:13:41 +00:00
|
|
|
echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
|
2016-01-30 02:25:40 +00:00
|
|
|
echo ''; \
|
|
|
|
echo 'Name: OpenSSL-libcrypto'; \
|
|
|
|
echo 'Description: OpenSSL cryptography library'; \
|
|
|
|
echo 'Version: '$(VERSION); \
|
|
|
|
echo 'Libs: -L$${libdir} -lcrypto'; \
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-06 19:35:30 +00:00
|
|
|
echo 'Libs.private: $(LIB_EX_LIBS)'; \
|
2016-01-30 02:25:40 +00:00
|
|
|
echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
|
|
|
|
|
|
|
|
libssl.pc:
|
|
|
|
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
|
|
|
echo 'exec_prefix=$${prefix}'; \
|
2018-02-23 11:10:42 +00:00
|
|
|
if [ -n "$(LIBDIR)" ]; then \
|
|
|
|
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
|
|
|
else \
|
|
|
|
echo 'libdir=$(libdir)'; \
|
|
|
|
fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
echo 'includedir=$${prefix}/include'; \
|
|
|
|
echo ''; \
|
|
|
|
echo 'Name: OpenSSL-libssl'; \
|
|
|
|
echo 'Description: Secure Sockets Layer and cryptography libraries'; \
|
|
|
|
echo 'Version: '$(VERSION); \
|
|
|
|
echo 'Requires.private: libcrypto'; \
|
|
|
|
echo 'Libs: -L$${libdir} -lssl'; \
|
|
|
|
echo 'Cflags: -I$${includedir}' ) > libssl.pc
|
|
|
|
|
|
|
|
openssl.pc:
|
|
|
|
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
|
|
|
echo 'exec_prefix=$${prefix}'; \
|
2018-02-23 11:10:42 +00:00
|
|
|
if [ -n "$(LIBDIR)" ]; then \
|
|
|
|
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
|
|
|
else \
|
|
|
|
echo 'libdir=$(libdir)'; \
|
|
|
|
fi; \
|
2016-01-30 02:25:40 +00:00
|
|
|
echo 'includedir=$${prefix}/include'; \
|
|
|
|
echo ''; \
|
|
|
|
echo 'Name: OpenSSL'; \
|
|
|
|
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
|
|
|
|
echo 'Version: '$(VERSION); \
|
|
|
|
echo 'Requires: libssl libcrypto' ) > openssl.pc
|
|
|
|
|
2016-09-17 18:50:56 +00:00
|
|
|
configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
|
2016-02-19 01:30:51 +00:00
|
|
|
@echo "Detected changed: $?"
|
2018-02-02 19:33:13 +00:00
|
|
|
$(PERL) configdata.pm -r
|
2016-01-30 02:25:40 +00:00
|
|
|
@echo "**************************************************"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "*** Please run the same make command again ***"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "**************************************************"
|
|
|
|
@false
|
|
|
|
|
2018-01-29 22:17:43 +00:00
|
|
|
reconfigure reconf:
|
2018-02-02 19:33:13 +00:00
|
|
|
$(PERL) configdata.pm -r
|
2018-01-29 22:17:43 +00:00
|
|
|
|
2016-01-30 02:25:40 +00:00
|
|
|
{-
|
|
|
|
use File::Basename;
|
|
|
|
use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
|
2016-02-11 12:10:11 +00:00
|
|
|
|
|
|
|
# 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 {
|
|
|
|
# Depending on shared libraries:
|
|
|
|
# On Windows POSIX layers, we depend on {libname}.dll.a
|
|
|
|
# On Unix platforms, we depend on {shlibname}.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 13:09:57 +00:00
|
|
|
return map { platform->sharedlib_simple($_) // platform->staticlib($_) } @_;
|
2016-02-11 12:10:11 +00:00
|
|
|
}
|
|
|
|
|
2016-03-07 13:38:54 +00:00
|
|
|
sub generatesrc {
|
|
|
|
my %args = @_;
|
|
|
|
my $generator = join(" ", @{$args{generator}});
|
2016-04-21 12:30:08 +00:00
|
|
|
my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
|
2016-03-10 08:04:09 +00:00
|
|
|
my $incs = join("", map { " -I".$_ } @{$args{incs}});
|
2016-10-14 15:09:52 +00:00
|
|
|
my $defs = join("", map { " -D".$_ } @{$args{defs}});
|
2016-04-21 12:30:08 +00:00
|
|
|
my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
|
2016-03-07 13:38:54 +00:00
|
|
|
|
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 13:09:57 +00:00
|
|
|
if (platform->isdef($args{src})) {
|
|
|
|
my $target = platform->def($args{src});
|
2018-09-30 12:44:59 +00:00
|
|
|
(my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
|
2018-10-04 15:41:12 +00:00
|
|
|
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
|
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 13:09:57 +00:00
|
|
|
my $ord_name = $args{generator}->[1] || $args{product};
|
2018-09-30 12:44:59 +00:00
|
|
|
return <<"EOF";
|
2018-10-04 15:41:12 +00:00
|
|
|
$target: $args{generator}->[0] $deps \$(SRCDIR)/util/mkdef.pl
|
|
|
|
\$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS $mkdef_os > $target
|
2018-09-30 12:44:59 +00:00
|
|
|
EOF
|
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 13:09:57 +00:00
|
|
|
} elsif (!platform->isasm($args{src})) {
|
2016-06-13 20:02:11 +00:00
|
|
|
if ($args{generator}->[0] =~ m|^.*\.in$|) {
|
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
return <<"EOF";
|
|
|
|
$args{src}: $args{generator}->[0] $deps
|
|
|
|
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
|
|
|
"-o$target{build_file}" $generator > \$@
|
|
|
|
EOF
|
|
|
|
} else {
|
|
|
|
return <<"EOF";
|
2016-03-18 23:57:35 +00:00
|
|
|
$args{src}: $args{generator}->[0] $deps
|
2016-04-21 12:30:08 +00:00
|
|
|
\$(PERL)$generator_incs $generator > \$@
|
2016-03-07 13:38:54 +00:00
|
|
|
EOF
|
2016-06-13 20:02:11 +00:00
|
|
|
}
|
2016-03-07 13:38:54 +00:00
|
|
|
} else {
|
2016-03-08 18:19:53 +00:00
|
|
|
if ($args{generator}->[0] =~ /\.pl$/) {
|
2016-04-21 12:30:08 +00:00
|
|
|
$generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
|
2016-03-08 18:19:53 +00:00
|
|
|
} elsif ($args{generator}->[0] =~ /\.m4$/) {
|
2016-04-21 12:30:08 +00:00
|
|
|
$generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
|
2016-03-08 18:19:53 +00:00
|
|
|
} elsif ($args{generator}->[0] =~ /\.S$/) {
|
|
|
|
$generator = undef;
|
|
|
|
} else {
|
|
|
|
die "Generator type for $args{src} unknown: $generator\n";
|
|
|
|
}
|
|
|
|
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
my $cppflags = {
|
2018-09-10 00:28:39 +00:00
|
|
|
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
2018-02-22 15:33:58 +00:00
|
|
|
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
} -> {$args{intent}};
|
2016-03-08 18:19:53 +00:00
|
|
|
if (defined($generator)) {
|
2016-03-07 13:38:54 +00:00
|
|
|
return <<"EOF";
|
2016-03-18 23:57:35 +00:00
|
|
|
$args{src}: $args{generator}->[0] $deps
|
2016-03-08 18:19:53 +00:00
|
|
|
$generator \$@
|
2016-03-07 13:38:54 +00:00
|
|
|
EOF
|
|
|
|
}
|
2016-03-08 18:19:53 +00:00
|
|
|
return <<"EOF";
|
2016-03-18 23:57:35 +00:00
|
|
|
$args{src}: $args{generator}->[0] $deps
|
2016-10-14 15:09:52 +00:00
|
|
|
\$(CC) $incs $cppflags $defs -E $args{generator}->[0] | \\
|
2016-05-02 21:38:11 +00:00
|
|
|
\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
|
2016-03-08 18:19:53 +00:00
|
|
|
EOF
|
2016-03-07 13:38:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-11 12:25:48 +00:00
|
|
|
# Should one wonder about the end of the Perl snippet, it's because this
|
|
|
|
# second regexp eats up line endings as well, if the removed path is the
|
|
|
|
# last in the line. We may therefore need to put back a line ending.
|
2016-02-18 12:04:05 +00:00
|
|
|
sub src2obj {
|
2016-01-30 02:25:40 +00:00
|
|
|
my %args = @_;
|
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 13:09:57 +00:00
|
|
|
my $obj = platform->obj($args{obj});
|
|
|
|
my $dep = platform->dep($args{obj});
|
2018-03-09 12:57:38 +00:00
|
|
|
my @srcs = @{$args{srcs}};
|
2016-03-08 18:19:53 +00:00
|
|
|
my $srcs = join(" ", @srcs);
|
|
|
|
my $deps = join(" ", @srcs, @{$args{deps}});
|
2016-02-19 21:02:41 +00:00
|
|
|
my $incs = join("", map { " -I".$_ } @{$args{incs}});
|
2016-10-14 15:09:52 +00:00
|
|
|
my $defs = join("", map { " -D".$_ } @{$args{defs}});
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
my $cmd;
|
|
|
|
my $cmdflags;
|
|
|
|
my $cmdcompile;
|
2017-12-04 13:27:58 +00:00
|
|
|
if (grep /\.rc$/, @srcs) {
|
|
|
|
$cmd = '$(RC)';
|
|
|
|
$cmdflags = '$(RCFLAGS)';
|
2018-01-23 12:54:55 +00:00
|
|
|
$cmdcompile = '';
|
2017-12-04 13:27:58 +00:00
|
|
|
} elsif (grep /\.(cc|cpp)$/, @srcs) {
|
|
|
|
$cmd = '$(CXX)';
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
$cmdcompile = ' -c';
|
|
|
|
$cmdflags = {
|
2018-09-10 00:28:39 +00:00
|
|
|
shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-10-12 13:30:43 +00:00
|
|
|
} else {
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
$cmd = '$(CC)';
|
|
|
|
$cmdcompile = ' -c';
|
|
|
|
$cmdflags = {
|
2018-09-10 00:28:39 +00:00
|
|
|
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-10-12 13:30:43 +00:00
|
|
|
}
|
2018-03-09 12:57:38 +00:00
|
|
|
my $recipe;
|
|
|
|
# extension-specific rules
|
|
|
|
if (grep /\.s$/, @srcs) {
|
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$obj: $deps
|
2018-03-09 12:57:38 +00:00
|
|
|
$cmd $cmdflags -c -o \$\@ $srcs
|
2016-09-04 06:10:22 +00:00
|
|
|
EOF
|
2018-03-09 12:57:38 +00:00
|
|
|
} elsif (grep /\.S$/, @srcs) {
|
2018-04-11 08:11:07 +00:00
|
|
|
# Originally there was mutli-step rule with $(CC) -E file.S
|
|
|
|
# followed by $(CC) -c file.s. It compensated for one of
|
|
|
|
# legacy platform compiler's inability to handle .S files.
|
|
|
|
# The platform is long discontinued by vendor so there is
|
|
|
|
# hardly a point to drag it along...
|
2016-03-09 00:17:27 +00:00
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$obj: $deps
|
2016-10-14 15:09:52 +00:00
|
|
|
$cmd $incs $defs $cmdflags -c -o \$\@ $srcs
|
2018-03-09 12:57:38 +00:00
|
|
|
EOF
|
2018-04-13 19:41:14 +00:00
|
|
|
} elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
|
|
|
|
&& !grep /\.rc$/, @srcs) {
|
2018-03-09 12:57:38 +00:00
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$obj: $deps
|
|
|
|
$cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
|
|
|
|
\@touch $dep.tmp
|
|
|
|
\@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\
|
|
|
|
rm -f $dep.tmp; \\
|
2016-03-15 08:05:20 +00:00
|
|
|
else \\
|
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 13:09:57 +00:00
|
|
|
mv $dep.tmp $dep; \\
|
2016-03-11 08:26:49 +00:00
|
|
|
fi
|
2016-03-09 00:17:27 +00:00
|
|
|
EOF
|
2016-09-04 06:10:22 +00:00
|
|
|
} else {
|
2016-03-09 00:17:27 +00:00
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$obj: $deps
|
2016-10-14 15:09:52 +00:00
|
|
|
$cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
2017-12-04 13:27:58 +00:00
|
|
|
if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
|
2016-09-04 06:10:22 +00:00
|
|
|
$recipe .= <<"EOF";
|
2018-03-15 17:06:18 +00:00
|
|
|
\$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
|
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 13:09:57 +00:00
|
|
|
> $dep
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
2016-09-04 06:10:22 +00:00
|
|
|
}
|
2016-03-09 00:17:27 +00:00
|
|
|
}
|
|
|
|
return $recipe;
|
2016-01-30 02:25:40 +00:00
|
|
|
}
|
2018-10-21 09:03:02 +00:00
|
|
|
# We *know* this routine is only called when we've configure 'shared'.
|
2018-09-12 08:59:06 +00:00
|
|
|
sub obj2shlib {
|
2016-01-30 02:25:40 +00:00
|
|
|
my %args = @_;
|
2018-01-08 11:28:08 +00:00
|
|
|
my @linkdirs = ();
|
|
|
|
foreach (@{args{deps}}) {
|
|
|
|
my $d = dirname($_);
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
|
|
|
my $linkflags = join("", map { "-L$_ " } @linkdirs);
|
|
|
|
my $linklibs = join("", map { my $f = basename($_);
|
2016-02-11 12:10:11 +00:00
|
|
|
(my $l = $f) =~ s/^lib//;
|
2018-01-08 11:28:08 +00:00
|
|
|
" -l$l" } @{$args{deps}});
|
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 13:09:57 +00:00
|
|
|
my @objs = map { platform->obj($_) }
|
|
|
|
grep { !platform->isdef($_) }
|
2018-09-30 12:44:59 +00:00
|
|
|
@{$args{objs}};
|
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 13:09:57 +00:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2017-12-04 13:27:58 +00:00
|
|
|
@{$args{objs}};
|
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
die "More than one exported symbol map" if scalar @defs > 1;
|
|
|
|
my $objs = join(" ", @objs);
|
|
|
|
my $deps = join(" ", @objs, @defs, @deps);
|
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 13:09:57 +00:00
|
|
|
my $simple = platform->sharedlib_simple($args{lib});
|
|
|
|
my $full = platform->sharedlib($args{lib});
|
2017-12-04 13:27:58 +00:00
|
|
|
my $shared_soname = "";
|
2018-10-21 09:03:02 +00:00
|
|
|
$shared_soname .= ' '.$target{shared_sonameflag}.basename($full)
|
2017-12-04 13:27:58 +00:00
|
|
|
if defined $target{shared_sonameflag};
|
|
|
|
my $shared_imp = "";
|
2018-10-21 09:03:02 +00:00
|
|
|
$shared_imp .= ' '.$target{shared_impflag}.basename($simple)
|
2017-12-04 13:27:58 +00:00
|
|
|
if defined $target{shared_impflag};
|
|
|
|
my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
|
|
|
|
my $recipe = <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$simple: $full
|
2016-01-30 04:45:29 +00:00
|
|
|
EOF
|
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 13:09:57 +00:00
|
|
|
if (sharedaix()) {
|
2017-12-04 13:27:58 +00:00
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
rm -f $simple && \\
|
|
|
|
\$(AR) r $simple $full
|
2018-06-14 09:45:15 +00:00
|
|
|
EOF
|
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 13:09:57 +00:00
|
|
|
} elsif ($simple ne $full) {
|
2018-06-14 09:45:15 +00:00
|
|
|
$recipe .= <<"EOF";
|
2018-10-21 09:03:02 +00:00
|
|
|
rm -f $simple && \\
|
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 13:09:57 +00:00
|
|
|
ln -s $full $simple
|
2017-12-04 13:27:58 +00:00
|
|
|
EOF
|
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 13:09:57 +00:00
|
|
|
}
|
|
|
|
$recipe .= <<"EOF";
|
|
|
|
$full: $deps
|
|
|
|
\$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
|
|
|
|
-o $full$shared_def $objs \\
|
|
|
|
$linklibs \$(LIB_EX_LIBS)
|
|
|
|
EOF
|
|
|
|
if (windowsdll()) {
|
2017-12-04 13:27:58 +00:00
|
|
|
$recipe .= <<"EOF";
|
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 13:09:57 +00:00
|
|
|
rm -f apps/$full
|
|
|
|
rm -f test/$full
|
|
|
|
rm -f fuzz/$full
|
|
|
|
cp -p $full apps/
|
|
|
|
cp -p $full test/
|
|
|
|
cp -p $full fuzz/
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
2017-12-04 13:27:58 +00:00
|
|
|
}
|
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 13:09:57 +00:00
|
|
|
return $recipe;
|
2016-01-30 02:25:40 +00:00
|
|
|
}
|
2016-02-15 17:45:54 +00:00
|
|
|
sub obj2dso {
|
2016-01-30 02:25:40 +00:00
|
|
|
my %args = @_;
|
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 13:09:57 +00:00
|
|
|
my $dso = platform->dso($args{lib});
|
2018-01-08 11:28:08 +00:00
|
|
|
my @linkdirs = ();
|
|
|
|
foreach (@{args{deps}}) {
|
|
|
|
my $d = dirname($_);
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
|
|
|
my $linkflags = join("", map { "-L$_ " } @linkdirs);
|
|
|
|
my $linklibs = join("", map { my $f = basename($_);
|
2017-12-04 13:27:58 +00:00
|
|
|
(my $l = $f) =~ s/^lib//;
|
2018-01-08 11:28:08 +00:00
|
|
|
" -l$l" } @{$args{deps}});
|
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 13:09:57 +00:00
|
|
|
my @objs = map { platform->obj($_) }
|
|
|
|
grep { !platform->isdef($_) }
|
2018-03-22 21:15:04 +00:00
|
|
|
@{$args{objs}};
|
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 13:09:57 +00:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-10-04 15:41:12 +00:00
|
|
|
@{$args{objs}};
|
2017-12-04 13:27:58 +00:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
my $objs = join(" ", @objs);
|
2018-10-04 15:41:12 +00:00
|
|
|
my $deps = join(" ", @objs, @defs, @deps);
|
|
|
|
my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
|
2016-01-30 02:25:40 +00:00
|
|
|
return <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$dso: $deps
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
\$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
|
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 13:09:57 +00:00
|
|
|
-o $dso$shared_def $objs \\
|
2018-03-07 23:16:47 +00:00
|
|
|
$linklibs \$(DSO_EX_LIBS)
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2lib {
|
|
|
|
my %args = @_;
|
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 13:09:57 +00:00
|
|
|
my $lib = platform->staticlib($args{lib});
|
|
|
|
my @objs = map { platform->obj($_) } @{$args{objs}};
|
2017-12-04 13:27:58 +00:00
|
|
|
my $objs = join(" ", @objs);
|
2016-01-30 02:25:40 +00:00
|
|
|
return <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$lib: $objs
|
2018-01-26 18:56:44 +00:00
|
|
|
\$(AR) \$(ARFLAGS) \$\@ \$\?
|
2016-01-30 02:25:40 +00:00
|
|
|
\$(RANLIB) \$\@ || echo Never mind.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2bin {
|
|
|
|
my %args = @_;
|
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 13:09:57 +00:00
|
|
|
my $bin = platform->bin($args{bin});
|
|
|
|
my $objs = join(" ", map { platform->obj($_) } @{$args{objs}});
|
|
|
|
my $deps = join(" ", compute_lib_depends(@{$args{deps}}));
|
2018-01-08 11:28:08 +00:00
|
|
|
my @linkdirs = ();
|
|
|
|
foreach (@{args{deps}}) {
|
|
|
|
next if $_ =~ /\.a$/;
|
|
|
|
my $d = dirname($_);
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
|
|
|
my $linkflags = join("", map { "-L$_ " } @linkdirs);
|
2019-02-05 15:21:59 +00:00
|
|
|
my $linklibs = join("", map { if ($_ =~ m/\.a$/) {
|
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 13:09:57 +00:00
|
|
|
" ".platform->staticlib($_);
|
2016-11-09 19:01:51 +00:00
|
|
|
} else {
|
|
|
|
my $f = basename($_);
|
|
|
|
(my $l = $f) =~ s/^lib//;
|
2018-01-08 11:28:08 +00:00
|
|
|
" -l$l"
|
2016-11-09 19:01:51 +00:00
|
|
|
}
|
|
|
|
} @{$args{deps}});
|
2017-12-04 13:27:58 +00:00
|
|
|
my $cmd = '$(CC)';
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
my $cmdflags = '$(BIN_CFLAGS)';
|
2017-12-04 13:27:58 +00:00
|
|
|
if (grep /_cc\.o$/, @{$args{objs}}) {
|
|
|
|
$cmd = '$(CXX)';
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
$cmdflags = '$(BIN_CXXFLAGS)';
|
2016-10-12 13:30:43 +00:00
|
|
|
}
|
2016-01-30 02:25:40 +00:00
|
|
|
return <<"EOF";
|
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 13:09:57 +00:00
|
|
|
$bin: $objs $deps
|
|
|
|
rm -f $bin
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-13 19:32:42 +00:00
|
|
|
\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
|
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 13:09:57 +00:00
|
|
|
-o $bin $objs \\
|
2018-03-07 23:16:47 +00:00
|
|
|
$linklibs \$(BIN_EX_LIBS)
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub in2script {
|
|
|
|
my %args = @_;
|
|
|
|
my $script = $args{script};
|
|
|
|
my $sources = join(" ", @{$args{sources}});
|
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
return <<"EOF";
|
2016-02-18 12:04:05 +00:00
|
|
|
$script: $sources
|
2016-02-14 05:55:45 +00:00
|
|
|
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
2016-02-14 07:47:47 +00:00
|
|
|
"-o$target{build_file}" $sources > "$script"
|
2016-01-30 02:25:40 +00:00
|
|
|
chmod a+x $script
|
2016-04-02 20:26:38 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub generatedir {
|
|
|
|
my %args = @_;
|
|
|
|
my $dir = $args{dir};
|
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 13:09:57 +00:00
|
|
|
my @deps = map { platform->convertext($_) } @{$args{deps}};
|
2016-04-02 20:26:38 +00:00
|
|
|
my @actions = ();
|
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 13:09:57 +00:00
|
|
|
my %extinfo = ( dso => platform->dsoext(),
|
|
|
|
lib => platform->libext(),
|
|
|
|
bin => platform->binext() );
|
2016-04-02 20:26:38 +00:00
|
|
|
|
2018-10-21 09:11:04 +00:00
|
|
|
# We already have a 'test' target, and the top directory is just plain
|
|
|
|
# silly
|
|
|
|
return if $dir eq "test" || $dir eq ".";
|
|
|
|
|
2016-04-02 20:26:38 +00:00
|
|
|
foreach my $type (("dso", "lib", "bin", "script")) {
|
|
|
|
next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
|
2016-06-28 12:02:44 +00:00
|
|
|
# For lib object files, we could update the library. However, it
|
|
|
|
# was decided that it's enough to build the directory local object
|
|
|
|
# files, so we don't need to add any actions, and the dependencies
|
|
|
|
# are already taken care of.
|
|
|
|
if ($type ne "lib") {
|
2016-04-02 20:26:38 +00:00
|
|
|
foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
|
|
|
|
if (dirname($prod) eq $dir) {
|
|
|
|
push @deps, $prod.$extinfo{$type};
|
|
|
|
} else {
|
|
|
|
push @actions, "\t@ : No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
my $deps = join(" ", @deps);
|
|
|
|
my $actions = join("\n", "", @actions);
|
|
|
|
return <<"EOF";
|
2018-10-21 09:11:04 +00:00
|
|
|
$dir $dir/: $deps$actions
|
2016-01-30 02:25:40 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|