2016-01-30 10:25:40 +08:00
|
|
|
##
|
|
|
|
## Makefile for OpenSSL
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
2021-05-17 20:25:12 +08:00
|
|
|
use OpenSSL::Util;
|
|
|
|
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
our $makedep_scheme = $config{makedep_scheme};
|
|
|
|
our $makedepcmd = platform->makedepcmd();
|
2016-02-20 23:27:27 +08:00
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
|
2016-02-16 00:42:14 +08:00
|
|
|
|
2018-06-14 17:45:15 +08:00
|
|
|
# Shared AIX support is special. We put libcrypto[64].so.ver into
|
2023-07-21 22:31:34 +08:00
|
|
|
# libcrypto.a and use libcrypto_a.a as static one, unless using
|
|
|
|
# shared_target style aix-solib. In that mode, create
|
|
|
|
# libcrypto.so as a link-import library that inserts runtime
|
|
|
|
# dependencies on libcrypto.so.ver, and the static library is
|
|
|
|
# named libcrypto.a.
|
|
|
|
sub sharedaix { !$disabled{shared} && $target{shared_target} =~ /^aix(?!-solib$)/ }
|
|
|
|
sub sharedaix_solib { !$disabled{shared} && $target{shared_target} =~ /^aix-solib$/ }
|
2018-06-14 17:45:15 +08: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 21:09:57 +08:00
|
|
|
our $sover_dirname = platform->shlib_version_as_filename();
|
2017-04-18 22:24:23 +08:00
|
|
|
|
2016-06-26 20:09:23 +08:00
|
|
|
# This makes sure things get built in the order they need
|
|
|
|
# to. You're welcome.
|
|
|
|
sub dependmagic {
|
|
|
|
my $target = shift;
|
2023-03-01 07:42:56 +08:00
|
|
|
my $help = shift;
|
2016-06-26 20:09:23 +08:00
|
|
|
|
2024-02-21 21:47:19 +08:00
|
|
|
return "$target: build_generated ## $help\n\t\"\$(MAKE)\" depend && \"\$(MAKE)\" _$target\n_$target";
|
2016-06-26 20:09:23 +08:00
|
|
|
}
|
2019-05-23 22:45:47 +08:00
|
|
|
|
|
|
|
our $COLUMNS = $ENV{COLUMNS};
|
|
|
|
if ($COLUMNS =~ /^\d+$/) {
|
|
|
|
$COLUMNS = int($COLUMNS) - 2; # 2 to leave space for ending ' \'
|
|
|
|
} else {
|
|
|
|
$COLUMNS = 76;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub fill_lines {
|
|
|
|
my $item_sep = shift; # string
|
|
|
|
my $line_length = shift; # number of chars
|
|
|
|
|
|
|
|
my @result = ();
|
|
|
|
my $resultpos = 0;
|
|
|
|
|
|
|
|
foreach (@_) {
|
|
|
|
my $fill_line = $result[$resultpos] // '';
|
|
|
|
my $newline =
|
|
|
|
($fill_line eq '' ? '' : $fill_line . $item_sep) . $_;
|
|
|
|
|
|
|
|
if (length($newline) > $line_length) {
|
|
|
|
# If this is a single item and the intended result line
|
|
|
|
# is empty, we put it there anyway
|
|
|
|
if ($fill_line eq '') {
|
|
|
|
$result[$resultpos++] = $newline;
|
|
|
|
} else {
|
|
|
|
$result[++$resultpos] = $_;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$result[$resultpos] = $newline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return @result;
|
|
|
|
}
|
2016-02-20 23:27:27 +08:00
|
|
|
'';
|
2016-01-30 10:25:40 +08:00
|
|
|
-}
|
|
|
|
PLATFORM={- $config{target} -}
|
|
|
|
OPTIONS={- $config{options} -}
|
|
|
|
CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
|
|
|
|
SRCDIR={- $config{sourcedir} -}
|
|
|
|
BLDDIR={- $config{builddir} -}
|
2020-06-29 10:20:41 +08:00
|
|
|
FIPSKEY={- $config{FIPSKEY} -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2018-12-07 07:32:43 +08:00
|
|
|
VERSION={- "$config{full_version}" -}
|
2021-09-08 15:40:37 +08:00
|
|
|
VERSION_NUMBER={- "$config{version}" -}
|
2016-01-30 10:25:40 +08: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 21:56:35 +08:00
|
|
|
SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
|
2016-01-30 10:25:40 +08: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 21:09:57 +08:00
|
|
|
|
2019-05-23 22:45:47 +08:00
|
|
|
LIBS={- join(" \\\n" . ' ' x 5,
|
|
|
|
fill_lines(" ", $COLUMNS - 5,
|
|
|
|
map { platform->staticlib($_) // () }
|
|
|
|
@{$unified_info{libraries}})) -}
|
|
|
|
SHLIBS={- join(" \\\n" . ' ' x 7,
|
|
|
|
fill_lines(" ", $COLUMNS - 7,
|
|
|
|
map { platform->sharedlib($_) // () }
|
|
|
|
@{$unified_info{libraries}})) -}
|
|
|
|
SHLIB_INFO={- join(" \\\n" . ' ' x 11,
|
|
|
|
fill_lines(" ", $COLUMNS - 11,
|
|
|
|
map { my $x = platform->sharedlib($_);
|
2021-01-15 19:20:25 +08:00
|
|
|
my $y = platform->sharedlib_simple($_) // '';
|
|
|
|
my $z = platform->sharedlib_import($_) // '';
|
|
|
|
$x ? "\"$x;$y;$z\"" : () }
|
2019-05-23 22:45:47 +08:00
|
|
|
@{$unified_info{libraries}})) -}
|
|
|
|
MODULES={- join(" \\\n" . ' ' x 8,
|
|
|
|
fill_lines(" ", $COLUMNS - 8,
|
|
|
|
map { platform->dso($_) }
|
2021-05-24 20:06:00 +08:00
|
|
|
# Drop all modules that are dependencies, they will
|
|
|
|
# be processed through their dependents
|
|
|
|
grep { my $x = $_;
|
|
|
|
!grep { grep { $_ eq $x } @$_ }
|
|
|
|
values %{$unified_info{depends}} }
|
2019-05-23 22:45:47 +08:00
|
|
|
@{$unified_info{modules}})) -}
|
2021-05-24 20:06:00 +08:00
|
|
|
FIPSMODULE={- # We do some extra checking here, as there should be only one
|
|
|
|
use File::Basename;
|
|
|
|
our @fipsmodules =
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{modules}->{$_}->{fips} }
|
|
|
|
@{$unified_info{modules}};
|
|
|
|
die "More that one FIPS module" if scalar @fipsmodules > 1;
|
|
|
|
join(" ", map { platform->dso($_) } @fipsmodules) -}
|
|
|
|
FIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1;
|
2021-02-26 02:40:50 +08:00
|
|
|
join(" ", map { basename(platform->dso($_)) } @fipsmodules) -}
|
2020-09-29 17:11:38 +08:00
|
|
|
|
2019-05-23 22:45:47 +08:00
|
|
|
PROGRAMS={- join(" \\\n" . ' ' x 9,
|
|
|
|
fill_lines(" ", $COLUMNS - 9,
|
|
|
|
map { platform->bin($_) }
|
|
|
|
@{$unified_info{programs}})) -}
|
|
|
|
SCRIPTS={- join(" \\\n" . ' ' x 8,
|
|
|
|
fill_lines(" ", $COLUMNS - 8, @{$unified_info{scripts}})) -}
|
2016-03-09 08:17:27 +08:00
|
|
|
{- output_off() if $disabled{makedepend}; "" -}
|
2019-05-23 22:45:47 +08:00
|
|
|
DEPS={- join(" \\\n" . ' ' x 5,
|
|
|
|
fill_lines(" ", $COLUMNS - 5,
|
|
|
|
map { platform->isobj($_) ? platform->dep($_) : () }
|
|
|
|
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
|
|
|
|
keys %{$unified_info{sources}})); -}
|
2016-03-09 08:17:27 +08:00
|
|
|
{- output_on() if $disabled{makedepend}; "" -}
|
2019-05-23 22:45:47 +08:00
|
|
|
GENERATED_MANDATORY={- join(" \\\n" . ' ' x 20,
|
|
|
|
fill_lines(" ", $COLUMNS - 20,
|
|
|
|
@{$unified_info{depends}->{""}})) -}
|
2021-02-04 22:32:37 +08:00
|
|
|
GENERATED_PODS={- # common0.tmpl provides @generated
|
|
|
|
join(" \\\n" . ' ' x 15,
|
|
|
|
fill_lines(" ", $COLUMNS - 15,
|
|
|
|
map { my $x = $_;
|
|
|
|
(
|
|
|
|
grep {
|
|
|
|
$unified_info{attributes}->{depends}
|
|
|
|
->{$x}->{$_}->{pod} // 0
|
|
|
|
}
|
|
|
|
keys %{$unified_info{attributes}->{depends}->{$x}}
|
|
|
|
) ? $x : ();
|
|
|
|
}
|
|
|
|
@generated)) -}
|
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 19:13:22 +08:00
|
|
|
GENERATED={- # common0.tmpl provides @generated
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 5,
|
|
|
|
fill_lines(" ", $COLUMNS - 5,
|
|
|
|
map { platform->convertext($_) } @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 21:09:57 +08:00
|
|
|
|
2018-11-07 18:02:06 +08:00
|
|
|
INSTALL_LIBS={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 13,
|
|
|
|
fill_lines(" ", $COLUMNS - 13,
|
|
|
|
map { platform->staticlib($_) // () }
|
|
|
|
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}}))
|
2018-11-07 18:02:06 +08:00
|
|
|
-}
|
|
|
|
INSTALL_SHLIBS={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 15,
|
|
|
|
fill_lines(" ", $COLUMNS - 15,
|
|
|
|
map { platform->sharedlib($_) // () }
|
|
|
|
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}}))
|
2018-11-07 18:02:06 +08:00
|
|
|
-}
|
|
|
|
INSTALL_SHLIB_INFO={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 19,
|
|
|
|
fill_lines(" ", $COLUMNS - 19,
|
|
|
|
map { my $x = platform->sharedlib($_);
|
2021-01-15 19:20:25 +08:00
|
|
|
my $y = platform->sharedlib_simple($_) // '';
|
|
|
|
my $z = platform->sharedlib_import($_) // '';
|
|
|
|
$x ? "\"$x;$y;$z\"" : () }
|
2019-05-23 22:45:47 +08:00
|
|
|
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}}))
|
2018-11-07 18:02:06 +08:00
|
|
|
-}
|
|
|
|
INSTALL_ENGINES={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 16,
|
|
|
|
fill_lines(" ", $COLUMNS - 16,
|
|
|
|
map { platform->dso($_) }
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
|
|
|
@{$unified_info{modules}}))
|
2018-11-07 18:02:06 +08:00
|
|
|
-}
|
2021-05-24 20:24:32 +08:00
|
|
|
INSTALL_MODULES={-
|
2021-01-08 01:47:01 +08:00
|
|
|
join(" \\\n" . ' ' x 16,
|
|
|
|
fill_lines(" ", $COLUMNS - 16,
|
|
|
|
map { platform->dso($_) }
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
2021-05-24 20:24:32 +08:00
|
|
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine}
|
|
|
|
&& !$unified_info{attributes}->{modules}->{$_}->{fips} }
|
2021-01-08 01:47:01 +08:00
|
|
|
@{$unified_info{modules}}))
|
|
|
|
-}
|
2021-05-24 20:24:32 +08:00
|
|
|
INSTALL_FIPSMODULE={-
|
2020-04-17 21:38:45 +08:00
|
|
|
join(" \\\n" . ' ' x 16,
|
|
|
|
fill_lines(" ", $COLUMNS - 16,
|
|
|
|
map { platform->dso($_) }
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
2021-05-24 20:24:32 +08:00
|
|
|
&& $unified_info{attributes}->{modules}->{$_}->{fips} }
|
2020-04-17 21:38:45 +08:00
|
|
|
@{$unified_info{modules}}))
|
|
|
|
-}
|
2021-05-24 20:24:32 +08:00
|
|
|
INSTALL_FIPSMODULECONF=providers/fipsmodule.cnf
|
2018-11-07 18:02:06 +08:00
|
|
|
INSTALL_PROGRAMS={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 16,
|
|
|
|
fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
|
|
|
|
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{programs}}))
|
2018-11-07 18:02:06 +08:00
|
|
|
-}
|
2023-05-03 18:29:00 +08:00
|
|
|
INSTALL_EXPORTERS_PKGCONFIG={-
|
|
|
|
join(" \\\n" . ' ' x 28,
|
|
|
|
fill_lines(" ", $COLUMNS - 28,
|
|
|
|
grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'pkg-config'}
|
|
|
|
sort keys %{$unified_info{generate}}))
|
|
|
|
-}
|
Add exporters for CMake
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.
By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.
The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:
OPENSSL_MODULES_DIR Indicates the default installation directory
for OpenSSL loadable modules, such as providers.
OPENSSL_RUNTIME_DIR Indicates the default runtime directory, where
for example the openssl program is located.
OPENSSL_PROGRAM Is the full directory-and-filename of the
openssl program.
The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.
For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:
- The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
to the 'find_package(OpenSSL)' call.
- The 'find_package' call itself must use the "Full Signature". If you
don't know any better, simply add the 'CONFIG' option, i.e. from this
example:
find_package(OpenSSL 3.0 REQUIRED)
to this:
find_package(OpenSSL 3.0 REQUIRED CONFIG)
Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:
- Those in 'exporters/' are installed in the location that 'pkg-config'
itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
directly against an OpenSSL build tree.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20878)
2023-05-03 18:36:09 +08:00
|
|
|
INSTALL_EXPORTERS_CMAKE={-
|
|
|
|
join(" \\\n" . ' ' x 24,
|
|
|
|
fill_lines(" ", $COLUMNS - 24,
|
|
|
|
grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'cmake'}
|
|
|
|
sort keys %{$unified_info{generate}}))
|
|
|
|
-}
|
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 18:05:17 +08:00
|
|
|
BIN_SCRIPTS={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 12,
|
|
|
|
fill_lines(" ", $COLUMNS - 12,
|
|
|
|
map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
|
|
|
|
$x ? "$_:$x" : $_ }
|
|
|
|
grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
|
|
|
|
&& !$unified_info{attributes}->{scripts}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}}))
|
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 18:05:17 +08:00
|
|
|
-}
|
|
|
|
MISC_SCRIPTS={-
|
2019-05-23 22:45:47 +08:00
|
|
|
join(" \\\n" . ' ' x 13,
|
|
|
|
fill_lines(" ", $COLUMNS - 13,
|
|
|
|
map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
|
|
|
|
$x ? "$_:$x" : $_ }
|
|
|
|
grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{scripts}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}}))
|
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 18:05:17 +08:00
|
|
|
-}
|
2021-05-21 13:24:57 +08:00
|
|
|
IMAGEDOCS1={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
|
|
|
@{$unified_info{imagedocs}->{man1}})) -}
|
|
|
|
IMAGEDOCS3={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
|
|
|
@{$unified_info{imagedocs}->{man3}})) -}
|
|
|
|
IMAGEDOCS5={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
|
|
|
@{$unified_info{imagedocs}->{man5}})) -}
|
|
|
|
IMAGEDOCS7={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
|
|
|
@{$unified_info{imagedocs}->{man7}})) -}
|
2016-09-01 04:57:25 +08:00
|
|
|
HTMLDOCS1={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{htmldocs}->{man1}})) -}
|
|
|
|
HTMLDOCS3={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{htmldocs}->{man3}})) -}
|
|
|
|
HTMLDOCS5={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{htmldocs}->{man5}})) -}
|
|
|
|
HTMLDOCS7={-
|
|
|
|
join(" \\\n" . ' ' x 10,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{htmldocs}->{man7}})) -}
|
|
|
|
MANDOCS1={-
|
|
|
|
join(" \\\n" . ' ' x 9,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 9,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{mandocs}->{man1}})) -}
|
|
|
|
MANDOCS3={-
|
|
|
|
join(" \\\n" . ' ' x 9,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 9,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{mandocs}->{man3}})) -}
|
|
|
|
MANDOCS5={-
|
|
|
|
join(" \\\n" . ' ' x 9,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 9,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{mandocs}->{man5}})) -}
|
|
|
|
MANDOCS7={-
|
|
|
|
join(" \\\n" . ' ' x 9,
|
2020-07-06 17:35:25 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 9,
|
2016-09-01 04:57:25 +08:00
|
|
|
@{$unified_info{mandocs}->{man7}})) -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2020-02-26 21:39:16 +08:00
|
|
|
APPS_OPENSSL="{- use File::Spec::Functions;
|
|
|
|
catfile("apps","openssl") -}"
|
2017-06-16 01:31:01 +08:00
|
|
|
|
2016-02-13 04:14:03 +08: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 10:25:40 +08:00
|
|
|
# Normally it is left empty.
|
2016-02-13 04:14:03 +08:00
|
|
|
DESTDIR=
|
2016-01-30 10:25:40 +08: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 19:10:42 +08:00
|
|
|
LIBDIR={- our $libdir = $config{libdir};
|
|
|
|
unless ($libdir) {
|
2021-07-20 22:32:49 +08:00
|
|
|
$libdir = "lib$target{multilib}";
|
2018-02-23 19:10:42 +08:00
|
|
|
}
|
|
|
|
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-06 06:18:50 +08:00
|
|
|
MODULESDIR=$(libdir)/ossl-modules
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2016-10-12 23:05:35 +08:00
|
|
|
# Convenience variable for those who want to set the rpath in shared
|
|
|
|
# libraries and applications
|
2018-02-23 19:10:42 +08:00
|
|
|
LIBRPATH=$(libdir)
|
2016-10-12 23:05:35 +08:00
|
|
|
|
2021-08-31 03:24:39 +08:00
|
|
|
BINDIR={- our $bindir = $config{bindir};
|
|
|
|
unless ($bindir) {
|
|
|
|
$bindir = "bin$target{multibin}";
|
|
|
|
}
|
|
|
|
file_name_is_absolute($bindir) ? "" : $bindir -}
|
|
|
|
bindir={- file_name_is_absolute($bindir)
|
|
|
|
? $bindir : '$(INSTALLTOP)/$(BINDIR)' -}
|
|
|
|
|
2023-05-03 18:29:00 +08:00
|
|
|
PKGCONFIGDIR=$(libdir)/pkgconfig
|
Add exporters for CMake
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.
By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.
The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:
OPENSSL_MODULES_DIR Indicates the default installation directory
for OpenSSL loadable modules, such as providers.
OPENSSL_RUNTIME_DIR Indicates the default runtime directory, where
for example the openssl program is located.
OPENSSL_PROGRAM Is the full directory-and-filename of the
openssl program.
The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.
For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:
- The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
to the 'find_package(OpenSSL)' call.
- The 'find_package' call itself must use the "Full Signature". If you
don't know any better, simply add the 'CONFIG' option, i.e. from this
example:
find_package(OpenSSL 3.0 REQUIRED)
to this:
find_package(OpenSSL 3.0 REQUIRED CONFIG)
Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:
- Those in 'exporters/' are installed in the location that 'pkg-config'
itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
directly against an OpenSSL build tree.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20878)
2023-05-03 18:36:09 +08:00
|
|
|
CMAKECONFIGDIR=$(libdir)/cmake/OpenSSL
|
2023-05-03 18:29:00 +08:00
|
|
|
|
2016-02-14 00:55:48 +08:00
|
|
|
MANDIR=$(INSTALLTOP)/share/man
|
2016-02-19 17:38:15 +08:00
|
|
|
DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
|
|
|
|
HTMLDIR=$(DOCDIR)/html
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2016-02-15 20:37:17 +08: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.
|
2021-04-13 00:04:43 +08:00
|
|
|
MANSUFFIX=ossl
|
2016-01-30 10:25:40 +08:00
|
|
|
HTMLSUFFIX=html
|
|
|
|
|
2017-06-29 23:40:19 +08:00
|
|
|
# For "optional" echo messages, to get "real" silence
|
|
|
|
ECHO = echo
|
2016-01-30 10:25:40 +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
|
|
|
##### 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}}) -}
|
|
|
|
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
MAKEDEPEND={- $config{makedepcmd} -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2018-07-08 18:00:06 +08:00
|
|
|
PERL={- $config{PERL} -}
|
2016-01-30 10:25:40 +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
|
|
|
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 10:25:40 +08:00
|
|
|
RM= rm -f
|
2016-02-16 05:12:24 +08: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-07 03:35:30 +08:00
|
|
|
TAR= {- $target{TAR} || "tar" -}
|
|
|
|
TARFLAGS= {- $target{TARFLAGS} -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
BASENAME= openssl
|
|
|
|
NAME= $(BASENAME)-$(VERSION)
|
2018-11-24 18:27:50 +08:00
|
|
|
# Relative to $(SRCDIR)
|
2016-01-30 10:25:40 +08: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-07 03:35:30 +08: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 19:39:01 +08: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-07 03:35:30 +08:00
|
|
|
$target{shared_cppflag} || (),
|
|
|
|
(map { '-D'.$_ }
|
2020-01-04 13:39:50 +08:00
|
|
|
@{$target{lib_defines} || ()},
|
|
|
|
@{$target{shared_defines} || ()},
|
2019-02-13 11:21:59 +08:00
|
|
|
@{$config{lib_defines} || ()},
|
|
|
|
@{$config{shared_defines} || ()}),
|
2020-01-04 13:39:50 +08:00
|
|
|
(map { '-I'.quotify1($_) }
|
|
|
|
@{$target{lib_includes}},
|
|
|
|
@{$target{shared_includes}},
|
|
|
|
@{$config{lib_includes}},
|
|
|
|
@{$config{shared_includes}}),
|
2018-03-09 19:39:01 +08: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-07 03:35:30 +08:00
|
|
|
'OPENSSLDIR="\"$(OPENSSLDIR)\""',
|
2019-02-06 06:18:50 +08: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-07 03:35:30 +08: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 11:21:59 +08:00
|
|
|
(map { '-D'.$_ }
|
2020-01-04 13:39:50 +08:00
|
|
|
@{$target{dso_defines}},
|
|
|
|
@{$target{module_defines}},
|
2019-02-13 11:21:59 +08:00
|
|
|
@{$config{dso_defines} || ()},
|
|
|
|
@{$config{module_defines} || ()}),
|
2020-01-04 13:39:50 +08:00
|
|
|
(map { '-I'.quotify1($_) }
|
|
|
|
@{$target{dso_includes}},
|
|
|
|
@{$target{module_includes}},
|
|
|
|
@{$config{dso_includes}},
|
|
|
|
@{$config{module_includes}}),
|
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
|
|
|
@{$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 11:21:59 +08: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-07 03:35:30 +08: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 19:39:01 +08: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-07 03:35:30 +08:00
|
|
|
|
2016-01-30 10:25:40 +08: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-29 05:05:32 +08: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 10:25:40 +08:00
|
|
|
# The main targets ###################################################
|
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
##@ Software
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
{- dependmagic('build_sw', 'Build all the software (default target)'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
|
|
|
|
{- dependmagic('build_libs', 'Build the libraries libssl and libcrypto'); -}: build_libs_nodep
|
|
|
|
{- dependmagic('build_modules', 'Build the modules (i.e. providers and engines)'); -}: build_modules_nodep
|
|
|
|
{- dependmagic('build_programs', 'Build the openssl executables and scripts'); -}: build_programs_nodep
|
|
|
|
|
2023-06-19 19:43:35 +08:00
|
|
|
all: build_sw {- "build_docs" if !$disabled{docs}; -} ## Build software and documentation
|
2023-03-01 07:42:56 +08:00
|
|
|
|
|
|
|
##@ Documentation
|
2021-02-04 22:32:37 +08:00
|
|
|
build_generated_pods: $(GENERATED_PODS)
|
2023-03-01 07:42:56 +08:00
|
|
|
build_docs: build_man_docs build_html_docs ## Create documentation
|
|
|
|
build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7) ## Create manpages
|
|
|
|
build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) ## Create HTML documentation
|
2016-09-01 04:57:25 +08:00
|
|
|
|
2016-06-26 20:09:23 +08:00
|
|
|
build_generated: $(GENERATED_MANDATORY)
|
2023-05-03 18:29:00 +08:00
|
|
|
build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
|
2019-01-31 07:06:50 +08:00
|
|
|
build_modules_nodep: $(MODULES)
|
2016-07-08 23:58:36 +08:00
|
|
|
build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
|
|
|
|
|
|
|
|
# Kept around for backward compatibility
|
|
|
|
build_apps build_tests: build_programs
|
2016-02-14 01:15:51 +08:00
|
|
|
|
2017-06-16 09:46:41 +08:00
|
|
|
# Convenience target to prebuild all generated files, not just the mandatory
|
|
|
|
# ones
|
2016-09-01 04:57:25 +08:00
|
|
|
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
|
2018-04-11 16:11:07 +08: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 09:46:41 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
##@ Help
|
|
|
|
.PHONY: help
|
|
|
|
help: ## Show this help screen
|
|
|
|
@$(PERL) $(SRCDIR)/util/help.pl $(BLDDIR)/Makefile
|
2016-09-01 04:57:25 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
##@ Testing
|
|
|
|
test: tests ## Run tests (alias of "tests")
|
2023-12-05 16:21:35 +08:00
|
|
|
{- dependmagic('tests', 'Run tests'); -}: build_programs_nodep build_modules_nodep link-utils
|
2024-02-21 21:47:19 +08:00
|
|
|
"$(MAKE)" run_tests
|
2023-12-05 16:21:35 +08:00
|
|
|
run_tests: FORCE
|
2016-04-14 20:44:15 +08:00
|
|
|
@ : {- output_off() if $disabled{tests}; "" -}
|
2020-02-13 03:22:42 +08:00
|
|
|
( SRCTOP=$(SRCDIR) \
|
|
|
|
BLDTOP=$(BLDDIR) \
|
2016-05-27 23:18:57 +08:00
|
|
|
PERL="$(PERL)" \
|
2020-06-29 10:20:41 +08:00
|
|
|
FIPSKEY="$(FIPSKEY)" \
|
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
|
|
|
EXE_EXT={- platform->binext() -} \
|
2020-02-13 03:22:42 +08:00
|
|
|
$(PERL) $(SRCDIR)/test/run_tests.pl $(TESTS) )
|
2016-04-14 20:44:15 +08: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 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
list-tests: ## List available tests that can be invoked via "make test TESTS=<name>"
|
2016-06-17 06:23:43 +08:00
|
|
|
@ : {- output_off() if $disabled{tests}; "" -}
|
2024-02-21 21:47:19 +08:00
|
|
|
"$(MAKE)" run_tests TESTS=list
|
2016-06-17 06:23:43 +08:00
|
|
|
@ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
@echo "Tests are not supported with your chosen Configure options"
|
|
|
|
@ : {- output_on() if !$disabled{tests}; "" -}
|
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
##@ Workspace cleaning
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
libclean:
|
2016-02-16 05:13:41 +08:00
|
|
|
@set -e; for s in $(SHLIB_INFO); do \
|
2018-04-14 03:41:14 +08:00
|
|
|
if [ "$$s" = ";" ]; then continue; fi; \
|
2016-02-16 05:13:41 +08:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
2021-01-15 19:20:25 +08:00
|
|
|
s3=`echo "$$s" | cut -f3 -d";"`; \
|
2018-04-14 03:41:14 +08:00
|
|
|
$(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
|
|
|
|
$(RM) apps/$$s1; \
|
|
|
|
$(RM) test/$$s1; \
|
|
|
|
$(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
|
2016-02-16 05:13:41 +08:00
|
|
|
$(RM) $$s1; \
|
2021-01-15 19:20:25 +08:00
|
|
|
if [ "$$s2" != "" ]; then \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) $(RM) $$s2; \
|
2016-02-16 05:13:41 +08:00
|
|
|
$(RM) $$s2; \
|
|
|
|
fi; \
|
2021-01-15 19:20:25 +08:00
|
|
|
if [ "$$s3" != "" ]; then \
|
|
|
|
$(ECHO) $(RM) $$s3; \
|
|
|
|
$(RM) $$s3; \
|
|
|
|
fi; \
|
2016-02-16 05:13:41 +08:00
|
|
|
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 21:09:57 +08:00
|
|
|
$(RM) *{- platform->defext() -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
clean: libclean ## Clean the workspace, keep the configuration
|
2021-03-30 03:45:40 +08:00
|
|
|
$(RM) $(HTMLDOCS1)
|
|
|
|
$(RM) $(HTMLDOCS3)
|
|
|
|
$(RM) $(HTMLDOCS5)
|
|
|
|
$(RM) $(HTMLDOCS7)
|
|
|
|
$(RM) $(MANDOCS1)
|
|
|
|
$(RM) $(MANDOCS3)
|
|
|
|
$(RM) $(MANDOCS5)
|
|
|
|
$(RM) $(MANDOCS7)
|
2022-01-21 03:38:33 +08:00
|
|
|
$(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(FIPSMODULE) $(SCRIPTS)
|
2018-04-14 05:24:01 +08:00
|
|
|
$(RM) $(GENERATED_MANDATORY) $(GENERATED)
|
2020-09-22 02:56:34 +08:00
|
|
|
-find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
|
|
|
|
-find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
|
2016-06-17 06:23:43 +08:00
|
|
|
$(RM) core
|
2021-05-18 17:18:26 +08:00
|
|
|
$(RM) tags TAGS doc-nits md-nits
|
2017-12-15 04:16:41 +08:00
|
|
|
$(RM) -r test/test-runs
|
2021-05-13 18:51:14 +08:00
|
|
|
$(RM) providers/fips*.new
|
2020-09-22 02:56:34 +08:00
|
|
|
-find . -type l \! -name '.*' -exec $(RM) {} \;
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
distclean: clean ## Clean and remove the configuration
|
2022-05-24 23:20:52 +08:00
|
|
|
$(RM) include/openssl/configuration.h
|
2016-06-17 06:23:43 +08:00
|
|
|
$(RM) configdata.pm
|
|
|
|
$(RM) Makefile
|
2016-06-14 04:02:11 +08:00
|
|
|
|
2016-02-21 23:09:36 +08:00
|
|
|
# We check if any depfile is newer than Makefile and decide to
|
2016-03-19 03:52:29 +08:00
|
|
|
# concatenate only if that is true.
|
2022-02-23 18:00:39 +08:00
|
|
|
depend: Makefile
|
2016-03-09 08:17:27 +08:00
|
|
|
@: {- output_off() if $disabled{makedepend}; "" -}
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/add-depends.pl "{- $makedep_scheme -}"
|
2016-03-09 08:17:27 +08:00
|
|
|
@: {- output_on() if $disabled{makedepend}; "" -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
# Install helper targets #############################################
|
2023-03-01 07:42:56 +08:00
|
|
|
##@ Installation
|
|
|
|
|
2023-06-19 19:43:35 +08:00
|
|
|
install: install_sw install_ssldirs {- "install_docs" if !$disabled{docs}; -} {- $disabled{fips} ? "" : "install_fips" -} ## Install software and documentation, create OpenSSL directories
|
2023-03-01 07:42:56 +08:00
|
|
|
|
2023-06-19 19:43:35 +08:00
|
|
|
uninstall: {- "uninstall_docs" if !$disabled{docs}; -} uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -} ## Uninstall software and documentation
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
install_sw: install_dev install_engines install_modules install_runtime ## Install just the software and libraries
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev ## Uninstall the software and libraries
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
install_docs: install_man_docs install_html_docs ## Install manpages and HTML documentation
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2023-03-01 07:42:56 +08:00
|
|
|
uninstall_docs: uninstall_man_docs uninstall_html_docs ## Uninstall manpages and HTML documentation
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) -r "$(DESTDIR)$(DOCDIR)"
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-04-26 06:14:59 +08:00
|
|
|
{- output_off() if $disabled{fips}; "" -}
|
2021-05-24 20:24:32 +08:00
|
|
|
install_fips: build_sw $(INSTALL_FIPSMODULECONF)
|
2021-01-08 01:47:01 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)"
|
2021-01-08 01:47:01 +08:00
|
|
|
@$(ECHO) "*** Installing FIPS module"
|
2021-05-24 20:24:32 +08:00
|
|
|
@$(ECHO) "install $(INSTALL_FIPSMODULE) -> $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"
|
2023-10-11 00:41:59 +08:00
|
|
|
@cp "$(INSTALL_FIPSMODULE)" "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new"
|
|
|
|
@chmod 755 "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new"
|
|
|
|
@mv -f "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" \
|
|
|
|
"$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"
|
2020-09-29 17:11:38 +08:00
|
|
|
@$(ECHO) "*** Installing FIPS module configuration"
|
2021-05-24 20:24:32 +08:00
|
|
|
@$(ECHO) "install $(INSTALL_FIPSMODULECONF) -> $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
|
2023-10-11 00:41:59 +08:00
|
|
|
@cp $(INSTALL_FIPSMODULECONF) "$(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
|
2020-09-29 17:11:38 +08:00
|
|
|
|
2021-01-08 01:47:01 +08:00
|
|
|
uninstall_fips:
|
2020-09-29 17:11:38 +08:00
|
|
|
@$(ECHO) "*** Uninstalling FIPS module configuration"
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
|
2021-01-08 01:47:01 +08:00
|
|
|
@$(ECHO) "*** Uninstalling FIPS module"
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)"
|
2021-04-26 06:14:59 +08:00
|
|
|
{- if ($disabled{fips}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
install_fips:
|
|
|
|
@$(ECHO) "The 'install_fips' target requires the 'enable-fips' option"
|
|
|
|
|
|
|
|
uninstall_fips:
|
|
|
|
@$(ECHO) "The 'uninstall_fips' target requires the 'enable-fips' option"
|
|
|
|
{- output_on() if !$disabled{fips}; "" -}
|
|
|
|
|
2020-09-29 17:11:38 +08:00
|
|
|
|
2016-02-14 00:55:48 +08:00
|
|
|
install_ssldirs:
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/certs"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/private"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/misc"
|
2016-06-17 06:23:43 +08:00
|
|
|
@set -e; for x in dummy $(MISC_SCRIPTS); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2018-07-23 19:25:45 +08:00
|
|
|
x1=`echo "$$x" | cut -f1 -d:`; \
|
|
|
|
x2=`echo "$$x" | cut -f2 -d:`; \
|
|
|
|
fn=`basename $$x1`; \
|
|
|
|
$(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x1 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
2018-07-23 19:25:45 +08:00
|
|
|
if [ "$$x1" != "$$x2" ]; then \
|
|
|
|
ln=`basename "$$x2"`; \
|
|
|
|
: {- output_off() unless windowsdll(); "" -}; \
|
|
|
|
$(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn" "$(DESTDIR)$(OPENSSLDIR)/misc/$$ln"; \
|
2018-07-23 19:25:45 +08:00
|
|
|
: {- output_on() unless windowsdll();
|
|
|
|
output_off() if windowsdll(); "" -}; \
|
|
|
|
$(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
ln -sf $$fn "$(DESTDIR)$(OPENSSLDIR)/misc/$$ln"; \
|
2018-07-23 19:25:45 +08:00
|
|
|
: {- output_on() if windowsdll(); "" -}; \
|
|
|
|
fi; \
|
2016-06-17 06:23:43 +08:00
|
|
|
done
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
|
2023-10-11 00:41:59 +08:00
|
|
|
@cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new"
|
|
|
|
@chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new"
|
|
|
|
@mv -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
|
2016-09-10 06:05:41 +08:00
|
|
|
@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
|
2016-08-02 05:18:25 +08:00
|
|
|
fi
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
|
2023-10-11 00:41:59 +08: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"
|
2016-09-10 06:05:41 +08:00
|
|
|
@if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $(SRCDIR)/apps/ct_log_list.cnf "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
|
2016-09-10 06:05:41 +08:00
|
|
|
fi
|
2016-02-14 00:55:48 +08:00
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
install_dev: install_runtime_libs
|
2016-01-30 10:25:40 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "*** Installing development files"
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/include/openssl"
|
2021-09-10 12:42:24 +08:00
|
|
|
@ : {- output_off() if $disabled{uplink}; "" -}
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2023-10-11 00:41:59 +08:00
|
|
|
@cp $(SRCDIR)/ms/applink.c "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
|
|
|
@chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2021-09-10 12:42:24 +08:00
|
|
|
@ : {- output_on() if $disabled{uplink}; "" -}
|
2016-01-30 10:25:40 +08:00
|
|
|
@set -e; for i in $(SRCDIR)/include/openssl/*.h \
|
|
|
|
$(BLDDIR)/include/openssl/*.h; do \
|
|
|
|
fn=`basename $$i`; \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$i "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for l in $(INSTALL_LIBS); do \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$l`; \
|
2018-02-23 19:10:42 +08:00
|
|
|
$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
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 10:25:40 +08:00
|
|
|
done
|
2016-02-22 20:52:46 +08:00
|
|
|
@ : {- output_off() if $disabled{shared}; "" -}
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for s in $(INSTALL_SHLIB_INFO); do \
|
2016-02-16 01:39:49 +08:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
2021-01-15 19:20:25 +08:00
|
|
|
s3=`echo "$$s" | cut -f3 -d";"`; \
|
2021-01-23 06:01:18 +08:00
|
|
|
fn1=`basename "$$s1"`; \
|
|
|
|
fn2=`basename "$$s2"`; \
|
|
|
|
fn3=`basename "$$s3"`; \
|
2023-07-21 22:31:34 +08:00
|
|
|
: {- output_off(); output_on() unless windowsdll() or sharedaix() or sharedaix_solib(); "" -}; \
|
2021-01-15 19:20:25 +08:00
|
|
|
if [ "$$fn2" != "" ]; then \
|
2018-02-23 19:10:42 +08:00
|
|
|
$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
ln -sf $$fn1 "$(DESTDIR)$(libdir)/$$fn2"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fi; \
|
2023-07-21 22:31:34 +08:00
|
|
|
: {- output_off() unless windowsdll() or sharedaix() or sharedaix_solib(); output_on() if windowsdll() or sharedaix_solib(); "" -}; \
|
2021-01-23 06:01:18 +08:00
|
|
|
if [ "$$fn3" != "" ]; then \
|
|
|
|
$(ECHO) "install $$s3 -> $(DESTDIR)$(libdir)/$$fn3"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$s3 "$(DESTDIR)$(libdir)/$$fn3.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(libdir)/$$fn3.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(libdir)/$$fn3.new" \
|
|
|
|
"$(DESTDIR)$(libdir)/$$fn3"; \
|
2021-01-23 06:01:18 +08:00
|
|
|
fi; \
|
2023-07-21 22:31:34 +08:00
|
|
|
: {- output_off() if windowsdll() or sharedaix_solib(); output_on() if sharedaix(); "" -}; \
|
2023-10-11 00:41:59 +08:00
|
|
|
a="$(DESTDIR)$(libdir)/$$fn2"; \
|
2018-06-14 17:45:15 +08:00
|
|
|
$(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 10:25:40 +08:00
|
|
|
done
|
2016-02-22 20:52:46 +08:00
|
|
|
@ : {- output_on() if $disabled{shared}; "" -}
|
2023-05-03 18:29:00 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(PKGCONFIGDIR)"
|
|
|
|
@for e in $(INSTALL_EXPORTERS_PKGCONFIG); do \
|
|
|
|
fn=`basename $$e`; \
|
|
|
|
$(ECHO) "install $$e -> $(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
|
|
|
|
cp $$e "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
|
|
|
|
done
|
Add exporters for CMake
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.
By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.
The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:
OPENSSL_MODULES_DIR Indicates the default installation directory
for OpenSSL loadable modules, such as providers.
OPENSSL_RUNTIME_DIR Indicates the default runtime directory, where
for example the openssl program is located.
OPENSSL_PROGRAM Is the full directory-and-filename of the
openssl program.
The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.
For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:
- The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
to the 'find_package(OpenSSL)' call.
- The 'find_package' call itself must use the "Full Signature". If you
don't know any better, simply add the 'CONFIG' option, i.e. from this
example:
find_package(OpenSSL 3.0 REQUIRED)
to this:
find_package(OpenSSL 3.0 REQUIRED CONFIG)
Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:
- Those in 'exporters/' are installed in the location that 'pkg-config'
itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
directly against an OpenSSL build tree.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20878)
2023-05-03 18:36:09 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(CMAKECONFIGDIR)
|
|
|
|
@for e in $(INSTALL_EXPORTERS_CMAKE); do \
|
|
|
|
fn=`basename $$e`; \
|
|
|
|
$(ECHO) "install $$e -> $(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
|
|
|
|
cp $$e $(DESTDIR)$(CMAKECONFIGDIR)/$$fn; \
|
|
|
|
chmod 644 $(DESTDIR)$(CMAKECONFIGDIR)/$$fn; \
|
|
|
|
done
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
uninstall_dev: uninstall_runtime_libs
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "*** Uninstalling development files"
|
2021-09-10 12:42:24 +08:00
|
|
|
@ : {- output_off() if $disabled{uplink}; "" -}
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(RM) "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
|
2021-09-10 12:42:24 +08:00
|
|
|
@ : {- output_on() if $disabled{uplink}; "" -}
|
2016-01-30 10:25:40 +08:00
|
|
|
@set -e; for i in $(SRCDIR)/include/openssl/*.h \
|
|
|
|
$(BLDDIR)/include/openssl/*.h; do \
|
|
|
|
fn=`basename $$i`; \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2023-10-11 00:41:59 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(INSTALLTOP)/include/openssl"
|
|
|
|
-$(RMDIR) "$(DESTDIR)$(INSTALLTOP)/include"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for l in $(INSTALL_LIBS); do \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$l`; \
|
2018-02-23 19:10:42 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(libdir)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2016-02-22 20:52:46 +08:00
|
|
|
@ : {- output_off() if $disabled{shared}; "" -}
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for s in $(INSTALL_SHLIB_INFO); do \
|
2016-02-16 01:39:49 +08:00
|
|
|
s1=`echo "$$s" | cut -f1 -d";"`; \
|
|
|
|
s2=`echo "$$s" | cut -f2 -d";"`; \
|
2021-01-15 19:20:25 +08:00
|
|
|
s3=`echo "$$s" | cut -f3 -d";"`; \
|
2021-01-23 06:01:18 +08:00
|
|
|
fn1=`basename "$$s1"`; \
|
|
|
|
fn2=`basename "$$s2"`; \
|
|
|
|
fn3=`basename "$$s3"`; \
|
2016-02-16 01:39:49 +08:00
|
|
|
: {- output_off() if windowsdll(); "" -}; \
|
2021-01-15 19:20:25 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(libdir)/$$fn1"; \
|
2021-01-15 19:20:25 +08:00
|
|
|
if [ -n "$$fn2" ]; then \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(libdir)/$$fn2"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fi; \
|
2016-02-16 01:39:49 +08:00
|
|
|
: {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
|
2021-01-23 06:01:18 +08:00
|
|
|
if [ -n "$$fn3" ]; then \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn3"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(libdir)/$$fn3"; \
|
2021-01-23 06:01:18 +08:00
|
|
|
fi; \
|
2016-02-20 05:23:28 +08:00
|
|
|
: {- output_on() unless windowsdll(); "" -}; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2016-03-04 12:43:15 +08:00
|
|
|
@ : {- output_on() if $disabled{shared}; "" -}
|
2023-05-03 18:29:00 +08:00
|
|
|
@for e in $(INSTALL_EXPORTERS_PKGCONFIG); do \
|
|
|
|
fn=`basename "$$e"`; \
|
|
|
|
$(RM) "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
|
|
|
|
done
|
Add exporters for CMake
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.
By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.
The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:
OPENSSL_MODULES_DIR Indicates the default installation directory
for OpenSSL loadable modules, such as providers.
OPENSSL_RUNTIME_DIR Indicates the default runtime directory, where
for example the openssl program is located.
OPENSSL_PROGRAM Is the full directory-and-filename of the
openssl program.
The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.
For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:
- The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
to the 'find_package(OpenSSL)' call.
- The 'find_package' call itself must use the "Full Signature". If you
don't know any better, simply add the 'CONFIG' option, i.e. from this
example:
find_package(OpenSSL 3.0 REQUIRED)
to this:
find_package(OpenSSL 3.0 REQUIRED CONFIG)
Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:
- Those in 'exporters/' are installed in the location that 'pkg-config'
itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
directly against an OpenSSL build tree.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20878)
2023-05-03 18:36:09 +08:00
|
|
|
@for e in $(INSTALL_EXPORTERS_CMAKE); do \
|
|
|
|
fn=`basename "$$e"`; \
|
|
|
|
$(RM) "$(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
|
|
|
|
done
|
2023-05-03 18:29:00 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(PKGCONFIGDIR)"
|
Add exporters for CMake
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.
By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.
The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:
OPENSSL_MODULES_DIR Indicates the default installation directory
for OpenSSL loadable modules, such as providers.
OPENSSL_RUNTIME_DIR Indicates the default runtime directory, where
for example the openssl program is located.
OPENSSL_PROGRAM Is the full directory-and-filename of the
openssl program.
The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.
For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:
- The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
to the 'find_package(OpenSSL)' call.
- The 'find_package' call itself must use the "Full Signature". If you
don't know any better, simply add the 'CONFIG' option, i.e. from this
example:
find_package(OpenSSL 3.0 REQUIRED)
to this:
find_package(OpenSSL 3.0 REQUIRED CONFIG)
Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:
- Those in 'exporters/' are installed in the location that 'pkg-config'
itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
directly against an OpenSSL build tree.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20878)
2023-05-03 18:36:09 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(CMAKECONFIGDIR)"
|
2023-10-11 00:41:59 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(libdir)"
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2020-04-17 21:38:45 +08:00
|
|
|
_install_modules_deps: install_runtime_libs build_modules
|
|
|
|
|
|
|
|
install_engines: _install_modules_deps
|
2016-01-30 10:25:40 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(ENGINESDIR)/"
|
2020-04-17 21:38:45 +08:00
|
|
|
@$(ECHO) "*** Installing engines"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$e`; \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
|
2023-10-11 00:41:59 +08: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 10:25:40 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
uninstall_engines:
|
2020-04-17 21:38:45 +08:00
|
|
|
@$(ECHO) "*** Uninstalling engines"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$e`; \
|
2017-06-29 23:40:19 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(ENGINESDIR)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2023-10-11 00:41:59 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(ENGINESDIR)"
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2020-04-17 21:38:45 +08:00
|
|
|
install_modules: _install_modules_deps
|
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)/"
|
2020-04-17 21:38:45 +08:00
|
|
|
@$(ECHO) "*** Installing modules"
|
|
|
|
@set -e; for e in dummy $(INSTALL_MODULES); do \
|
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$e`; \
|
|
|
|
$(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$e "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(MODULESDIR)/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(MODULESDIR)/$$fn"; \
|
2020-04-17 21:38:45 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
uninstall_modules:
|
|
|
|
@$(ECHO) "*** Uninstalling modules"
|
|
|
|
@set -e; for e in dummy $(INSTALL_MODULES); do \
|
|
|
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$e`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MODULESDIR)/$$fn"; \
|
2020-04-17 21:38:45 +08:00
|
|
|
done
|
2023-10-11 00:41:59 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(MODULESDIR)"
|
2020-04-17 21:38:45 +08:00
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
install_runtime: install_programs
|
|
|
|
|
2018-11-07 23:13:57 +08:00
|
|
|
install_runtime_libs: build_libs
|
2016-01-30 10:25:40 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2016-07-19 19:24:57 +08:00
|
|
|
@ : {- output_off() if windowsdll(); "" -}
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)"
|
2018-11-19 17:21:49 +08:00
|
|
|
@ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -}
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(bindir)/"
|
2018-11-19 17:21:49 +08:00
|
|
|
@ : {- output_on() unless windowsdll(); "" -}
|
2018-10-25 15:09:20 +08:00
|
|
|
@$(ECHO) "*** Installing runtime libraries"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$s" = "dummy" ]; then continue; fi; \
|
2016-02-16 05:13:41 +08:00
|
|
|
fn=`basename $$s`; \
|
2016-07-19 19:24:57 +08:00
|
|
|
: {- output_off() unless windowsdll(); "" -}; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "install $$s -> $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$s "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(bindir)/$$fn"; \
|
2016-07-19 19:24:57 +08:00
|
|
|
: {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
|
2018-02-23 19:10:42 +08:00
|
|
|
$(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$s "$(DESTDIR)$(libdir)/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(libdir)/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(libdir)/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(libdir)/$$fn"; \
|
2016-07-19 19:24:57 +08:00
|
|
|
: {- output_on() if windowsdll(); "" -}; \
|
2016-01-30 12:45:29 +08:00
|
|
|
done
|
2018-10-25 15:09:20 +08:00
|
|
|
|
2018-11-07 23:13:57 +08:00
|
|
|
install_programs: install_runtime_libs build_programs
|
2018-10-25 15:09:20 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(bindir)"
|
2018-10-25 15:09:20 +08:00
|
|
|
@$(ECHO) "*** Installing runtime programs"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$x`; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(bindir)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2016-03-21 15:11:14 +08:00
|
|
|
@set -e; for x in dummy $(BIN_SCRIPTS); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$x`; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
chmod 755 "$(DESTDIR)$(bindir)/$$fn.new"; \
|
|
|
|
mv -f "$(DESTDIR)$(bindir)/$$fn.new" \
|
|
|
|
"$(DESTDIR)$(bindir)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
uninstall_runtime: uninstall_programs uninstall_runtime_libs
|
|
|
|
|
|
|
|
uninstall_programs:
|
|
|
|
@$(ECHO) "*** Uninstalling runtime programs"
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for x in dummy $(INSTALL_PROGRAMS); \
|
2016-01-30 10:25:40 +08:00
|
|
|
do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$x`; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(bindir)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done;
|
2016-03-21 15:11:14 +08:00
|
|
|
@set -e; for x in dummy $(BIN_SCRIPTS); \
|
2016-01-30 10:25:40 +08:00
|
|
|
do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fn=`basename $$x`; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(bindir)/$$fn"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
done
|
2023-10-11 00:41:59 +08:00
|
|
|
-$(RMDIR) "$(DESTDIR)$(bindir)"
|
2018-10-25 15:09:20 +08:00
|
|
|
|
|
|
|
uninstall_runtime_libs:
|
|
|
|
@$(ECHO) "*** Uninstalling runtime libraries"
|
2016-07-15 03:13:24 +08:00
|
|
|
@ : {- output_off() unless windowsdll(); "" -}
|
2016-07-08 20:52:09 +08:00
|
|
|
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
|
2016-03-21 15:11:14 +08:00
|
|
|
if [ "$$s" = "dummy" ]; then continue; fi; \
|
2016-02-16 05:13:41 +08:00
|
|
|
fn=`basename $$s`; \
|
2021-08-31 03:24:39 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(bindir)/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(bindir)/$$fn"; \
|
2016-01-30 12:45:29 +08:00
|
|
|
done
|
2016-07-15 03:13:24 +08:00
|
|
|
@ : {- output_on() unless windowsdll(); "" -}
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
|
2016-09-01 04:57:25 +08:00
|
|
|
install_man_docs: build_man_docs
|
2016-01-30 10:25:40 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man1"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man3"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man5"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man7"
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "*** Installing manpages"
|
2016-09-01 04:57:25 +08:00
|
|
|
@set -e; for x in dummy $(MANDOCS1); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS3); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS5); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-05-18 00:40:56 +08:00
|
|
|
uninstall_man_docs: build_man_docs
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "*** Uninstalling manpages"
|
2016-09-01 04:57:25 +08:00
|
|
|
@set -e; for x in dummy $(MANDOCS1); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS3); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS5); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(MANDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
2020-04-26 02:29:48 +08:00
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
|
|
|
|
$(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-05-21 13:24:57 +08:00
|
|
|
install_html_docs: install_image_docs build_html_docs
|
2016-01-30 10:25:40 +08:00
|
|
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man1"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man3"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man5"
|
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7"
|
2017-06-29 23:40:19 +08:00
|
|
|
@$(ECHO) "*** Installing HTML manpages"
|
2016-09-01 04:57:25 +08:00
|
|
|
@set -e; for x in dummy $(HTMLDOCS1); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS3); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS5); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $$x "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-05-21 13:24:57 +08:00
|
|
|
uninstall_html_docs: uninstall_image_docs
|
2016-09-01 04:57:25 +08:00
|
|
|
@$(ECHO) "*** Uninstalling HTML manpages"
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS1); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS3); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS5); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
|
|
|
@set -e; for x in dummy $(HTMLDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
|
2016-09-01 04:57:25 +08:00
|
|
|
done
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-05-21 13:24:57 +08:00
|
|
|
install_image_docs:
|
2023-10-11 00:41:59 +08:00
|
|
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7/img"
|
2021-05-21 13:24:57 +08:00
|
|
|
@set -e; for x in dummy $(IMAGEDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
cp $(SRCDIR)/$$x "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
|
|
|
|
chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
|
2021-05-21 13:24:57 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
uninstall_image_docs:
|
|
|
|
@set -e; for x in dummy $(IMAGEDOCS7); do \
|
|
|
|
if [ "$$x" = "dummy" ]; then continue; fi; \
|
|
|
|
fn=`basename $$x`; \
|
|
|
|
$(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
|
2023-10-11 00:41:59 +08:00
|
|
|
$(RM) "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \
|
2021-05-21 13:24:57 +08:00
|
|
|
done
|
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
# Developer targets (note: these are only available on Unix) #########
|
2023-05-09 15:06:40 +08:00
|
|
|
##@ Code maintenance
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-02-22 13:49:24 +08:00
|
|
|
# It's important that generate_buildinfo comes after ordinals, as ordinals
|
|
|
|
# is sensitive to build.info changes.
|
2023-03-01 07:42:56 +08:00
|
|
|
update: generate errors ordinals generate_buildinfo ## Update errors, ordinals and build info
|
2016-02-12 03:00:57 +08:00
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
.PHONY: generate generate_apps generate_crypto_bn generate_crypto_objects \
|
|
|
|
generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
|
2016-05-01 21:09:20 +08:00
|
|
|
generate: generate_apps generate_crypto_bn generate_crypto_objects \
|
2017-11-01 03:06:39 +08:00
|
|
|
generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
.PHONY: generate_buildinfo generate_doc_buildinfo
|
2021-02-22 13:49:24 +08:00
|
|
|
generate_buildinfo: generate_doc_buildinfo
|
|
|
|
|
2021-05-18 17:18:26 +08:00
|
|
|
.PHONY: doc-nits md-nits
|
2023-03-01 07:42:56 +08:00
|
|
|
doc-nits: build_generated_pods ## Evaluate OpenSSL documentation
|
2021-05-18 17:18:26 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/find-doc-nits -c -n -l -e
|
Document most missing options
Add cmd-nits make target.
Listing options should stop when it hits the "parameters" separator.
Add missing .pod.in files to doc/man1/build.info
Tweak find-doc-nits to try openssl-XXX before XXX for POD files and
change an error messavge to be more useful.
Fix the following pages: ca, cms, crl, dgst, enc,
engine, errstr, gendsa, genrsa, list, ocsp, passwd, pkcs7, pkcs12, rand,
rehash, req, rsautil, s_server, speed, s_time,
sess_id, smime, srp, ts, x509.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10873)
2020-01-17 02:40:52 +08:00
|
|
|
|
2020-05-08 22:34:22 +08:00
|
|
|
# This uses "mdl", the markdownlint application, which is written in ruby.
|
|
|
|
# The source is at https://github.com/markdownlint/markdownlint
|
|
|
|
# If you have ruby installed, "gem install mdl" should work.
|
|
|
|
# Another option is at https://snapcraft.io/install/mdl/debian
|
|
|
|
# Finally, there's a Node.js version, which we haven't tried, that
|
|
|
|
# can be found at https://github.com/DavidAnson/markdownlint
|
2023-03-01 07:42:56 +08:00
|
|
|
md-nits: ## Evaluate markdown files via "mdl"
|
2023-10-02 16:24:38 +08:00
|
|
|
mdl -s $(SRCDIR)/util/markdownlint.rb .
|
2020-05-08 22:34:22 +08:00
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
# Test coverage is a good idea for the future
|
|
|
|
#coverage: $(PROGRAMS) $(TESTPROGRAMS)
|
|
|
|
# ...
|
|
|
|
|
2021-06-25 03:32:07 +08:00
|
|
|
.PHONY: lint
|
2023-03-01 07:42:56 +08:00
|
|
|
lint: ## Evaluate C code via "splint"
|
2021-06-25 03:32:07 +08:00
|
|
|
@( cd $(SRCDIR); \
|
|
|
|
echo splint -DLINT -posixlib -preproc -D__gnuc_va_list=void \
|
|
|
|
-I. -Iinclude -Iapps/include $(CRYPTOHEADERS) $(SSLHEADERS) $(SRCS) )
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2021-06-25 14:16:42 +08:00
|
|
|
.PHONY: check-format
|
2023-03-01 07:42:56 +08:00
|
|
|
check-format: ## Evaluate C code according to OpenSSL coding standards
|
2021-06-25 14:16:42 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) util/check-format.pl \
|
|
|
|
$(SRCS) \$(CRYPTOHEADERS) $(SSLHEADERS) )
|
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_apps:
|
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-20 03:04:51 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
|
|
|
|
< apps/openssl.cnf > apps/openssl-vms.cnf )
|
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_crypto_bn:
|
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-20 03:04:51 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
|
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_crypto_objects:
|
2018-02-28 04:14:18 +08: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-20 03:04:51 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
|
|
|
|
crypto/objects/objects.txt \
|
|
|
|
crypto/objects/obj_mac.num \
|
2022-09-08 23:17:06 +08:00
|
|
|
> include/openssl/obj_mac.h )
|
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
|
2016-04-24 08:01:25 +08:00
|
|
|
include/openssl/obj_mac.h \
|
2022-09-08 23:17:06 +08: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-20 03:04:51 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
|
|
|
|
crypto/objects/obj_mac.num \
|
|
|
|
crypto/objects/obj_xref.txt \
|
|
|
|
> crypto/objects/obj_xref.h )
|
2022-09-08 23:17:06 +08:00
|
|
|
( cd $(SRCDIR); sed -e '1,8d' crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
|
2016-02-12 03:00:57 +08:00
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_crypto_conf:
|
2016-05-01 21:09:20 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
|
|
|
|
> crypto/conf/conf_def.h )
|
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_crypto_asn1:
|
2016-05-01 21:09:20 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
|
|
|
|
> crypto/asn1/charmap.h )
|
|
|
|
|
2022-09-08 23:17:06 +08:00
|
|
|
generate_fuzz_oids:
|
2017-11-01 03:06:39 +08:00
|
|
|
( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
|
|
|
|
crypto/objects/obj_dat.h \
|
|
|
|
> fuzz/oids.txt )
|
|
|
|
|
2021-02-22 13:49:24 +08:00
|
|
|
generate_doc_buildinfo:
|
|
|
|
( $(PERL) -I$(BLDDIR) -Mconfigdata \
|
|
|
|
$(SRCDIR)/util/dofile.pl -o Makefile \
|
2021-02-25 07:06:46 +08:00
|
|
|
$(SRCDIR)/doc/build.info.in \
|
|
|
|
> $(SRCDIR)/doc/build.info.new; \
|
|
|
|
if ( test -e $(SRCDIR)/doc/build.info \
|
|
|
|
&& cmp $(SRCDIR)/doc/build.info.new $(SRCDIR)/doc/build.info \
|
|
|
|
> /dev/null ); \
|
|
|
|
then \
|
|
|
|
rm $(SRCDIR)/doc/build.info.new; \
|
|
|
|
else \
|
|
|
|
mv $(SRCDIR)/doc/build.info.new $(SRCDIR)/doc/build.info; \
|
|
|
|
fi )
|
2021-02-22 13:49:24 +08:00
|
|
|
|
2021-05-12 22:14:01 +08:00
|
|
|
generate_fips_sources: providers/fips.module.sources.new
|
2021-05-28 13:52:37 +08:00
|
|
|
providers/fips.module.sources.new: configdata.pm
|
2021-04-27 01:44:24 +08:00
|
|
|
rm -rf sources-tmp
|
|
|
|
mkdir sources-tmp
|
|
|
|
( \
|
|
|
|
srcdir=`cd $(SRCDIR); pwd`; \
|
|
|
|
cd sources-tmp \
|
2021-05-20 11:48:15 +08:00
|
|
|
&& $$srcdir/Configure --banner=Configured enable-fips -O0 \
|
2021-04-27 01:44:24 +08:00
|
|
|
&& ./configdata.pm --query 'get_sources("providers/fips")' > sources1 \
|
2024-02-21 21:47:19 +08:00
|
|
|
&& "$(MAKE)" -sj 4 build_generated providers/fips.so \
|
2021-05-28 13:54:04 +08:00
|
|
|
&& find . -name '*.d' | xargs cat > dep1 \
|
2024-02-21 21:47:19 +08:00
|
|
|
&& "$(MAKE)" distclean \
|
2021-05-20 11:48:15 +08:00
|
|
|
&& $$srcdir/Configure --banner=Configured enable-fips no-asm -O0 \
|
2021-04-27 01:44:24 +08:00
|
|
|
&& ./configdata.pm --query 'get_sources("providers/fips")' > sources2 \
|
2024-02-21 21:47:19 +08:00
|
|
|
&& "$(MAKE)" -sj 4 build_generated providers/fips.so \
|
2021-05-28 13:54:04 +08:00
|
|
|
&& find . -name '*.d' | xargs cat > dep2 \
|
2021-05-20 11:48:15 +08:00
|
|
|
&& cat sources1 sources2 \
|
|
|
|
| grep -v ' : \\$$' | grep -v util/providers.num \
|
2021-05-28 13:54:04 +08:00
|
|
|
| sed -e 's/^ *//' -e 's/ *\\$$//' \
|
2021-05-20 11:48:15 +08:00
|
|
|
| sort | uniq > sources \
|
2021-05-28 13:54:04 +08:00
|
|
|
&& cat dep1 dep2 \
|
|
|
|
| $(PERL) -p -e 's/\\\n//' \
|
|
|
|
| sed -e 's/^.*: *//' -e 's/ */ /g' \
|
|
|
|
| fgrep -f sources \
|
|
|
|
| tr ' ' '\n' \
|
|
|
|
| sort | uniq > deps.raw \
|
|
|
|
&& cat deps.raw \
|
|
|
|
| xargs ./configdata.pm --query 'get_sources(@ARGV)' \
|
|
|
|
| $(PERL) -p -e 's/\\\n//' \
|
|
|
|
| sed -e 's/\./\\\./g' -e 's/ : */:/' -e 's/^/s:/' -e 's/$$/:/' \
|
|
|
|
> deps.sed \
|
|
|
|
&& cat deps.raw | sed -f deps.sed > deps \
|
2021-04-27 01:44:24 +08:00
|
|
|
)
|
|
|
|
( \
|
2021-05-28 13:54:04 +08:00
|
|
|
cat sources-tmp/sources sources-tmp/deps \
|
|
|
|
| $(PERL) -p -e 's:^ *\Q../\E:: ;' \
|
|
|
|
-e 's:^\Q$(SRCDIR)/\E:: if "$(SRCDIR)" ne "." ;' \
|
|
|
|
-e 'my $$x; do { $$x = $$_; s:(^|/)((?!\Q../\E)[^/]*/)\Q..\E($$|/):$$1: } while ($$x ne $$_) ;' ; \
|
2021-04-27 01:44:24 +08:00
|
|
|
cd $(SRCDIR); \
|
|
|
|
for x in crypto/bn/asm/*.pl crypto/bn/asm/*.S \
|
|
|
|
crypto/aes/asm/*.pl crypto/aes/asm/*.S \
|
|
|
|
crypto/ec/asm/*.pl \
|
|
|
|
crypto/modes/asm/*.pl \
|
2021-05-20 11:48:15 +08:00
|
|
|
crypto/sha/asm/*.pl \
|
2023-05-12 18:55:24 +08:00
|
|
|
crypto/*cpuid.pl crypto/*cpuid.S \
|
|
|
|
crypto/*cap.c; do \
|
2021-04-27 01:44:24 +08:00
|
|
|
echo "$$x"; \
|
|
|
|
done \
|
2023-09-26 20:56:02 +08:00
|
|
|
) | grep -v sm2p256 | sort | uniq > providers/fips.module.sources.new
|
2021-04-27 01:44:24 +08:00
|
|
|
rm -rf sources-tmp
|
|
|
|
|
2017-06-08 03:12:03 +08:00
|
|
|
# Set to -force to force a rebuild
|
|
|
|
ERROR_REBUILD=
|
2016-01-30 10:25:40 +08:00
|
|
|
errors:
|
2018-06-12 14:56:21 +08:00
|
|
|
( b=`pwd`; set -e; cd $(SRCDIR); \
|
|
|
|
$(PERL) util/ck_errf.pl -strict -internal; \
|
2018-02-08 02:23:39 +08:00
|
|
|
$(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
|
2018-06-12 14:56:21 +08:00
|
|
|
( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
|
2017-06-08 03:12:03 +08:00
|
|
|
for E in *.ec ; do \
|
2018-06-12 14:56:21 +08:00
|
|
|
$(PERL) ../util/ck_errf.pl -strict \
|
|
|
|
-conf $$E `basename $$E .ec`.c; \
|
2018-02-08 02:23:39 +08:00
|
|
|
$(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
|
2017-06-08 03:12:03 +08:00
|
|
|
-conf $$E `basename $$E .ec`.c ; \
|
|
|
|
done )
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2018-09-14 21:28:39 +08:00
|
|
|
{- use File::Basename;
|
|
|
|
|
2020-09-04 14:51:37 +08:00
|
|
|
my @sslheaders_tmpl =
|
2018-09-14 21:28:39 +08:00
|
|
|
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
|
2020-11-12 16:19:24 +08:00
|
|
|
include/openssl/srtp.h
|
2022-05-12 21:41:51 +08:00
|
|
|
include/openssl/quic.h
|
2020-11-12 16:19:24 +08:00
|
|
|
include/openssl/sslerr_legacy.h );
|
2020-09-04 14:51:37 +08:00
|
|
|
my @cryptoheaders_tmpl =
|
2018-09-14 21:28:39 +08:00
|
|
|
qw( include/internal/dso.h
|
|
|
|
include/internal/o_dir.h
|
|
|
|
include/internal/err.h
|
2020-03-18 22:54:47 +08:00
|
|
|
include/internal/evp.h
|
2020-07-23 22:56:59 +08:00
|
|
|
include/internal/pem.h
|
|
|
|
include/internal/asn1.h
|
2018-09-14 21:28:39 +08:00
|
|
|
include/internal/sslconf.h );
|
2020-09-04 14:51:37 +08:00
|
|
|
my @cryptoskipheaders = ( @sslheaders_tmpl,
|
2021-06-25 03:33:42 +08:00
|
|
|
qw( include/openssl/asn1_mac.h
|
|
|
|
include/openssl/conf_api.h
|
2018-09-14 21:28:39 +08:00
|
|
|
include/openssl/ebcdic.h
|
|
|
|
include/openssl/opensslconf.h
|
|
|
|
include/openssl/symhacks.h ) );
|
2020-09-15 23:40:38 +08:00
|
|
|
our %cryptoheaders = ();
|
|
|
|
our %sslheaders = ();
|
2020-09-04 14:51:37 +08:00
|
|
|
foreach my $d ( qw( include/openssl include/internal ) ) {
|
|
|
|
my @header_patterns =
|
|
|
|
map { catfile($config{sourcedir}, $d, $_) } ( '*.h', '*.h.in' );
|
|
|
|
foreach my $f ( map { glob($_) } @header_patterns ) {
|
|
|
|
my $base = basename($f);
|
|
|
|
my $base_in = basename($f, '.in');
|
|
|
|
my $dir = catfile($config{sourcedir}, $d);
|
|
|
|
if ($base ne $base_in) {
|
|
|
|
# We have a .h.in file, which means the header file is in the
|
|
|
|
# build tree.
|
|
|
|
$base = $base_in;
|
|
|
|
$dir = catfile($config{builddir}, $d);
|
|
|
|
}
|
|
|
|
my $new_f = catfile($dir, $base);
|
|
|
|
my $fn = "$d/$base";
|
|
|
|
# The logic to add files to @cryptoheaders is a bit complex. The
|
|
|
|
# file to be added must be either in the public header directory
|
|
|
|
# or one of the pre-declared internal headers, and must under no
|
|
|
|
# circumstances be one of those that must be skipped.
|
2020-09-15 23:40:38 +08:00
|
|
|
$cryptoheaders{$new_f} = 1
|
2020-09-04 14:51:37 +08:00
|
|
|
if (($d eq 'include/openssl'
|
|
|
|
|| ( grep { $_ eq $fn } @cryptoheaders_tmpl ))
|
|
|
|
&& !( grep { $_ eq $fn } @cryptoskipheaders ));
|
|
|
|
# The logic to add files to @sslheaders is much simpler...
|
2020-09-15 23:40:38 +08:00
|
|
|
$sslheaders{$new_f} = 1 if grep { $_ eq $fn } @sslheaders_tmpl;
|
2020-09-04 14:51:37 +08:00
|
|
|
}
|
2018-09-14 21:28:39 +08:00
|
|
|
}
|
|
|
|
"";
|
|
|
|
-}
|
2021-06-25 14:25:12 +08:00
|
|
|
SRCS={-
|
|
|
|
sub uniq { my %seen; grep !$seen{$_}++, @_; }
|
|
|
|
sub flat(@) { return map { ref eq 'ARRAY' ? @$_ : $_ } @_; }
|
|
|
|
join(" \\\n" . ' ' x 5, fill_lines(" ", $COLUMNS - 5,
|
|
|
|
uniq(grep /\.(c|cc|cpp)$/,
|
|
|
|
flat (map { $unified_info{sources}->{$_} }
|
|
|
|
(sort keys %{$unified_info{sources}})))))
|
|
|
|
-}
|
2019-05-23 22:45:47 +08:00
|
|
|
CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
|
2020-09-15 23:40:38 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 14, sort keys %cryptoheaders)) -}
|
2019-05-23 22:45:47 +08:00
|
|
|
SSLHEADERS={- join(" \\\n" . ' ' x 11,
|
2020-09-15 23:40:38 +08:00
|
|
|
fill_lines(" ", $COLUMNS - 11, sort keys %sslheaders)) -}
|
2021-06-24 23:07:03 +08:00
|
|
|
|
|
|
|
renumber: build_generated
|
2021-09-08 15:40:37 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
|
2021-06-24 23:07:03 +08:00
|
|
|
--ordinals $(SRCDIR)/util/libcrypto.num \
|
|
|
|
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
|
|
|
|
--renumber \
|
|
|
|
$(CRYPTOHEADERS)
|
2021-09-08 15:40:37 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
|
2021-06-24 23:07:03 +08:00
|
|
|
--ordinals $(SRCDIR)/util/libssl.num \
|
|
|
|
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
|
|
|
|
--renumber \
|
|
|
|
$(SSLHEADERS)
|
|
|
|
|
2023-11-30 23:38:43 +08:00
|
|
|
.PHONY: ordinals
|
|
|
|
ordinals: build_generated
|
2021-09-08 15:40:37 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
|
2020-09-04 14:51:37 +08:00
|
|
|
--ordinals $(SRCDIR)/util/libcrypto.num \
|
|
|
|
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
|
|
|
|
$(CRYPTOHEADERS)
|
2021-09-08 15:40:37 +08:00
|
|
|
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
|
2020-09-04 14:51:37 +08:00
|
|
|
--ordinals $(SRCDIR)/util/libssl.num \
|
|
|
|
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
|
|
|
|
$(SSLHEADERS)
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
test_ordinals:
|
2024-02-21 21:47:19 +08:00
|
|
|
"$(MAKE)" run_tests TESTS=test_ordinals
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
tags TAGS: FORCE
|
|
|
|
rm -f TAGS tags
|
2023-05-30 10:22:53 +08:00
|
|
|
-( cd $(SRCDIR); util/ctags.sh )
|
2016-01-30 10:25:40 +08:00
|
|
|
-etags `find . -name '*.[ch]' -o -name '*.pm'`
|
|
|
|
|
2021-05-13 18:51:14 +08:00
|
|
|
providers/fips.checksum.new: providers/fips.module.sources.new
|
2021-05-11 22:07:35 +08:00
|
|
|
@which unifdef > /dev/null || \
|
|
|
|
( echo >&2 "ERROR: unifdef not in your \$$PATH, FIPS checksums not calculated"; \
|
|
|
|
false )
|
2021-05-12 22:14:01 +08:00
|
|
|
( sources=`pwd`/providers/fips.module.sources.new; \
|
2021-05-11 22:07:35 +08:00
|
|
|
cd $(SRCDIR) \
|
|
|
|
&& cat $$sources \
|
|
|
|
| xargs ./util/fips-checksums.sh ) \
|
2021-05-12 22:14:01 +08:00
|
|
|
> providers/fips-sources.checksums.new \
|
|
|
|
&& sha256sum providers/fips-sources.checksums.new \
|
2021-05-13 16:50:14 +08:00
|
|
|
| sed -e 's|\.new||' > providers/fips.checksum.new
|
|
|
|
|
|
|
|
fips-checksums: providers/fips.checksum.new
|
2021-05-11 22:07:35 +08:00
|
|
|
|
2021-05-12 22:14:01 +08:00
|
|
|
$(SRCDIR)/providers/fips.checksum: providers/fips.checksum.new
|
|
|
|
cp -p providers/fips.module.sources.new $(SRCDIR)/providers/fips.module.sources
|
|
|
|
cp -p providers/fips-sources.checksums.new $(SRCDIR)/providers/fips-sources.checksums
|
|
|
|
cp -p providers/fips.checksum.new $(SRCDIR)/providers/fips.checksum
|
2021-05-11 22:07:35 +08:00
|
|
|
|
|
|
|
update-fips-checksums: $(SRCDIR)/providers/fips.checksum
|
2019-05-03 19:12:59 +08:00
|
|
|
|
2021-05-11 22:20:51 +08:00
|
|
|
diff-fips-checksums: fips-checksums
|
2021-05-12 22:14:01 +08:00
|
|
|
diff -u $(SRCDIR)/providers/fips.module.sources providers/fips.module.sources.new
|
|
|
|
diff -u $(SRCDIR)/providers/fips-sources.checksums providers/fips-sources.checksums.new
|
|
|
|
diff -u $(SRCDIR)/providers/fips.checksum providers/fips.checksum.new
|
2021-05-11 22:20:51 +08:00
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
# Release targets (note: only available on Unix) #####################
|
|
|
|
|
|
|
|
tar:
|
2018-11-24 18:27:50 +08:00
|
|
|
(cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)')
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
# Helper targets #####################################################
|
|
|
|
|
2021-06-16 16:32:43 +08:00
|
|
|
link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/apps/openssl.cnf
|
2016-01-30 10:25:40 +08:00
|
|
|
|
2022-02-23 18:00:39 +08:00
|
|
|
$(BLDDIR)/util/opensslwrap.sh: Makefile
|
2016-01-30 10:25:40 +08:00
|
|
|
@if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
|
|
|
|
mkdir -p "$(BLDDIR)/util"; \
|
2020-02-17 22:20:57 +08:00
|
|
|
ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \
|
2016-01-30 10:25:40 +08:00
|
|
|
fi
|
2016-09-08 02:56:20 +08:00
|
|
|
|
2022-02-23 18:00:39 +08:00
|
|
|
$(BLDDIR)/apps/openssl.cnf: Makefile
|
2021-02-09 07:16:55 +08:00
|
|
|
@if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
|
|
|
|
mkdir -p "$(BLDDIR)/apps"; \
|
|
|
|
ln -sf "../$(SRCDIR)/apps/`basename "$@"`" "$(BLDDIR)/apps"; \
|
|
|
|
fi
|
|
|
|
|
2016-02-19 02:41:57 +08:00
|
|
|
FORCE:
|
2016-01-30 10:25:40 +08:00
|
|
|
|
|
|
|
# Building targets ###################################################
|
|
|
|
|
2022-02-23 18:00:39 +08:00
|
|
|
Makefile: configdata.pm \
|
|
|
|
{- join(" \\\n" . ' ' x 10,
|
|
|
|
fill_lines(" ", $COLUMNS - 10,
|
|
|
|
@{$config{build_file_templates}})) -}
|
|
|
|
@echo "Detected changed: $?"
|
|
|
|
$(PERL) configdata.pm
|
|
|
|
@echo "**************************************************"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "*** Please run the same make command again ***"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "**************************************************"
|
|
|
|
@false
|
|
|
|
|
2019-05-23 22:45:47 +08:00
|
|
|
configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \
|
|
|
|
{- join(" \\\n" . ' ' x 15,
|
|
|
|
fill_lines(" ", $COLUMNS - 15,
|
|
|
|
@{$config{build_infos}},
|
|
|
|
@{$config{conf_files}})) -}
|
2016-02-19 09:30:51 +08:00
|
|
|
@echo "Detected changed: $?"
|
2018-02-03 03:33:13 +08:00
|
|
|
$(PERL) configdata.pm -r
|
2016-01-30 10:25:40 +08:00
|
|
|
@echo "**************************************************"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "*** Please run the same make command again ***"
|
|
|
|
@echo "*** ***"
|
|
|
|
@echo "**************************************************"
|
|
|
|
@false
|
|
|
|
|
2018-01-30 06:17:43 +08:00
|
|
|
reconfigure reconf:
|
2018-02-03 03:33:13 +08:00
|
|
|
$(PERL) configdata.pm -r
|
2018-01-30 06:17:43 +08:00
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
{-
|
|
|
|
use File::Basename;
|
|
|
|
use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
|
2016-02-11 20:10:11 +08:00
|
|
|
|
2021-05-24 20:19:38 +08:00
|
|
|
# Helper function to convert dependencies in platform agnostic form to
|
|
|
|
# dependencies in platform form.
|
|
|
|
sub compute_platform_depends {
|
|
|
|
map { my $x = $_;
|
|
|
|
|
|
|
|
grep { $x eq $_ } @{$unified_info{programs}} and platform->bin($x)
|
|
|
|
or grep { $x eq $_ } @{$unified_info{modules}} and platform->dso($x)
|
|
|
|
or grep { $x eq $_ } @{$unified_info{libraries}} and platform->lib($x)
|
|
|
|
or platform->convertext($x); } @_;
|
|
|
|
}
|
|
|
|
|
2016-02-11 20:10:11 +08: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
|
2021-01-15 19:20:25 +08:00
|
|
|
return map { platform->sharedlib_simple($_)
|
|
|
|
// platform->sharedlib_import($_)
|
2021-07-09 01:05:34 +08:00
|
|
|
// platform->sharedlib($_)
|
2021-01-15 19:20:25 +08:00
|
|
|
// platform->staticlib($_)
|
|
|
|
} @_;
|
2016-02-11 20:10:11 +08:00
|
|
|
}
|
|
|
|
|
2021-02-25 23:55:39 +08:00
|
|
|
sub generatetarget {
|
|
|
|
my %args = @_;
|
2021-05-24 20:19:38 +08:00
|
|
|
my $deps = join(" ", compute_platform_depends(@{$args{deps}}));
|
2021-02-25 23:55:39 +08:00
|
|
|
return <<"EOF";
|
|
|
|
$args{target}: $deps
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2016-03-07 21:38:54 +08:00
|
|
|
sub generatesrc {
|
|
|
|
my %args = @_;
|
2021-02-26 00:43:57 +08:00
|
|
|
my $gen0 = $args{generator}->[0];
|
|
|
|
my $gen_args = join('', map { " $_" }
|
|
|
|
@{$args{generator}}[1..$#{$args{generator}}]);
|
|
|
|
my $gen_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
|
2016-03-10 16:04:09 +08:00
|
|
|
my $incs = join("", map { " -I".$_ } @{$args{incs}});
|
2016-10-14 23:09:52 +08:00
|
|
|
my $defs = join("", map { " -D".$_ } @{$args{defs}});
|
2021-05-24 20:19:38 +08:00
|
|
|
my $deps = join(" ", compute_platform_depends(@{$args{generator_deps}},
|
|
|
|
@{$args{deps}}));
|
2016-03-07 21:38:54 +08:00
|
|
|
|
2016-09-01 04:57:25 +08:00
|
|
|
if ($args{src} =~ /\.html$/) {
|
2021-02-26 00:43:57 +08:00
|
|
|
#
|
|
|
|
# HTML generator
|
|
|
|
#
|
|
|
|
my $title = basename($args{src}, ".html");
|
|
|
|
my $pod = $gen0;
|
|
|
|
return <<"EOF";
|
2020-01-15 15:28:46 +08:00
|
|
|
$args{src}: $pod
|
2020-01-16 03:53:29 +08:00
|
|
|
\$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
|
2016-09-01 04:57:25 +08:00
|
|
|
EOF
|
|
|
|
} elsif ($args{src} =~ /\.(\d)$/) {
|
2021-02-26 00:43:57 +08:00
|
|
|
#
|
|
|
|
# Man-page generator
|
|
|
|
#
|
|
|
|
my $section = $1;
|
|
|
|
my $name = uc basename($args{src}, ".$section");
|
|
|
|
my $pod = $gen0;
|
|
|
|
return <<"EOF";
|
2020-01-15 15:28:46 +08:00
|
|
|
$args{src}: $pod
|
2021-04-13 00:04:43 +08:00
|
|
|
pod2man --name=$name --section=$section\$(MANSUFFIX) --center=OpenSSL \\
|
2020-01-16 03:53:29 +08:00
|
|
|
--release=\$(VERSION) $pod >\$\@
|
2016-09-01 04:57:25 +08:00
|
|
|
EOF
|
|
|
|
} elsif (platform->isdef($args{src})) {
|
2021-02-26 00:43:57 +08:00
|
|
|
#
|
|
|
|
# Linker script-ish generator
|
|
|
|
#
|
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
|
|
|
my $target = platform->def($args{src});
|
2018-09-30 20:44:59 +08:00
|
|
|
(my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
|
2021-09-08 15:40:37 +08:00
|
|
|
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION_NUMBER)' : '';
|
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
|
|
|
my $ord_name = $args{generator}->[1] || $args{product};
|
2018-09-30 20:44:59 +08:00
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$target: $gen0 $deps \$(SRCDIR)/util/mkdef.pl
|
2022-05-10 20:39:19 +08:00
|
|
|
\$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name --OS $mkdef_os > $target
|
2016-06-14 04:02:11 +08:00
|
|
|
EOF
|
2022-11-03 22:24:52 +08:00
|
|
|
} elsif (platform->isasm($args{src})
|
|
|
|
|| platform->iscppasm($args{src})) {
|
2021-02-26 00:43:57 +08:00
|
|
|
#
|
|
|
|
# Assembler generator
|
|
|
|
#
|
2019-09-13 05:58:07 +08:00
|
|
|
my $cppflags = {
|
|
|
|
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
|
|
|
|
2021-02-26 00:43:57 +08:00
|
|
|
my $generator;
|
|
|
|
if ($gen0 =~ /\.pl$/) {
|
|
|
|
$generator = 'CC="$(CC)" $(PERL)'.$gen_incs.' '.$gen0.$gen_args
|
2020-04-27 14:11:52 +08:00
|
|
|
.' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
|
2021-02-26 00:43:57 +08:00
|
|
|
} elsif ($gen0 =~ /\.m4$/) {
|
|
|
|
$generator = 'm4 -B 8192'.$gen_incs.' '.$gen0.$gen_args.' >'
|
|
|
|
} elsif ($gen0 =~ /\.S$/) {
|
2016-03-09 02:19:53 +08:00
|
|
|
$generator = undef;
|
|
|
|
} else {
|
2021-02-26 00:43:57 +08:00
|
|
|
die "Generator type for $args{src} unknown: $gen0\n";
|
2016-03-09 02:19:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (defined($generator)) {
|
2016-03-07 21:38:54 +08:00
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$args{src}: $gen0 $deps
|
2016-03-09 02:19:53 +08:00
|
|
|
$generator \$@
|
2016-03-07 21:38:54 +08:00
|
|
|
EOF
|
|
|
|
}
|
2016-03-09 02:19:53 +08:00
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$args{src}: $gen0 $deps
|
|
|
|
\$(CC) $incs $cppflags $defs -E $gen0 | \\
|
2016-05-03 05:38:11 +08:00
|
|
|
\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
|
2021-02-26 00:43:57 +08:00
|
|
|
EOF
|
|
|
|
} elsif ($gen0 =~ m|^.*\.in$|) {
|
|
|
|
#
|
|
|
|
# "dofile" generator (file.in -> file)
|
|
|
|
#
|
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
build.info: Introduce special syntax for dependencies on script modules
The DEPEND statement, when applied on files generated with GENERATE, may
be used to specify script modules that the template to be generated from
depends on. In short, this sort of depend:
DEPEND[generated]=util/perl/OpenSSL/something.pm
... would generate a perl run that has the inclusion directory
'util/perl/OpenSSL' and 'something' as the module to be loaded. However,
the package name for this module is 'OpenSSL::something', so to load it the
way it's expected, the inclusion directory should be 'util/perl', and the
module to be loaded should be specified as 'OpenSSL/something' (to be
massaged into a proper module name by the build file template).
To allow this, we introduce a file syntax, where a single '|' is used as a
directory separator, to delineate what part should be used as the inclustion
directory, and which part the module name to be loaded should be derived
from:
DEPEND[generated]=util/perl|OpenSSL/something.pm
Fixes #21112
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21117)
2023-06-02 20:32:07 +08:00
|
|
|
my @perlmodules = ();
|
|
|
|
my %perlmoduleincs = ();
|
|
|
|
my %perlmoduledeps = ();
|
|
|
|
foreach my $x (('configdata.pm', @{$args{deps}})) {
|
|
|
|
# Compute (i)nclusion directory, (m)odule name and (d)ependency
|
|
|
|
my $i, $m, $d;
|
|
|
|
if ($x =~ /\|/) {
|
|
|
|
$i = $`;
|
|
|
|
$d = $';
|
|
|
|
|
|
|
|
# Massage the module part to become a real perl module spec
|
|
|
|
$m = $d;
|
|
|
|
$m =~ s|\.pm$||;
|
|
|
|
# Directory specs are :: in perl package names
|
|
|
|
$m =~ s|/|::|g;
|
|
|
|
|
|
|
|
# Full file name of the dependency
|
|
|
|
$d = catfile($i, $d) if $i;
|
|
|
|
} elsif ($x =~ /\.pm$/) {
|
|
|
|
$i = dirname($x);
|
|
|
|
$m = basename($x, '.pm');
|
|
|
|
$d = $x;
|
|
|
|
} else {
|
|
|
|
# All other dependencies are simply collected
|
|
|
|
$d = $x;
|
|
|
|
}
|
|
|
|
push @perlmodules, '"-M'.$m.'"' if $m;
|
|
|
|
$perlmoduledeps{$d} = 1;
|
|
|
|
$perlmoduleincs{'"-I'.$i.'"'} = 1 if $i;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Because of the special treatment of dependencies, we need to
|
|
|
|
# recompute $deps completely
|
|
|
|
my $deps
|
|
|
|
= join(" ", compute_platform_depends(@{$args{generator_deps}},
|
|
|
|
sort keys %perlmoduledeps));
|
|
|
|
my $perlmodules = join(' ', '', ( sort keys %perlmoduleincs ), @perlmodules);
|
|
|
|
|
2021-02-26 00:43:57 +08:00
|
|
|
return <<"EOF";
|
|
|
|
$args{src}: $gen0 $deps
|
2021-05-24 20:19:38 +08:00
|
|
|
\$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args > \$@
|
2021-02-26 00:43:57 +08:00
|
|
|
EOF
|
|
|
|
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
|
|
|
#
|
|
|
|
# Generic generator using OpenSSL programs
|
|
|
|
#
|
|
|
|
|
2021-05-24 20:19:38 +08:00
|
|
|
# Redo $gen0, to ensure that we have the proper extension where
|
2021-02-26 00:43:57 +08:00
|
|
|
# necessary.
|
|
|
|
$gen0 = platform->bin($gen0);
|
2021-03-19 06:45:28 +08:00
|
|
|
# Use $(PERL) to execute wrap.pl directly to avoid calling env
|
2021-02-26 00:43:57 +08:00
|
|
|
return <<"EOF";
|
|
|
|
$args{src}: $gen0 $deps \$(BLDDIR)/util/wrap.pl
|
2021-03-19 06:45:28 +08:00
|
|
|
\$(PERL) \$(BLDDIR)/util/wrap.pl $gen0$gen_args > \$@
|
2021-02-26 00:43:57 +08:00
|
|
|
EOF
|
|
|
|
} else {
|
|
|
|
#
|
|
|
|
# Generic generator using Perl
|
|
|
|
#
|
|
|
|
return <<"EOF";
|
|
|
|
$args{src}: $gen0 $deps
|
|
|
|
\$(PERL)$gen_incs $gen0$gen_args > \$@
|
2016-03-09 02:19:53 +08:00
|
|
|
EOF
|
2016-03-07 21:38:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-11 20:25:48 +08: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 20:04:05 +08:00
|
|
|
sub src2obj {
|
2016-01-30 10:25:40 +08:00
|
|
|
my %args = @_;
|
2019-10-04 06:08:01 +08:00
|
|
|
my $obj = platform->convertext($args{obj});
|
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
|
|
|
my $dep = platform->dep($args{obj});
|
2018-03-09 20:57:38 +08:00
|
|
|
my @srcs = @{$args{srcs}};
|
2016-03-09 02:19:53 +08:00
|
|
|
my $srcs = join(" ", @srcs);
|
|
|
|
my $deps = join(" ", @srcs, @{$args{deps}});
|
2016-02-20 05:02:41 +08:00
|
|
|
my $incs = join("", map { " -I".$_ } @{$args{incs}});
|
2016-10-14 23:09:52 +08: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-14 03:32:42 +08:00
|
|
|
my $cmd;
|
|
|
|
my $cmdflags;
|
|
|
|
my $cmdcompile;
|
2017-12-04 21:27:58 +08:00
|
|
|
if (grep /\.rc$/, @srcs) {
|
|
|
|
$cmd = '$(RC)';
|
|
|
|
$cmdflags = '$(RCFLAGS)';
|
2018-01-23 20:54:55 +08:00
|
|
|
$cmdcompile = '';
|
2017-12-04 21:27:58 +08: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-14 03:32:42 +08:00
|
|
|
$cmdcompile = ' -c';
|
|
|
|
$cmdflags = {
|
2018-09-10 08:28:39 +08: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-14 03:32:42 +08:00
|
|
|
lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-10-12 21:30:43 +08: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-14 03:32:42 +08:00
|
|
|
$cmd = '$(CC)';
|
|
|
|
$cmdcompile = ' -c';
|
|
|
|
$cmdflags = {
|
2018-09-10 08:28:39 +08: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-14 03:32:42 +08:00
|
|
|
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-10-12 21:30:43 +08:00
|
|
|
}
|
2018-03-09 20:57:38 +08: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 21:09:57 +08:00
|
|
|
$obj: $deps
|
2018-03-09 20:57:38 +08:00
|
|
|
$cmd $cmdflags -c -o \$\@ $srcs
|
2016-09-04 14:10:22 +08:00
|
|
|
EOF
|
2018-03-09 20:57:38 +08:00
|
|
|
} elsif (grep /\.S$/, @srcs) {
|
2018-05-06 23:50:23 +08:00
|
|
|
# Originally there was multi-step rule with $(CC) -E file.S
|
2018-04-11 16:11:07 +08:00
|
|
|
# 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 08:17:27 +08: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 21:09:57 +08:00
|
|
|
$obj: $deps
|
2016-10-14 23:09:52 +08:00
|
|
|
$cmd $incs $defs $cmdflags -c -o \$\@ $srcs
|
2018-03-09 20:57:38 +08:00
|
|
|
EOF
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
} elsif ($makedep_scheme eq 'gcc' && !grep /\.rc$/, @srcs) {
|
2018-03-09 20:57:38 +08: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 21:09:57 +08: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 16:05:20 +08: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 21:09:57 +08:00
|
|
|
mv $dep.tmp $dep; \\
|
2016-03-11 16:26:49 +08:00
|
|
|
fi
|
2016-03-09 08:17:27 +08:00
|
|
|
EOF
|
2016-09-04 14:10:22 +08:00
|
|
|
} else {
|
2016-03-09 08:17:27 +08: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 21:09:57 +08:00
|
|
|
$obj: $deps
|
2016-10-14 23:09:52 +08:00
|
|
|
$cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
|
2016-01-30 10:25:40 +08:00
|
|
|
EOF
|
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the
build file templates, with a bit of an exception for Unix family
platforms, where we had different cases depending on what dependency
making program was found.
With the Embarcadero C++ builder, a separate scheme appeared, with a
different logic.
This change merges the two, and introduces two config target
attributes:
makedepcmd The program to use, where this is relevant.
This replaces the earlier configuration
attribute 'makedepprog'.
makedep_scheme This is a keyword that can be used by build
files templates to produce different sorts of
commands, but most importantly, to pass as
argument to util/add-depend.pl, which uses
this keyword as a "producer" for the
dependency lines.
If the config target doesn't define the 'makedep_scheme' attribute,
Configure tries to figure it out by looking for GCC compatible
compilers or for the 'makedepend' command.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/15006)
2021-04-26 15:17:05 +08:00
|
|
|
if ($makedep_scheme eq 'makedepend') {
|
2016-09-04 14:10:22 +08:00
|
|
|
$recipe .= <<"EOF";
|
2018-03-16 01:06:18 +08: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 21:09:57 +08:00
|
|
|
> $dep
|
2016-01-30 10:25:40 +08:00
|
|
|
EOF
|
2016-09-04 14:10:22 +08:00
|
|
|
}
|
2016-03-09 08:17:27 +08:00
|
|
|
}
|
|
|
|
return $recipe;
|
2016-01-30 10:25:40 +08:00
|
|
|
}
|
2018-10-21 17:03:02 +08:00
|
|
|
# We *know* this routine is only called when we've configure 'shared'.
|
2018-09-12 16:59:06 +08:00
|
|
|
sub obj2shlib {
|
2016-01-30 10:25:40 +08:00
|
|
|
my %args = @_;
|
2018-01-08 19:28:08 +08:00
|
|
|
my @linkdirs = ();
|
2019-10-04 06:08:01 +08:00
|
|
|
my @linklibs = ();
|
|
|
|
foreach (@{$args{deps}}) {
|
|
|
|
if (platform->isstaticlib($_)) {
|
|
|
|
push @linklibs, platform->convertext($_);
|
|
|
|
} else {
|
|
|
|
my $d = "-L" . dirname($_);
|
|
|
|
my $l = basename($_);
|
|
|
|
$l =~ s/^lib//;
|
|
|
|
$l = "-l" . $l;
|
|
|
|
push @linklibs, $l;
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
2018-01-08 19:28:08 +08:00
|
|
|
}
|
2019-10-04 06:08:01 +08:00
|
|
|
my $linkflags = join("", map { $_." " } @linkdirs);
|
|
|
|
my $linklibs = join("", map { $_." " } @linklibs);
|
|
|
|
my @objs = map { platform->convertext($_) }
|
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
|
|
|
grep { !platform->isdef($_) }
|
2018-09-30 20:44:59 +08: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 21:09:57 +08:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2017-12-04 21:27:58 +08:00
|
|
|
@{$args{objs}};
|
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
die "More than one exported symbol map" if scalar @defs > 1;
|
2019-05-23 22:45:47 +08: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 21:09:57 +08:00
|
|
|
my $full = platform->sharedlib($args{lib});
|
2021-01-15 19:20:25 +08:00
|
|
|
# $import is for Windows and subsystems thereof, where static import
|
|
|
|
# libraries for DLLs are a thing. On platforms that have this mechanism,
|
|
|
|
# $import has the name of this import library. On platforms that don't
|
|
|
|
# have this mechanism, $import will be |undef|.
|
2023-07-21 22:31:34 +08:00
|
|
|
# It's also used on AIX in solib mode, which creates import libraries
|
|
|
|
# for the shared libraries.
|
2021-01-15 19:20:25 +08:00
|
|
|
my $import = platform->sharedlib_import($args{lib});
|
|
|
|
# $simple is for platforms where full shared library names include the
|
|
|
|
# shared library version, and there's a simpler name that doesn't include
|
|
|
|
# that version. On such platforms, $simple has the simpler name. On
|
|
|
|
# other platforms, it will be |undef|.
|
|
|
|
my $simple = platform->sharedlib_simple($args{lib});
|
|
|
|
|
2020-09-23 18:54:56 +08:00
|
|
|
my $argfile = defined $target{shared_argfileflag} ? $full.".args" : undef;
|
2017-12-04 21:27:58 +08:00
|
|
|
my $shared_soname = "";
|
2018-10-21 17:03:02 +08:00
|
|
|
$shared_soname .= ' '.$target{shared_sonameflag}.basename($full)
|
2017-12-04 21:27:58 +08:00
|
|
|
if defined $target{shared_sonameflag};
|
|
|
|
my $shared_imp = "";
|
2021-01-15 19:20:25 +08:00
|
|
|
$shared_imp .= ' '.$target{shared_impflag}.basename($import)
|
|
|
|
if defined $target{shared_impflag} && defined $import;
|
2017-12-04 21:27:58 +08:00
|
|
|
my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
|
2019-05-23 22:45:47 +08:00
|
|
|
|
2020-09-23 18:54:56 +08:00
|
|
|
# There is at least one platform where the compiler-as-linker needs to
|
|
|
|
# have one object file directly on the command line. That won't hurt
|
|
|
|
# any other platform, so we do that for everyone when there's an argfile
|
|
|
|
# to be had. This depends heavily on splice, which removes elements from
|
|
|
|
# the given array, and returns them so they can be captured.
|
|
|
|
my @argfileobjs = $argfile
|
|
|
|
? splice(@objs, 1)
|
|
|
|
: ();
|
|
|
|
my $argfilecmds = $argfile
|
|
|
|
? join("\n\t", map { "echo $_ >> $argfile" } @argfileobjs)
|
|
|
|
: undef;
|
|
|
|
my $argfiledeps = $argfile
|
|
|
|
? join(" \\\n" . ' ' x (length($argfile) + 2),
|
|
|
|
fill_lines(' ', $COLUMNS - length($full) - 2, @argfileobjs))
|
|
|
|
: undef;
|
|
|
|
my @fulldeps = (@objs, ($argfile ? $argfile : ()), @defs, @deps);
|
|
|
|
my @fullobjs = (
|
|
|
|
@objs,
|
|
|
|
($argfile ? $target{shared_argfileflag}.$argfile : ())
|
|
|
|
);
|
|
|
|
my $fulldeps =
|
|
|
|
join(" \\\n" . ' ' x (length($full) + 2),
|
|
|
|
fill_lines(' ', $COLUMNS - length($full) - 2, @fulldeps));
|
|
|
|
my $fullobjs =
|
|
|
|
join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @fullobjs));
|
2019-05-23 22:45:47 +08:00
|
|
|
|
2020-09-23 23:59:39 +08:00
|
|
|
my $recipe = '';
|
|
|
|
|
2021-03-29 18:23:40 +08:00
|
|
|
if (defined $simple && $simple ne $full) {
|
2020-09-23 23:59:39 +08:00
|
|
|
if (sharedaix()) {
|
|
|
|
$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 21:09:57 +08:00
|
|
|
$simple: $full
|
|
|
|
rm -f $simple && \\
|
|
|
|
\$(AR) r $simple $full
|
2018-06-14 17:45:15 +08:00
|
|
|
EOF
|
2020-09-23 23:59:39 +08:00
|
|
|
} else {
|
|
|
|
$recipe .= <<"EOF";
|
|
|
|
$simple: $full
|
2018-10-21 17:03:02 +08: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 21:09:57 +08:00
|
|
|
ln -s $full $simple
|
2017-12-04 21:27:58 +08:00
|
|
|
EOF
|
2020-09-23 23:59:39 +08: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 21:09:57 +08:00
|
|
|
}
|
2021-01-15 19:20:25 +08:00
|
|
|
if (defined $import) {
|
2023-07-21 22:31:34 +08:00
|
|
|
if (sharedaix_solib()) {
|
|
|
|
$recipe .= <<"EOF";
|
|
|
|
$import: $full $defs[0]
|
|
|
|
rm -f $import && \\
|
|
|
|
echo \\#!$full > $import && \\
|
|
|
|
cat $defs[0] >>$import
|
|
|
|
EOF
|
|
|
|
} else {
|
2021-01-15 19:20:25 +08:00
|
|
|
$recipe .= <<"EOF";
|
|
|
|
$import: $full
|
|
|
|
EOF
|
2023-07-21 22:31:34 +08:00
|
|
|
}
|
2021-01-15 19:20:25 +08: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 21:09:57 +08:00
|
|
|
$recipe .= <<"EOF";
|
2020-09-23 18:54:56 +08:00
|
|
|
$full: $fulldeps
|
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
|
|
|
\$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
|
2019-05-23 22:45:47 +08:00
|
|
|
-o $full$shared_def \\
|
2020-09-23 18:54:56 +08:00
|
|
|
$fullobjs \\
|
2019-05-23 22:45:47 +08:00
|
|
|
$linklibs \$(LIB_EX_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 21:09:57 +08:00
|
|
|
EOF
|
|
|
|
if (windowsdll()) {
|
2017-12-04 21:27:58 +08: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 21:09:57 +08:00
|
|
|
rm -f apps/$full
|
|
|
|
rm -f fuzz/$full
|
|
|
|
cp -p $full apps/
|
|
|
|
cp -p $full fuzz/
|
2016-01-30 10:25:40 +08:00
|
|
|
EOF
|
2021-02-19 23:57:01 +08:00
|
|
|
if (!$disabled{tests}) {
|
|
|
|
$recipe .= <<"EOF";
|
|
|
|
rm -f test/$full
|
|
|
|
cp -p $full test/
|
|
|
|
EOF
|
|
|
|
}
|
2017-12-04 21:27:58 +08:00
|
|
|
}
|
2020-09-23 18:54:56 +08:00
|
|
|
$recipe .= <<"EOF" if defined $argfile;
|
|
|
|
$argfile: $argfiledeps
|
|
|
|
\$(RM) $argfile
|
|
|
|
$argfilecmds
|
|
|
|
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 21:09:57 +08:00
|
|
|
return $recipe;
|
2016-01-30 10:25:40 +08:00
|
|
|
}
|
2016-02-16 01:45:54 +08:00
|
|
|
sub obj2dso {
|
2016-01-30 10:25:40 +08:00
|
|
|
my %args = @_;
|
2019-10-04 05:30:58 +08:00
|
|
|
my $dso = platform->dso($args{module});
|
2018-01-08 19:28:08 +08:00
|
|
|
my @linkdirs = ();
|
2019-10-04 06:08:01 +08:00
|
|
|
my @linklibs = ();
|
|
|
|
foreach (@{$args{deps}}) {
|
|
|
|
next unless defined $_;
|
|
|
|
if (platform->isstaticlib($_)) {
|
|
|
|
push @linklibs, platform->convertext($_);
|
|
|
|
} else {
|
|
|
|
my $d = "-L" . dirname($_);
|
|
|
|
my $l = basename($_);
|
|
|
|
$l =~ s/^lib//;
|
|
|
|
$l = "-l" . $l;
|
|
|
|
push @linklibs, $l;
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
2018-01-08 19:28:08 +08:00
|
|
|
}
|
2019-10-04 06:08:01 +08:00
|
|
|
my $linkflags = join("", map { $_." " } @linkdirs);
|
|
|
|
my $linklibs = join("", map { $_." " } @linklibs);
|
|
|
|
my @objs = map { platform->convertext($_) }
|
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
|
|
|
grep { !platform->isdef($_) }
|
2018-03-23 05:15:04 +08: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 21:09:57 +08:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-10-04 23:41:12 +08:00
|
|
|
@{$args{objs}};
|
2017-12-04 21:27:58 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
2018-10-04 23:41:12 +08:00
|
|
|
my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
|
2021-04-15 23:16:59 +08:00
|
|
|
# Next line needs to become "less magic" (see PR #11950)
|
2021-06-07 09:33:28 +08:00
|
|
|
$shared_def .= ' '.$target{shared_fipsflag} if (defined $target{shared_fipsflag} && $shared_def =~ m/providers\/fips/);
|
2019-05-23 22:45:47 +08:00
|
|
|
my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
|
|
|
|
my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
|
|
|
|
fill_lines(' ', $COLUMNS - length($dso) - 2,
|
|
|
|
@objs, @defs, @deps));
|
|
|
|
|
2016-01-30 10:25:40 +08: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 21:09:57 +08: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-14 03:32:42 +08:00
|
|
|
\$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
|
2019-05-23 22:45:47 +08:00
|
|
|
-o $dso$shared_def \\
|
|
|
|
$objs \\
|
|
|
|
$linklibs\$(DSO_EX_LIBS)
|
2016-01-30 10:25:40 +08: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 21:09:57 +08:00
|
|
|
my $lib = platform->staticlib($args{lib});
|
|
|
|
my @objs = map { platform->obj($_) } @{$args{objs}};
|
2020-08-24 00:33:57 +08:00
|
|
|
my $deps = join(" \\\n" . ' ' x (length($lib) + 2),
|
2019-05-23 22:45:47 +08:00
|
|
|
fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
|
2020-09-09 05:05:13 +08:00
|
|
|
my $max_per_call = 500;
|
2020-08-24 00:33:57 +08:00
|
|
|
my @objs_grouped;
|
|
|
|
push @objs_grouped, join(" ", splice @objs, 0, $max_per_call) while @objs;
|
|
|
|
my $fill_lib =
|
|
|
|
join("\n\t", (map { "\$(AR) \$(ARFLAGS) $lib $_" } @objs_grouped));
|
2016-01-30 10:25:40 +08:00
|
|
|
return <<"EOF";
|
2020-08-24 00:33:57 +08:00
|
|
|
$lib: $deps
|
2020-09-09 05:05:13 +08:00
|
|
|
\$(RM) $lib
|
2020-08-24 00:33:57 +08:00
|
|
|
$fill_lib
|
2016-01-30 10:25:40 +08: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 21:09:57 +08:00
|
|
|
my $bin = platform->bin($args{bin});
|
2019-05-23 22:45:47 +08:00
|
|
|
my @objs = map { platform->obj($_) } @{$args{objs}};
|
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
my $objs = join(" \\\n" . ' ' x (length($bin) + 2),
|
|
|
|
fill_lines(' ', $COLUMNS - length($bin) - 2, @objs));
|
2018-01-08 19:28:08 +08:00
|
|
|
my @linkdirs = ();
|
2019-10-04 06:08:01 +08:00
|
|
|
my @linklibs = ();
|
|
|
|
foreach (@{$args{deps}}) {
|
|
|
|
next unless defined $_;
|
|
|
|
if (platform->isstaticlib($_)) {
|
|
|
|
push @linklibs, platform->convertext($_);
|
|
|
|
} else {
|
|
|
|
my $d = "-L" . dirname($_);
|
|
|
|
my $l = basename($_);
|
|
|
|
$l =~ s/^lib//;
|
|
|
|
$l = "-l" . $l;
|
|
|
|
push @linklibs, $l;
|
|
|
|
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
|
|
|
|
}
|
2018-01-08 19:28:08 +08:00
|
|
|
}
|
2019-10-04 06:08:01 +08:00
|
|
|
my $linkflags = join("", map { $_." " } @linkdirs);
|
|
|
|
my $linklibs = join("", map { $_." " } @linklibs);
|
2017-12-04 21:27:58 +08: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-14 03:32:42 +08:00
|
|
|
my $cmdflags = '$(BIN_CFLAGS)';
|
2017-12-04 21:27:58 +08: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-14 03:32:42 +08:00
|
|
|
$cmdflags = '$(BIN_CXXFLAGS)';
|
2016-10-12 21:30:43 +08:00
|
|
|
}
|
2019-05-23 22:45:47 +08:00
|
|
|
|
|
|
|
my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
|
|
|
|
my $deps = join(" \\\n" . ' ' x (length($bin) + 2),
|
|
|
|
fill_lines(' ', $COLUMNS - length($bin) - 2,
|
|
|
|
@objs, @deps));
|
|
|
|
|
2016-01-30 10:25:40 +08:00
|
|
|
return <<"EOF";
|
2019-05-23 22:45:47 +08:00
|
|
|
$bin: $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 21:09:57 +08:00
|
|
|
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-14 03:32:42 +08:00
|
|
|
\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
|
2019-05-23 22:45:47 +08:00
|
|
|
-o $bin \\
|
|
|
|
$objs \\
|
2019-10-04 06:08:01 +08:00
|
|
|
$linklibs\$(BIN_EX_LIBS)
|
2016-01-30 10:25:40 +08: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";
|
2021-06-16 16:49:31 +08:00
|
|
|
$script: $sources configdata.pm
|
2021-06-16 16:32:43 +08:00
|
|
|
\$(RM) "$script"
|
2016-02-14 13:55:45 +08:00
|
|
|
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
2016-02-14 15:47:47 +08:00
|
|
|
"-o$target{build_file}" $sources > "$script"
|
2016-01-30 10:25:40 +08:00
|
|
|
chmod a+x $script
|
2016-04-03 04:26:38 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub generatedir {
|
|
|
|
my %args = @_;
|
|
|
|
my $dir = $args{dir};
|
2021-05-24 20:19:38 +08:00
|
|
|
my @deps = compute_platform_depends(@{$args{deps}});
|
2019-05-23 22:45:47 +08:00
|
|
|
my @comments = ();
|
2016-04-03 04:26:38 +08:00
|
|
|
|
2018-10-21 17:11:04 +08:00
|
|
|
# We already have a 'test' target, and the top directory is just plain
|
|
|
|
# silly
|
|
|
|
return if $dir eq "test" || $dir eq ".";
|
|
|
|
|
2016-04-03 04:26:38 +08:00
|
|
|
foreach my $type (("dso", "lib", "bin", "script")) {
|
|
|
|
next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
|
2016-06-28 20:02:44 +08: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-03 04:26:38 +08:00
|
|
|
foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
|
|
|
|
if (dirname($prod) eq $dir) {
|
2021-05-24 20:19:38 +08:00
|
|
|
push @deps, compute_platform_depends($prod);
|
2016-04-03 04:26:38 +08:00
|
|
|
} else {
|
2019-05-23 22:45:47 +08:00
|
|
|
push @comments, "# No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
|
2016-04-03 04:26:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-23 22:45:47 +08:00
|
|
|
my $target = "$dir $dir/";
|
|
|
|
my $deps = join(" \\\n\t",
|
|
|
|
fill_lines(' ', $COLUMNS - 8, @deps));
|
|
|
|
my $comments = join("\n", "", @comments);
|
2016-04-03 04:26:38 +08:00
|
|
|
return <<"EOF";
|
2019-05-23 22:45:47 +08:00
|
|
|
$target: \\
|
|
|
|
$deps$comments
|
2016-01-30 10:25:40 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|