2016-01-30 09:17:05 +08:00
|
|
|
# -*- Mode: perl -*-
|
2017-12-01 22:29:05 +08:00
|
|
|
my %targets=(
|
2016-02-27 18:25:33 +08:00
|
|
|
DEFAULTS => {
|
2015-05-18 08:54:28 +08:00
|
|
|
template => 1,
|
2016-01-30 09:17:05 +08:00
|
|
|
|
|
|
|
cflags => "",
|
2018-01-23 20:54:55 +08:00
|
|
|
cppflags => "",
|
|
|
|
lflags => "",
|
2016-01-30 09:17:05 +08:00
|
|
|
defines => [],
|
2018-02-09 06:26:22 +08:00
|
|
|
includes => [],
|
2018-03-07 04:09:05 +08:00
|
|
|
lib_cflags => "",
|
|
|
|
lib_cppflags => "",
|
2019-12-20 06:30:24 +08:00
|
|
|
lib_defines => [],
|
Configure - Get rid of the special thread_cflag, replace with thread_scheme
The thread_cflag setting filled a double role, as kinda sorta an
indicator of thread scheme, and as cflags. Some configs also added
lflags and ex_libs for multithreading regardless of if threading would
be enabled or not.
Instead of this, add threading cflags among in the cflag setting,
threading lflags in the lflag setting and so on if and only if threads
are enabled (which they are by default).
Also, for configs where there are no special cflags for threading (the
VMS configs are of that kind), this makes it possible to still clearly
mention what thread scheme is used.
The exact value of thread scheme is currently ignored except when it's
"(unknown)", and thereby only serves as a flag to tell if we know how
to build for multi-threading in a particular config. Yet, the
currently used values are "(unknown)", "pthreads", "uithreads" (a.k.a
solaris threads) and "winthreads".
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-27 23:51:34 +08:00
|
|
|
thread_scheme => "(unknown)", # Assume we don't know
|
2016-01-30 09:17:05 +08:00
|
|
|
thread_defines => [],
|
|
|
|
|
2015-05-18 08:54:28 +08:00
|
|
|
unistd => "<unistd.h>",
|
2015-05-21 02:03:20 +08:00
|
|
|
shared_target => "",
|
|
|
|
shared_cflag => "",
|
2016-02-19 01:43:56 +08:00
|
|
|
shared_defines => [],
|
2015-05-21 02:03:20 +08:00
|
|
|
shared_ldflag => "",
|
2016-02-05 22:17:33 +08:00
|
|
|
shared_rcflag => "",
|
2016-03-08 18:49:26 +08:00
|
|
|
|
2018-01-27 20:01:44 +08:00
|
|
|
#### Defaults for the benefit of the config targets who don't inherit
|
2018-09-20 18:23:27 +08:00
|
|
|
#### a BASE and assume Unix defaults
|
2018-01-27 20:01:44 +08:00
|
|
|
#### THESE WILL DISAPPEAR IN OpenSSL 1.2
|
|
|
|
build_scheme => [ "unified", "unix" ],
|
|
|
|
build_file => "Makefile",
|
2018-01-27 19:13:35 +08:00
|
|
|
|
2020-09-09 05:05:13 +08:00
|
|
|
AR => "(unused)",
|
|
|
|
ARFLAGS => "(unused)",
|
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-07 03:35:30 +08:00
|
|
|
CC => "cc",
|
|
|
|
HASHBANGPERL => "/usr/bin/env perl",
|
|
|
|
RANLIB => sub { which("$config{cross_compile_prefix}ranlib")
|
2018-02-02 19:23:09 +08:00
|
|
|
? "ranlib" : "" },
|
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-07 03:35:30 +08:00
|
|
|
RC => "windres",
|
2018-01-27 20:01:44 +08:00
|
|
|
|
|
|
|
#### THESE WILL BE ENABLED IN OpenSSL 1.2
|
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-07 03:35:30 +08:00
|
|
|
#HASHBANGPERL => "PERL", # Only Unix actually cares
|
2016-02-27 18:25:33 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
BASE_common => {
|
2016-02-27 18:37:33 +08:00
|
|
|
template => 1,
|
2017-06-22 06:47:49 +08:00
|
|
|
|
|
|
|
enable => [],
|
|
|
|
disable => [],
|
|
|
|
|
2016-02-27 18:37:33 +08:00
|
|
|
defines =>
|
2016-04-12 21:28:06 +08:00
|
|
|
sub {
|
2019-12-20 06:30:24 +08:00
|
|
|
my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
|
2021-08-10 04:56:29 +08:00
|
|
|
push @defs, "BROTLI" unless $disabled{brotli};
|
|
|
|
push @defs, "BROTLI_SHARED" unless $disabled{"brotli-dynamic"};
|
2016-04-12 21:28:06 +08:00
|
|
|
push @defs, "ZLIB" unless $disabled{zlib};
|
|
|
|
push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
|
2021-08-10 04:56:37 +08:00
|
|
|
push @defs, "ZSTD" unless $disabled{zstd};
|
|
|
|
push @defs, "ZSTD_SHARED" unless $disabled{"zstd-dynamic"};
|
2016-04-12 21:28:06 +08:00
|
|
|
return [ @defs ];
|
|
|
|
},
|
2018-02-09 06:26:22 +08:00
|
|
|
includes =>
|
|
|
|
sub {
|
|
|
|
my @incs = ();
|
2021-08-10 04:56:29 +08:00
|
|
|
push @incs, $withargs{brotli_include}
|
|
|
|
if !$disabled{brotli} && $withargs{brotli_include};
|
2018-02-09 06:26:22 +08:00
|
|
|
push @incs, $withargs{zlib_include}
|
|
|
|
if !$disabled{zlib} && $withargs{zlib_include};
|
2021-08-10 04:56:37 +08:00
|
|
|
push @incs, $withargs{zstd_include}
|
|
|
|
if !$disabled{zstd} && $withargs{zstd_include};
|
2018-02-09 06:26:22 +08:00
|
|
|
return [ @incs ];
|
|
|
|
},
|
2016-02-27 18:25:33 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
BASE_unix => {
|
|
|
|
inherit_from => [ "BASE_common" ],
|
|
|
|
template => 1,
|
|
|
|
|
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-07 03:35:30 +08:00
|
|
|
AR => "ar",
|
2020-08-24 00:33:57 +08:00
|
|
|
ARFLAGS => "qc",
|
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-07 03:35:30 +08:00
|
|
|
CC => "cc",
|
2018-01-08 19:28:08 +08:00
|
|
|
lflags =>
|
2021-08-10 04:56:29 +08:00
|
|
|
sub {
|
|
|
|
my @libs = ();
|
|
|
|
push(@libs, "-L".$withargs{zlib_lib}) if $withargs{zlib_lib};
|
|
|
|
push(@libs, "-L".$withargs{brotli_lib}) if $withargs{brotli_lib};
|
2021-08-10 04:56:37 +08:00
|
|
|
push(@libs, "-L".$withargs{zstd_lib}) if $withargs{zstd_lib};
|
2021-08-10 04:56:29 +08:00
|
|
|
return join(" ", @libs);
|
|
|
|
},
|
2016-02-27 18:37:33 +08:00
|
|
|
ex_libs =>
|
2021-08-10 04:56:29 +08:00
|
|
|
sub {
|
|
|
|
my @libs = ();
|
|
|
|
push(@libs, "-lz") if !defined($disabled{zlib}) && defined($disabled{"zlib-dynamic"});
|
|
|
|
if (!defined($disabled{brotli}) && defined($disabled{"brotli-dynamic"})) {
|
|
|
|
push(@libs, "-lbrotlienc");
|
|
|
|
push(@libs, "-lbrotlidec");
|
|
|
|
push(@libs, "-lbrotlicommon");
|
|
|
|
push(@libs, "-lm");
|
|
|
|
}
|
2021-08-10 04:56:37 +08:00
|
|
|
push(@libs, "-lzstd") if !defined($disabled{zstd}) && defined($disabled{"zstd-dynamic"});
|
2021-08-10 04:56:29 +08:00
|
|
|
return join(" ", @libs);
|
|
|
|
},
|
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-07 03:35:30 +08:00
|
|
|
HASHBANGPERL => "/usr/bin/env perl", # Only Unix actually cares
|
|
|
|
RANLIB => sub { which("$config{cross_compile_prefix}ranlib")
|
2018-02-02 19:23:09 +08:00
|
|
|
? "ranlib" : "" },
|
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-07 03:35:30 +08:00
|
|
|
RC => "windres",
|
2016-02-27 18:37:33 +08:00
|
|
|
|
2016-03-08 03:43:07 +08:00
|
|
|
build_scheme => [ "unified", "unix" ],
|
2016-02-27 18:25:33 +08:00
|
|
|
build_file => "Makefile",
|
Rework building: Unix changes to handle extensions and product names
Add platform::Unix, which is a generic Unix module to support product
name and extensions functionlity. However, this isn't quite enough,
as mingw and Cygwin builds are done using the same templates, but
since shared libraries work as on Windows and are named accordingly,
platform::mingw and platform::Cygwin were also added to provide the
necessary tweaks.
This reworks Configurations/unix-Makefile.tmpl to work out product
names in platform::Unix et al terms. In this one, we currently do
care about the *_extension config attributes, and the modules adapt
accordingly where it matters.
This change also affected crypto/include/internal/dso_conf.h.in, since
the DSO extension is meant to be the same as the short shared library
extension, which isn't '.so' everywhere.
'shared_extension' attributes that had the value
'.so.\$(SHLIB_VERSION_NUMBER)' are removed, platform::Unix provides
an extension where the shared library version number is hard-coded
instead.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7473)
2018-10-23 21:09:57 +08:00
|
|
|
|
|
|
|
perl_platform => 'Unix',
|
2016-02-27 18:25:33 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
BASE_Windows => {
|
|
|
|
inherit_from => [ "BASE_common" ],
|
|
|
|
template => 1,
|
|
|
|
|
2018-03-10 00:28:06 +08:00
|
|
|
lib_defines =>
|
|
|
|
sub {
|
|
|
|
my @defs = ();
|
|
|
|
unless ($disabled{"zlib-dynamic"}) {
|
|
|
|
my $zlib = $withargs{zlib_lib} // "ZLIB1";
|
2018-04-01 23:41:16 +08:00
|
|
|
push @defs, 'LIBZ=' . (quotify("perl", $zlib))[0];
|
2018-03-10 00:28:06 +08:00
|
|
|
}
|
|
|
|
return [ @defs ];
|
|
|
|
},
|
2016-02-27 18:37:33 +08:00
|
|
|
ex_libs =>
|
|
|
|
sub {
|
2021-08-10 04:56:29 +08:00
|
|
|
my @libs = ();
|
2016-02-27 18:37:33 +08:00
|
|
|
unless ($disabled{zlib}) {
|
|
|
|
if (defined($disabled{"zlib-dynamic"})) {
|
2021-08-10 04:56:29 +08:00
|
|
|
push(@libs, $withargs{zlib_lib} // "ZLIB1");
|
|
|
|
}
|
|
|
|
}
|
2021-08-10 04:56:37 +08:00
|
|
|
unless ($disabled{zstd}) {
|
|
|
|
if (defined($disabled{"zstd-dynamic"})) {
|
|
|
|
push(@libs, $withargs{zstd_lib} // "libzstd");
|
|
|
|
}
|
|
|
|
}
|
2021-08-10 04:56:29 +08:00
|
|
|
unless ($disabled{brotli}) {
|
|
|
|
if (defined($disabled{"brotli-dynamic"})) {
|
|
|
|
my $path = "";
|
|
|
|
if (defined($withargs{brotli_lib})) {
|
|
|
|
$path = $withargs{brotli_lib} . "\\";
|
|
|
|
}
|
|
|
|
push(@libs, $path . "brotlicommon.lib");
|
|
|
|
push(@libs, $path . "brotlidec.lib");
|
|
|
|
push(@libs, $path . "brotlienc.lib");
|
2016-02-27 18:37:33 +08:00
|
|
|
}
|
|
|
|
}
|
2021-08-10 04:56:29 +08:00
|
|
|
return join(" ", @libs);
|
2016-10-24 21:11:29 +08:00
|
|
|
},
|
2016-02-27 18:37:33 +08: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-07 03:35:30 +08:00
|
|
|
MT => "mt",
|
|
|
|
MTFLAGS => "-nologo",
|
2016-07-14 15:23:36 +08:00
|
|
|
mtinflag => "-manifest ",
|
|
|
|
mtoutflag => "-outputresource:",
|
2016-03-02 23:12:22 +08:00
|
|
|
|
|
|
|
build_file => "makefile",
|
|
|
|
build_scheme => [ "unified", "windows" ],
|
2018-10-23 20:36:23 +08:00
|
|
|
|
|
|
|
perl_platform => 'Windows',
|
2016-02-27 18:25:33 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
BASE_VMS => {
|
|
|
|
inherit_from => [ "BASE_common" ],
|
|
|
|
template => 1,
|
|
|
|
|
2018-02-09 06:26:22 +08:00
|
|
|
includes =>
|
|
|
|
add(sub {
|
|
|
|
my @incs = ();
|
|
|
|
# GNV$ZLIB_INCLUDE is the standard logical name for later
|
|
|
|
# zlib incarnations.
|
|
|
|
push @incs, 'GNV$ZLIB_INCLUDE:'
|
|
|
|
if !$disabled{zlib} && !$withargs{zlib_include};
|
|
|
|
return [ @incs ];
|
|
|
|
}),
|
|
|
|
|
2016-02-27 18:25:33 +08:00
|
|
|
build_file => "descrip.mms",
|
|
|
|
build_scheme => [ "unified", "VMS" ],
|
2018-10-23 21:00:36 +08:00
|
|
|
|
|
|
|
perl_platform => 'VMS',
|
2015-05-18 08:54:28 +08:00
|
|
|
},
|
|
|
|
);
|