2016-01-30 14:14:58 +08:00
|
|
|
## descrip.mms to build OpenSSL on OpenVMS
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
|
|
|
use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
|
2018-03-12 16:18:44 +08:00
|
|
|
use File::Basename;
|
2021-05-17 20:25:12 +08:00
|
|
|
use OpenSSL::Util;
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-10-23 21:00:36 +08:00
|
|
|
(our $osslprefix_q = platform->osslprefix()) =~ s/\$/\\\$/;
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-10-23 21:00:36 +08:00
|
|
|
our $sover_dirname = platform->shlib_version_as_filename();
|
2021-10-15 18:22:04 +08:00
|
|
|
our $osslver = sprintf "%02d", split(/\./, $config{version});
|
2016-07-07 00:53:56 +08:00
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
our $sourcedir = $config{sourcedir};
|
|
|
|
our $builddir = $config{builddir};
|
2021-05-17 22:56:28 +08:00
|
|
|
sub make_unix_path {
|
|
|
|
# Split the native path
|
|
|
|
(my $vol, my $dirs, my $file) = File::Spec->splitpath($_[0]);
|
|
|
|
my @dirs = File::Spec->splitdir($dirs);
|
|
|
|
|
|
|
|
# Reassemble it as a Unix path
|
|
|
|
$vol =~ s|:$||;
|
|
|
|
return File::Spec::Unix->catpath(
|
|
|
|
'', File::Spec::Unix->catdir('', $vol ? $vol : (), @dirs), $file);
|
|
|
|
}
|
2016-01-30 14:14:58 +08:00
|
|
|
sub sourcefile {
|
|
|
|
catfile($sourcedir, @_);
|
|
|
|
}
|
|
|
|
sub buildfile {
|
|
|
|
catfile($builddir, @_);
|
|
|
|
}
|
|
|
|
sub sourcedir {
|
|
|
|
catdir($sourcedir, @_);
|
|
|
|
}
|
|
|
|
sub builddir {
|
|
|
|
catdir($builddir, @_);
|
|
|
|
}
|
|
|
|
sub tree {
|
|
|
|
(my $x = shift) =~ s|\]$|...]|;
|
|
|
|
$x
|
|
|
|
}
|
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
# Because we need to make two computations of these data,
|
|
|
|
# we store them in arrays for reuse
|
2017-04-18 22:24:23 +08:00
|
|
|
our @libs =
|
2018-10-23 21:00:36 +08:00
|
|
|
map { platform->staticname($_) }
|
2017-04-18 22:24:23 +08:00
|
|
|
@{$unified_info{libraries}};
|
|
|
|
our @shlibs =
|
2018-10-23 21:00:36 +08:00
|
|
|
map { platform->sharedname($_) // () }
|
|
|
|
@{$unified_info{libraries}};
|
2017-04-18 22:24:23 +08:00
|
|
|
our @install_libs =
|
2018-10-23 21:00:36 +08:00
|
|
|
map { platform->staticname($_) }
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
|
2018-11-07 18:02:06 +08:00
|
|
|
@{$unified_info{libraries}};
|
2017-04-18 22:24:23 +08:00
|
|
|
our @install_shlibs =
|
2018-10-23 21:00:36 +08:00
|
|
|
map { platform->sharedname($_) // () }
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
|
2018-11-07 18:02:06 +08:00
|
|
|
@{$unified_info{libraries}};
|
|
|
|
our @install_engines =
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
2019-01-31 07:06:50 +08:00
|
|
|
@{$unified_info{modules}};
|
2020-04-17 21:38:45 +08:00
|
|
|
our @install_modules =
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
2021-05-24 20:24:32 +08:00
|
|
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine}
|
|
|
|
&& !$unified_info{attributes}->{modules}->{$_}->{fips} }
|
|
|
|
@{$unified_info{modules}};
|
|
|
|
our @install_fipsmodules =
|
|
|
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{modules}->{$_}->{fips} }
|
2020-04-17 21:38:45 +08:00
|
|
|
@{$unified_info{modules}};
|
2018-11-07 18:02:06 +08:00
|
|
|
our @install_programs =
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
2018-11-07 18:02:06 +08:00
|
|
|
@{$unified_info{programs}};
|
Build: use attributes to indicate installed script classes
We have two classes of scripts to be installed, those that are
installed as "normal" programs, and those that are installed as "misc"
scripts. These classes are installed in different locations, so the
build file templates must pay attention.
Because we didn't have the tools to indicate what scripts go where, we
had these scripts hard coded in the build template files, with the
maintenance issues that may cause. Now that we have attributes, those
can be used to classify the installed scripts, and have the build file
templates simply check the attributes to know what's what.
Furthermore, the 'tsget.pl' script exists both as 'tsget.pl' and
'tsget', which is done by installing a symbolic link (or copy). This
link name is now given through an attribute, which results in even
less hard coding in the Unix Makefile template.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7581)
2018-11-07 18:05:17 +08:00
|
|
|
our @install_bin_scripts =
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
|
|
|
|
&& !$unified_info{attributes}->{scripts}->{$_}->{misc} }
|
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
|
|
|
@{$unified_info{scripts}};
|
|
|
|
our @install_misc_scripts =
|
2019-10-04 05:30:58 +08:00
|
|
|
grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{scripts}->{$_}->{misc} }
|
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
|
|
|
@{$unified_info{scripts}};
|
2016-06-17 06:23:43 +08:00
|
|
|
|
2021-05-18 00:21:45 +08:00
|
|
|
# Configured flags
|
|
|
|
|
|
|
|
our @cnf_asflags = ($target{asflags} || (), @{$config{asflags}});
|
|
|
|
our @cnf_defines = (@{$target{defines}}, @{$config{defines}});
|
|
|
|
our @cnf_includes = (@{$target{includes}}, @{$config{includes}});
|
|
|
|
our @cnf_cppflags = ($target{cppflags} || (), @{$config{cppflags}});
|
|
|
|
our @cnf_cflags = ($target{cflags} || (), @{$config{cflags}});
|
|
|
|
our @cnf_cxxflags = ($target{cxxflags} || (), @{$config{cxxflags}});
|
|
|
|
our @cnf_ldflags = ($target{lflags} || (), @{$config{lflags}});
|
|
|
|
our @cnf_ex_libs = (map{ ",$_" } @{$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.
|
|
|
|
|
|
|
|
# The following array is special and is treated separately from the rest of
|
|
|
|
# the lib_ variables.
|
|
|
|
our @lib_cppincludes = (@{$target{lib_includes}}, @{$target{shared_includes}},
|
|
|
|
@{$config{lib_includes}}, @{$config{shared_includes}},
|
|
|
|
@cnf_includes);
|
|
|
|
|
|
|
|
our $lib_cppdefines =
|
|
|
|
join(',', @{$target{lib_defines}}, @{$target{shared_defines}},
|
|
|
|
@{$config{lib_defines}}, @{$config{shared_defines}},
|
|
|
|
@cnf_defines,
|
|
|
|
'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
|
|
|
|
'ENGINESDIR="""$(ENGINESDIR_C)"""',
|
2021-09-09 02:16:37 +08:00
|
|
|
'MODULESDIR="""$(MODULESDIR_C)"""'
|
2021-05-18 00:21:45 +08:00
|
|
|
)
|
2021-09-09 02:16:37 +08:00
|
|
|
. '$(DEFINES)'
|
2021-05-18 00:21:45 +08:00
|
|
|
. "'extradefines'";
|
|
|
|
our $lib_asflags =
|
|
|
|
join(' ', $target{lib_asflags} || (), @{$config{lib_asflags}},
|
|
|
|
@cnf_asflags, '$(ASFLAGS)');
|
|
|
|
our $lib_cppflags =
|
|
|
|
join('', $target{lib_cppflags} || (), $target{shared_cppflags} || (),
|
|
|
|
@{$config{lib_cppflags}}, @{$config{shared_cppflag}},
|
|
|
|
@cnf_cppflags, '/DEFINE=('.$lib_cppdefines.')', '$(CPPFLAGS)');
|
|
|
|
my @lib_cflags = ( $target{lib_cflags} // () );
|
|
|
|
my @lib_cflags_no_inst = ( $target{no_inst_lib_cflags} // @lib_cflags );
|
|
|
|
my @lib_cflags_cont = ( $target{shared_cflag} || (),
|
|
|
|
@{$config{lib_cflags}}, @{$config{shared_cflag}},
|
|
|
|
$cnf_cflags, '$(CFLAGS)');
|
|
|
|
our $lib_cflags = join('', @lib_cflags, @lib_cflags_cont );
|
|
|
|
our $lib_cflags_no_inst = join('', @lib_cflags_no_inst, @lib_cflags_cont );
|
|
|
|
our $lib_ldflags =
|
|
|
|
join('', $target{lib_lflags} || (), $target{shared_ldflag} || (),
|
|
|
|
@{$config{lib_lflags}}, @{$config{shared_ldflag}},
|
|
|
|
@cnf_ldflags, '$(LDFLAGS)');
|
|
|
|
our $lib_ex_libs = join('', @cnf_ex_libs, '$(EX_LIBS)');
|
|
|
|
|
|
|
|
# The following array is special and is treated separately from the rest of
|
|
|
|
# the dso_ variables.
|
|
|
|
our @dso_cppincludes = (@{$target{dso_includes}}, @{$target{module_includes}},
|
|
|
|
@{$config{dso_includes}}, @{$config{module_includes}},
|
|
|
|
@cnf_includes);
|
|
|
|
|
|
|
|
our $dso_cppdefines =
|
|
|
|
join(',', @{$target{dso_defines}}, @{$target{module_defines}},
|
|
|
|
@{$config{dso_defines}}, @{$config{module_defines}},
|
|
|
|
@cnf_defines,
|
|
|
|
)
|
2021-09-09 02:16:37 +08:00
|
|
|
. '$(DEFINES)'
|
2021-05-18 00:21:45 +08:00
|
|
|
. "'extradefines'";
|
|
|
|
our $dso_asflags =
|
|
|
|
join(' ', $target{dso_asflags} || (), $target{module_asflags} || (),
|
|
|
|
@{$config{dso_asflags}}, @{$config{module_asflags}},
|
|
|
|
@cnf_asflags, '$(ASFLAGS)');
|
|
|
|
our $dso_cppflags =
|
|
|
|
join('', $target{dso_cppflags} || (), $target{module_cppflags} || (),
|
|
|
|
@{$config{dso_cppflags}}, @{$config{module_cppflag}},
|
|
|
|
@cnf_cppflags,
|
|
|
|
'/DEFINE=('.$dso_cppdefines.')',
|
|
|
|
'$(CPPFLAGS)');
|
|
|
|
my @dso_cflags = ( $target{dso_cflags} // () );
|
|
|
|
my @dso_cflags_no_inst = ( $target{no_inst_dso_cflags} // @dso_cflags );
|
|
|
|
my @dso_cflags_cont = ( $target{module_cflag} || (),
|
|
|
|
@{$config{dso_cflags}}, @{$config{module_cflag}},
|
|
|
|
$cnf_cflags, '$(CFLAGS)');
|
|
|
|
our $dso_cflags = join('', @dso_cflags, @dso_cflags_cont );
|
|
|
|
our $dso_cflags_no_inst = join('', @dso_cflags_no_inst, @dso_cflags_cont );
|
|
|
|
our $dso_ldflags =
|
|
|
|
join('', $target{dso_lflags} || (), $target{module_ldflag} || (),
|
|
|
|
@{$config{dso_lflags}}, @{$config{module_ldflag}},
|
|
|
|
@cnf_ldflags, '$(LDFLAGS)');
|
|
|
|
our $dso_ex_libs = join('', @cnf_ex_libs, '$(EX_LIBS)');
|
|
|
|
|
|
|
|
# The following array is special and is treated separately from the rest of
|
|
|
|
# the bin_ variables.
|
|
|
|
our @bin_cppincludes = (@{$target{bin_includes}},
|
|
|
|
@{$config{bin_includes}},
|
|
|
|
@cnf_includes);
|
|
|
|
|
|
|
|
our $bin_cppdefines =
|
|
|
|
join(',', @{$target{bin_defines}},
|
|
|
|
@{$config{bin_defines}},
|
|
|
|
@cnf_defines,
|
|
|
|
)
|
2021-09-09 02:16:37 +08:00
|
|
|
. '$(DEFINES)'
|
2021-05-18 00:21:45 +08:00
|
|
|
. "'extradefines'";
|
|
|
|
our $bin_asflags =
|
|
|
|
join(' ', $target{bin_asflags} || (),
|
|
|
|
@{$config{bin_asflags}},
|
|
|
|
@cnf_asflags, '$(ASFLAGS)');
|
|
|
|
our $bin_cppflags =
|
|
|
|
join('', $target{bin_cppflags} || (),
|
|
|
|
@{$config{bin_cppflags}},
|
|
|
|
@cnf_cppflags,
|
|
|
|
'/DEFINE=('.$bin_cppdefines.')',
|
|
|
|
'$(CPPFLAGS)');
|
|
|
|
my @bin_cflags = ( $target{bin_cflags} // () );
|
|
|
|
my @bin_cflags_no_inst = ( $target{no_inst_bin_cflags} // @bin_cflags );
|
|
|
|
my @bin_cflags_cont = ( @{$config{bin_cflags}},
|
|
|
|
$cnf_cflags, '$(CFLAGS)');
|
|
|
|
our $bin_cflags = join('', @bin_cflags, @bin_cflags_cont );
|
|
|
|
our $bin_cflags_no_inst = join('', @bin_cflags_no_inst, @bin_cflags_cont );
|
|
|
|
our $bin_cflags =
|
|
|
|
join('', $target{bin_cflags} || (),
|
|
|
|
@{$config{bin_cflags}},
|
|
|
|
@cnf_cflags, '$(CFLAGS)');
|
|
|
|
our $bin_ldflags =
|
|
|
|
join('', $target{bin_lflags} || (),
|
|
|
|
@{$config{bin_lflags}},
|
|
|
|
@cnf_ldflags, '$(LDFLAGS)');
|
|
|
|
our $bin_ex_libs = join('', @cnf_ex_libs, '$(EX_LIBS)');
|
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
# This is a horrible hack, but is needed because recursive inclusion of files
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
# in different directories does not work well with VMS C. We try to help by
|
|
|
|
# specifying extra relative directories. They must always be in Unix format,
|
|
|
|
# relative to the directory where the .c file is located. The logic is that
|
|
|
|
# any inclusion, merged with one of these relative directories, will find the
|
|
|
|
# requested inclusion file.
|
2016-01-30 14:14:58 +08:00
|
|
|
foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
|
2018-10-23 21:00:36 +08:00
|
|
|
my $obj = platform->obj($_);
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../);
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
foreach (grep /\[\.crypto\.ec\.curve448\].*?\.o$/, keys %{$unified_info{sources}}) {
|
2021-05-18 03:40:24 +08:00
|
|
|
my $obj = platform->obj($_);
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(./arch_32 ./arch64);
|
2021-05-18 03:40:24 +08:00
|
|
|
}
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
foreach (grep /\[\.crypto\.ec\.curve448.arch_(?:32|64)\].*?\.o$/, keys %{$unified_info{sources}}) {
|
2018-10-23 21:00:36 +08:00
|
|
|
my $obj = platform->obj($_);
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../);
|
|
|
|
}
|
2022-09-19 17:48:27 +08:00
|
|
|
foreach (grep /\[\.ssl\].*?\.o$/, keys %{$unified_info{sources}}) {
|
|
|
|
my $obj = platform->obj($_);
|
|
|
|
# Most of the files in [.ssl.record.methods] include "ssl_local.h"
|
|
|
|
# which includes things like "record/record.h". Adding "./" as an
|
|
|
|
# inclusion directory helps making this sort of header from these
|
|
|
|
# directories.
|
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(./);
|
|
|
|
}
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
foreach (grep /\[\.ssl\.(?:record|statem)\].*?\.o$/, keys %{$unified_info{sources}}) {
|
|
|
|
my $obj = platform->obj($_);
|
|
|
|
# Most of the files in [.ssl.record] and [.ssl.statem] include
|
|
|
|
# "../ssl_local.h", which includes things like "record/record.h".
|
|
|
|
# Adding "../" as an inclusion directory helps making this sort of header
|
|
|
|
# from these directories.
|
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../);
|
|
|
|
|
|
|
|
}
|
2022-09-19 17:48:27 +08:00
|
|
|
foreach (grep /\[\.ssl\.record\.methods\].*?\.o$/, keys %{$unified_info{sources}}) {
|
|
|
|
my $obj = platform->obj($_);
|
|
|
|
# Most of the files in [.ssl.record.methods] include "../../ssl_local.h"
|
|
|
|
# which includes things like "record/record.h". Adding "../../" as an
|
|
|
|
# inclusion directory helps making this sort of header from these
|
|
|
|
# directories.
|
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../../);
|
|
|
|
}
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
foreach (grep /\[\.test\].*?\.o$/, keys %{$unified_info{sources}}) {
|
|
|
|
my $obj = platform->obj($_);
|
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../ssl ./helpers);
|
|
|
|
}
|
|
|
|
foreach (grep /\[\.test\.helpers\].*?\.o$/, keys %{$unified_info{sources}}) {
|
|
|
|
my $obj = platform->obj($_);
|
|
|
|
push @{$unified_info{includes_extra}->{$obj}}, qw(../../ssl);
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
2021-05-18 00:21:45 +08:00
|
|
|
|
2017-04-23 22:17:32 +08:00
|
|
|
# This makes sure things get built in the order they need
|
|
|
|
# to. You're welcome.
|
|
|
|
sub dependmagic {
|
|
|
|
my $target = shift;
|
|
|
|
|
2017-07-07 17:09:19 +08:00
|
|
|
return "$target : build_generated\n\t\pipe \$(MMS) \$(MMSQUALIFIERS) depend && \$(MMS) \$(MMSQUALIFIERS) _$target\n_$target";
|
2017-04-23 22:17:32 +08:00
|
|
|
}
|
2016-01-30 14:14:58 +08:00
|
|
|
"";
|
|
|
|
-}
|
|
|
|
PLATFORM={- $config{target} -}
|
|
|
|
OPTIONS={- $config{options} -}
|
|
|
|
CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
|
|
|
|
SRCDIR={- $config{sourcedir} -}
|
2016-06-15 04:03:08 +08:00
|
|
|
BLDDIR={- $config{builddir} -}
|
2020-06-29 10:20:41 +08:00
|
|
|
FIPSKEY={- $config{FIPSKEY} -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-05-08 22:57:55 +08:00
|
|
|
# Allow both V and VERBOSE to indicate verbosity. This only applies
|
|
|
|
# to testing.
|
|
|
|
VERBOSE=$(V)
|
2019-09-11 17:05:11 +08:00
|
|
|
VERBOSE_FAILURE=$(VF)
|
2016-05-08 22:57:55 +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 14:14:58 +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 14:14:58 +08:00
|
|
|
SHLIB_TARGET={- $target{shared_target} -}
|
|
|
|
|
2017-04-18 22:24:23 +08:00
|
|
|
LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
|
2016-06-17 06:23:43 +08:00
|
|
|
SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
|
2021-05-24 20:06:00 +08:00
|
|
|
MODULES={- join(", ", map { "-\n\t".$_.".EXE" }
|
|
|
|
# Drop all modules that are dependencies, they will
|
|
|
|
# be processed through their dependents
|
|
|
|
grep { my $x = $_;
|
|
|
|
!grep { grep { $_ eq $x } @$_ }
|
|
|
|
values %{$unified_info{depends}} }
|
|
|
|
@{$unified_info{modules}}) -}
|
|
|
|
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) -}
|
2016-07-08 23:58:36 +08:00
|
|
|
PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
|
2016-01-30 14:14:58 +08:00
|
|
|
SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
|
2016-03-09 08:16:10 +08:00
|
|
|
{- output_off() if $disabled{makedepend}; "" -}
|
2018-10-23 21:00:36 +08:00
|
|
|
DEPS={- our @deps = map { platform->isobj($_) ? platform->dep($_) : $_ }
|
2016-02-19 02:41:57 +08:00
|
|
|
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
|
|
|
|
keys %{$unified_info{sources}};
|
|
|
|
join(", ", map { "-\n\t".$_ } @deps); -}
|
2016-03-09 08:16:10 +08:00
|
|
|
{- output_on() if $disabled{makedepend}; "" -}
|
2021-05-17 20:53:48 +08:00
|
|
|
GENERATED_MANDATORY={- join(", ",
|
|
|
|
map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
|
|
|
|
GENERATED_PODS={- # common0.tmpl provides @generated
|
|
|
|
join(", ",
|
|
|
|
map { my $x = $_;
|
|
|
|
(
|
|
|
|
grep {
|
|
|
|
$unified_info{attributes}->{depends}
|
|
|
|
->{$x}->{$_}->{pod} // 0
|
|
|
|
}
|
|
|
|
keys %{$unified_info{attributes}->{depends}->{$x}}
|
|
|
|
) ? "-\n\t".$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
|
2018-10-23 21:00:36 +08:00
|
|
|
join(", ", map { platform->convertext($_) } @generated) -}
|
2016-06-14 04:02:11 +08:00
|
|
|
|
2017-04-18 22:24:23 +08:00
|
|
|
INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
|
2016-07-08 20:52:09 +08:00
|
|
|
INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
|
2018-11-07 18:02:06 +08:00
|
|
|
INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
|
2020-04-17 21:38:45 +08:00
|
|
|
INSTALL_MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @install_modules) -}
|
2021-05-24 20:24:32 +08:00
|
|
|
INSTALL_FIPSMODULE={- join(", ", map { "-\n\t".$_.".EXE" } @install_fipsmodules) -}
|
|
|
|
INSTALL_FIPSMODULECONF=[.providers]fipsmodule.cnf
|
2018-11-07 18:02:06 +08:00
|
|
|
INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
|
Build: use attributes to indicate installed script classes
We have two classes of scripts to be installed, those that are
installed as "normal" programs, and those that are installed as "misc"
scripts. These classes are installed in different locations, so the
build file templates must pay attention.
Because we didn't have the tools to indicate what scripts go where, we
had these scripts hard coded in the build template files, with the
maintenance issues that may cause. Now that we have attributes, those
can be used to classify the installed scripts, and have the build file
templates simply check the attributes to know what's what.
Furthermore, the 'tsget.pl' script exists both as 'tsget.pl' and
'tsget', which is done by installing a symbolic link (or copy). This
link name is now given through an attribute, which results in even
less hard coding in the Unix Makefile template.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7581)
2018-11-07 18:05:17 +08:00
|
|
|
BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
|
|
|
|
MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
|
2016-09-01 04:57:25 +08:00
|
|
|
HTMLDOCS1={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man1}}) -}
|
|
|
|
HTMLDOCS3={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man3}}) -}
|
|
|
|
HTMLDOCS5={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man5}}) -}
|
|
|
|
HTMLDOCS7={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man7}}) -}
|
2016-01-30 14:14:58 +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,
|
2016-01-30 14:14:58 +08:00
|
|
|
# SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
|
|
|
|
# In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
|
2016-02-13 04:14:03 +08:00
|
|
|
# MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
|
|
|
|
# STAGING:[USER.OPENSSL].
|
2016-01-30 14:14:58 +08:00
|
|
|
# Normally it is left empty.
|
2016-02-13 04:14:03 +08:00
|
|
|
DESTDIR=
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
# Do not edit this manually. Use Configure --prefix=DIR to change this!
|
2016-07-07 00:53:56 +08:00
|
|
|
INSTALLTOP={- our $installtop =
|
|
|
|
catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
|
2016-03-30 02:01:33 +08:00
|
|
|
$installtop -}
|
|
|
|
SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
|
2016-01-30 14:14:58 +08:00
|
|
|
# This is the standard central area to store certificates, private keys...
|
2016-08-27 04:34:39 +08:00
|
|
|
OPENSSLDIR={- catdir($config{openssldir}) or
|
2016-03-24 06:04:32 +08:00
|
|
|
$config{prefix} ? catdir($config{prefix},"COMMON")
|
|
|
|
: "SYS\$COMMON:[OPENSSL-COMMON]" -}
|
2016-07-09 00:30:43 +08:00
|
|
|
# The same, but for C
|
2018-10-23 21:00:36 +08:00
|
|
|
OPENSSLDIR_C={- platform->osslprefix() -}DATAROOT:[000000]
|
2019-01-31 07:06:50 +08:00
|
|
|
# Where installed ENGINE modules reside, for C
|
2018-10-23 21:00:36 +08:00
|
|
|
ENGINESDIR_C={- platform->osslprefix() -}ENGINES{- $sover_dirname.$target{pointer_size} -}:
|
2019-02-06 06:18:50 +08:00
|
|
|
# Where modules reside, for C
|
2021-10-15 18:32:43 +08:00
|
|
|
MODULESDIR_C={- platform->osslprefix() -}MODULES{- $target{pointer_size} -}:
|
2016-01-30 14:14:58 +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 ################################
|
|
|
|
|
|
|
|
CC={- $config{CC} -}
|
|
|
|
CPP={- $config{CPP} -}
|
2021-05-18 00:21:45 +08:00
|
|
|
DEFINES={- our $defines = join('', map { ",$_" } @{$config{CPPDEFINES}}) -}
|
2021-05-17 22:56:28 +08:00
|
|
|
#INCLUDES={- our $includes = join(',', @{$config{CPPINCLUDES}}) -}
|
2021-05-18 00:21:45 +08:00
|
|
|
CPPFLAGS={- our $cppflags = join('', @{$config{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
|
|
|
CFLAGS={- join('', @{$config{CFLAGS}}) -}
|
|
|
|
LDFLAGS={- join('', @{$config{LFLAGS}}) -}
|
|
|
|
EX_LIBS={- join('', map { ",$_" } @{$config{LDLIBS}}) -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-07-08 18:00:06 +08:00
|
|
|
PERL={- $config{PERL} -}
|
2016-01-30 14:14:58 +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
|
|
|
AS={- $config{AS} -}
|
|
|
|
ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
|
|
|
|
|
|
|
|
##### Special command flags ##########################################
|
|
|
|
|
2018-02-14 03:47:34 +08:00
|
|
|
ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
|
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
|
|
|
|
2018-02-14 03:47:34 +08:00
|
|
|
PERLASM_SCHEME={- $target{perlasm_scheme} -}
|
2016-01-30 14:14:58 +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
|
|
|
# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
|
2021-05-18 00:21:45 +08:00
|
|
|
CPPFLAGS_Q={- (my $c = $lib_cppflags.$cppflags) =~ s|"|""|g;
|
|
|
|
(my $d = $lib_cppdefines) =~ s|"|""|g;
|
|
|
|
my $i = join(',', @lib_cppincludes || (), '$(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
|
|
|
my $x = $c;
|
|
|
|
$x .= "/INCLUDE=($i)" if $i;
|
|
|
|
$x .= "/DEFINE=($d)" if $d;
|
|
|
|
$x; -}
|
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
# .FIRST and .LAST are special targets with MMS and MMK.
|
|
|
|
NODEBUG=@
|
|
|
|
.FIRST :
|
2021-07-26 18:40:01 +08:00
|
|
|
{- join( "\n \$(NODEBUG) ", @{ $target{setup_commands} // [] },
|
|
|
|
'!' ) -}
|
2021-05-17 20:53:48 +08:00
|
|
|
$(NODEBUG) sourcetop = F$PARSE("$(SRCDIR)","[]A.;",,,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
|
2020-02-17 22:20:57 +08:00
|
|
|
$(NODEBUG) DEFINE ossl_sourceroot 'sourcetop'
|
|
|
|
$(NODEBUG) !
|
2016-02-13 04:14:03 +08:00
|
|
|
$(NODEBUG) staging_dir = "$(DESTDIR)"
|
2016-03-24 06:08:18 +08:00
|
|
|
$(NODEBUG) staging_instdir = ""
|
|
|
|
$(NODEBUG) staging_datadir = ""
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) IF staging_dir .NES. "" THEN -
|
2016-03-24 06:08:18 +08:00
|
|
|
staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
|
|
|
|
$(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
|
|
|
|
staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
|
|
|
|
$(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
|
|
|
|
staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
|
|
|
|
$(NODEBUG) IF staging_dir .NES. "" THEN -
|
|
|
|
staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
|
|
|
|
$(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
|
|
|
|
staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
|
|
|
|
$(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
|
|
|
|
staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) !
|
|
|
|
$(NODEBUG) ! Installation logical names
|
|
|
|
$(NODEBUG) !
|
2021-01-11 15:51:43 +08:00
|
|
|
$(NODEBUG) ! This also creates a few DCL variables that are used for
|
|
|
|
$(NODEBUG) ! the "install_msg" target.
|
|
|
|
$(NODEBUG) !
|
|
|
|
$(NODEBUG) installroot = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;"
|
|
|
|
$(NODEBUG) installtop = installroot + ".]"
|
|
|
|
$(NODEBUG) dataroot = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;"
|
|
|
|
$(NODEBUG) datatop = dataroot + ".]"
|
2016-03-24 06:08:18 +08:00
|
|
|
$(NODEBUG) DEFINE ossl_installroot 'installtop'
|
|
|
|
$(NODEBUG) DEFINE ossl_dataroot 'datatop'
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) !
|
2021-05-17 22:56:28 +08:00
|
|
|
$(NODEBUG) ! Override disturbing system logicals. We can't deassign
|
|
|
|
$(NODEBUG) ! them, so we create it instead. This is an unfortunate
|
|
|
|
$(NODEBUG) ! necessity.
|
|
|
|
$(NODEBUG) !
|
2021-12-10 23:56:39 +08:00
|
|
|
$(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
|
|
|
|
$(NODEBUG) openssl_inc2 = F$PARSE("sourcetop:[include.openssl]","A.;",,,"SYNTAX_ONLY") - "A.;"
|
|
|
|
$(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
|
2021-05-17 22:56:28 +08:00
|
|
|
$(NODEBUG) !
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) ! Figure out the architecture
|
|
|
|
$(NODEBUG) !
|
2016-11-05 02:11:11 +08:00
|
|
|
$(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) !
|
|
|
|
$(NODEBUG) ! Set up logical names for the libraries, so LINK and
|
|
|
|
$(NODEBUG) ! running programs can use them.
|
|
|
|
$(NODEBUG) !
|
2017-04-18 22:24:23 +08:00
|
|
|
$(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } @shlibs) || "!" -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
.LAST :
|
2017-04-18 22:24:23 +08:00
|
|
|
$(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } @shlibs) || "!" -}
|
2021-12-10 23:56:39 +08:00
|
|
|
$(NODEBUG) DEASSIGN openssl
|
2016-03-24 06:08:18 +08:00
|
|
|
$(NODEBUG) DEASSIGN ossl_dataroot
|
2016-01-30 14:14:58 +08:00
|
|
|
$(NODEBUG) DEASSIGN ossl_installroot
|
2021-12-10 23:56:39 +08:00
|
|
|
$(NODEBUG) DEASSIGN ossl_sourceroot
|
2016-01-30 14:14:58 +08:00
|
|
|
.DEFAULT :
|
|
|
|
@ ! MMS cannot handle no actions...
|
|
|
|
|
|
|
|
# The main targets ###################################################
|
|
|
|
|
2021-06-16 16:32:43 +08:00
|
|
|
{- dependmagic('build_sw'); -} : build_libs_nodep, build_modules_nodep, build_programs_nodep
|
2017-04-23 22:17:32 +08:00
|
|
|
{- dependmagic('build_libs'); -} : build_libs_nodep
|
2019-01-31 07:06:50 +08:00
|
|
|
{- dependmagic('build_modules'); -} : build_modules_nodep
|
2017-04-23 22:17:32 +08:00
|
|
|
{- dependmagic('build_programs'); -} : build_programs_nodep
|
2016-02-19 02:41:57 +08:00
|
|
|
|
2021-05-17 20:53:48 +08:00
|
|
|
build_generated_pods : $(GENERATED_PODS)
|
|
|
|
build_docs : build_html_docs
|
|
|
|
build_html_docs : $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
|
|
|
|
|
2017-04-23 22:17:32 +08:00
|
|
|
build_generated : $(GENERATED_MANDATORY)
|
2016-07-06 09:07:16 +08:00
|
|
|
build_libs_nodep : $(LIBS), $(SHLIBS)
|
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)
|
2016-02-19 02:41:57 +08:00
|
|
|
|
2016-07-08 23:58:36 +08:00
|
|
|
# Kept around for backward compatibility
|
|
|
|
build_apps build_tests : build_programs
|
|
|
|
|
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}; "" -}
|
|
|
|
@ WRITE SYS$OUTPUT "Warning: consider configuring with no-makedepend, because if"
|
|
|
|
@ WRITE SYS$OUTPUT " target system doesn't have $(PERL),"
|
|
|
|
@ WRITE SYS$OUTPUT " then make will fail..."
|
|
|
|
@ ! {- output_on() if $disabled{makedepend}; "" -}
|
2017-06-16 09:46:41 +08:00
|
|
|
|
2016-09-01 04:57:25 +08:00
|
|
|
all : build_sw build_docs
|
|
|
|
|
2017-04-23 22:17:32 +08:00
|
|
|
test : tests
|
2021-06-16 16:32:43 +08:00
|
|
|
{- dependmagic('tests'); -} : build_programs_nodep, build_modules_nodep run_tests
|
2021-05-17 20:53:48 +08:00
|
|
|
run_tests :
|
2016-04-14 20:44:15 +08:00
|
|
|
@ ! {- output_off() if $disabled{tests}; "" -}
|
2020-06-29 10:20:41 +08:00
|
|
|
DEFINE SRCTOP "$(SRCDIR)"
|
|
|
|
DEFINE BLDTOP "$(BLDDIR)"
|
|
|
|
DEFINE FIPSKEY "$(FIPSKEY)"
|
2016-05-08 22:57:55 +08:00
|
|
|
IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
|
2016-01-30 14:14:58 +08:00
|
|
|
$(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
|
|
|
|
DEASSIGN BLDTOP
|
|
|
|
DEASSIGN SRCTOP
|
2020-06-29 10:20:41 +08:00
|
|
|
DEASSIGN FIPSKEY
|
2016-04-14 20:44:15 +08:00
|
|
|
@ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
@ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
|
|
|
|
@ ! {- output_on() if !$disabled{tests}; "" -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
list-tests :
|
2016-06-17 06:23:43 +08:00
|
|
|
@ ! {- output_off() if $disabled{tests}; "" -}
|
2020-06-29 10:20:41 +08:00
|
|
|
@ DEFINE SRCTOP "$(SRCDIR)"
|
2016-06-17 06:23:43 +08:00
|
|
|
@ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
|
|
|
|
@ DEASSIGN SRCTOP
|
|
|
|
@ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
|
|
|
@ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
|
|
|
|
@ ! {- output_on() if !$disabled{tests}; "" -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2021-08-03 17:35:58 +08:00
|
|
|
install : install_sw install_ssldirs install_docs {- $disabled{fips} ? "" : "install_fips" -} install_msg
|
2016-09-01 04:57:25 +08:00
|
|
|
|
2021-01-11 15:51:43 +08:00
|
|
|
install_msg :
|
2016-02-19 16:53:05 +08:00
|
|
|
@ WRITE SYS$OUTPUT ""
|
|
|
|
@ WRITE SYS$OUTPUT "######################################################################"
|
|
|
|
@ WRITE SYS$OUTPUT ""
|
2016-02-28 16:31:46 +08:00
|
|
|
@ IF "$(DESTDIR)" .EQS. "" THEN -
|
2021-01-11 15:31:21 +08:00
|
|
|
@{- sourcefile("VMS", "msg_install.com") -} "$(SYSTARTUP)" "{- $osslver -}"
|
2016-03-24 06:08:18 +08:00
|
|
|
@ IF "$(DESTDIR)" .NES. "" THEN -
|
2021-01-11 15:31:21 +08:00
|
|
|
@{- sourcefile("VMS", "msg_staging.com") -} -
|
2021-01-11 15:51:43 +08:00
|
|
|
"''installroot']" "''dataroot']" "$(INSTALLTOP)" "$(OPENSSLDIR)" -
|
|
|
|
"$(SYSTARTUP)" "{- $osslver -}"
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-07-02 16:28:39 +08:00
|
|
|
check_install :
|
2016-07-07 00:53:56 +08:00
|
|
|
spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
|
2016-07-02 16:28:39 +08:00
|
|
|
|
2021-08-03 17:35:58 +08:00
|
|
|
uninstall : uninstall_docs uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
# Because VMS wants the generation number (or *) to delete files, we can't
|
2019-01-31 07:06:50 +08:00
|
|
|
# use $(LIBS), $(PROGRAMS), $(GENERATED) and $(MODULES) directly.
|
2016-06-17 06:23:43 +08:00
|
|
|
libclean :
|
2017-04-18 22:24:23 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_.OLB;*" } @libs) || "@ !" -}
|
2017-12-04 21:27:58 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*" } @shlibs) || "@ !" -}
|
2016-06-17 06:23:43 +08:00
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
clean : libclean
|
2016-09-01 04:57:25 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man1}}) || "@ !" -}
|
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man3}}) || "@ !" -}
|
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man5}}) || "@ !" -}
|
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man7}}) || "@ !" -}
|
2017-03-15 09:52:20 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
|
2019-01-31 07:06:50 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{modules}}) || "@ !" -}
|
2016-06-17 06:23:43 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
|
2018-04-15 21:51:07 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{depends}->{""}}) || "@ !" -}
|
2016-06-17 06:23:43 +08:00
|
|
|
{- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
|
|
|
|
- DELETE [...]*.MAP;*
|
|
|
|
- DELETE [...]*.D;*
|
|
|
|
- DELETE [...]*.OBJ;*,*.LIS;*
|
|
|
|
- DELETE []CXX$DEMANGLER_DB.;*
|
|
|
|
- DELETE [.VMS]openssl_startup.com;*
|
|
|
|
- DELETE [.VMS]openssl_shutdown.com;*
|
|
|
|
- DELETE []vmsconfig.pm;*
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-06-14 04:02:11 +08:00
|
|
|
distclean : clean
|
2022-05-24 23:20:52 +08:00
|
|
|
- DELETE [.include.openssl]configuration.h;*
|
2016-06-14 04:02:11 +08:00
|
|
|
- DELETE configdata.pm;*
|
|
|
|
- DELETE descrip.mms;*
|
|
|
|
|
2016-02-19 02:41:57 +08:00
|
|
|
depend : descrip.mms
|
2016-03-09 08:16:10 +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) {- sourcefile("util", "add-depends.pl") -} "{- $config{makedep_scheme} -}"
|
2016-03-09 08:16:10 +08:00
|
|
|
@ ! {- output_on() if $disabled{makedepend}; "" -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
# Install helper targets #############################################
|
|
|
|
|
2020-04-17 21:38:45 +08:00
|
|
|
install_sw : install_dev install_engines install_modules -
|
|
|
|
install_runtime install_startup install_ivp
|
2016-06-17 06:23:43 +08:00
|
|
|
|
2020-04-17 21:38:45 +08:00
|
|
|
uninstall_sw : uninstall_dev uninstall_modules uninstall_engines -
|
|
|
|
uninstall_runtime uninstall_startup uninstall_ivp
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
install_docs : install_html_docs
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
uninstall_docs : uninstall_html_docs
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2021-05-24 20:24:32 +08:00
|
|
|
{- output_off() if $disabled{fips}; "" -}
|
2021-08-03 17:35:58 +08:00
|
|
|
install_fips : build_sw $(INSTALL_FIPSMODULECONF)
|
2021-05-24 20:24:32 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*** Installing FIPS module"
|
2021-10-15 18:32:43 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[MODULES{- $target{pointer_size} -}.'arch']
|
2021-09-09 15:19:58 +08:00
|
|
|
- CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
|
2021-05-24 20:24:32 +08:00
|
|
|
COPY/PROT=W:RE $(INSTALL_FIPSMODULES) -
|
2021-10-15 18:32:43 +08:00
|
|
|
ossl_installroot:[MODULES{- $target{pointer_size} -}.'arch']$(FIPSMODULENAME)
|
2020-09-30 00:31:58 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*** Installing FIPS module configuration"
|
2021-08-03 17:35:58 +08:00
|
|
|
COPY/PROT=W:RE $(INSTALL_FIPSMODULECONF) OSSL_DATAROOT:[000000]
|
2020-09-30 00:31:58 +08:00
|
|
|
|
2021-08-03 17:35:58 +08:00
|
|
|
uninstall_fips :
|
2020-09-30 00:31:58 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*** Uninstalling FIPS module configuration"
|
2021-05-24 20:24:32 +08:00
|
|
|
DELETE OSSL_DATAROOT:[000000]fipsmodule.cnf;*
|
|
|
|
@ WRITE SYS$OUTPUT "*** Uninstalling FIPS module"
|
2021-10-15 18:32:43 +08:00
|
|
|
DELETE ossl_installroot:[MODULES{- $target{pointer_size} -}.'arch']$(FIPSMODULENAME);*
|
2021-05-24 20:24:32 +08:00
|
|
|
{- output_on() if $disabled{fips}; "" -}
|
2020-09-30 00:31:58 +08:00
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
install_ssldirs : check_INSTALLTOP
|
|
|
|
- CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
|
|
|
|
IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
|
|
|
|
CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
|
|
|
|
IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
|
|
|
|
CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
|
|
|
|
IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
|
|
|
|
CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
|
|
|
|
COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
|
|
|
|
@ ! Install configuration file
|
2016-08-02 05:18:25 +08:00
|
|
|
COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
|
|
|
|
ossl_dataroot:[000000]openssl.cnf-dist
|
|
|
|
IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
|
|
|
|
COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
|
|
|
|
ossl_dataroot:[000000]openssl.cnf
|
2016-09-10 06:05:41 +08:00
|
|
|
@ ! Install CTLOG configuration file
|
|
|
|
COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
|
|
|
|
ossl_dataroot:[000000]ct_log_list.cnf-dist
|
|
|
|
IF F$SEARCH("OSSL_DATAROOT:[000000]ct_log_list.cnf") .EQS. "" THEN -
|
|
|
|
COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
|
|
|
|
ossl_dataroot:[000000]ct_log_list.cnf
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
install_dev : check_INSTALLTOP install_runtime_libs
|
2016-01-30 14:14:58 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*** Installing development files"
|
|
|
|
@ ! Install header files
|
2016-03-24 07:28:38 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[include.openssl]
|
2021-12-10 23:56:39 +08:00
|
|
|
COPY/PROT=W:R ossl_sourceroot:[include.openssl]*.h -
|
|
|
|
ossl_installroot:[include.openssl]
|
|
|
|
COPY/PROT=W:R [.include.openssl]*.h ossl_installroot:[include.openssl]
|
2016-07-19 19:24:57 +08:00
|
|
|
@ ! Install static (development) libraries
|
2016-03-24 07:28:38 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[LIB.'arch']
|
2016-01-30 14:14:58 +08:00
|
|
|
{- join("\n ",
|
2016-02-19 16:53:05 +08:00
|
|
|
map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
|
2017-04-18 22:24:23 +08:00
|
|
|
@install_libs) -}
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2019-01-31 07:06:50 +08:00
|
|
|
install_engines : check_INSTALLTOP install_runtime_libs build_modules
|
|
|
|
@ {- output_off() unless scalar @install_engines; "" -} !
|
2020-04-17 21:38:45 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*** Installing engines"
|
2017-07-19 16:13:41 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
|
2016-02-20 07:10:43 +08:00
|
|
|
{- join("\n ",
|
2017-07-19 16:13:41 +08:00
|
|
|
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
|
2018-11-07 18:02:06 +08:00
|
|
|
@install_engines) -}
|
2019-01-31 07:06:50 +08:00
|
|
|
@ {- output_on() unless scalar @install_engines; "" -} !
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2020-04-17 21:38:45 +08:00
|
|
|
install_modules : check_INSTALLTOP install_runtime_libs build_modules
|
|
|
|
@ {- output_off() unless scalar @install_modules; "" -} !
|
|
|
|
@ WRITE SYS$OUTPUT "*** Installing modules"
|
2021-10-15 18:32:43 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[MODULES{- $target{pointer_size} -}.'arch']
|
2020-04-17 21:38:45 +08:00
|
|
|
{- join("\n ",
|
2021-10-15 18:32:43 +08:00
|
|
|
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[MODULES$target{pointer_size}.'arch']" }
|
2020-04-17 21:38:45 +08:00
|
|
|
@install_modules) -}
|
|
|
|
@ {- output_on() unless scalar @install_modules; "" -} !
|
|
|
|
|
2018-11-09 19:23:53 +08:00
|
|
|
install_runtime : install_programs
|
2018-10-25 15:09:20 +08:00
|
|
|
|
2018-11-07 23:13:57 +08:00
|
|
|
install_runtime_libs : check_INSTALLTOP build_libs
|
2018-10-25 15:09:20 +08:00
|
|
|
@ {- output_off() if $disabled{shared}; "" -} !
|
|
|
|
@ WRITE SYS$OUTPUT "*** Installing shareable images"
|
|
|
|
@ ! Install shared (runtime) libraries
|
|
|
|
- CREATE/DIR ossl_installroot:[LIB.'arch']
|
|
|
|
{- join("\n ",
|
|
|
|
map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
|
|
|
|
@install_shlibs) -}
|
|
|
|
@ {- output_on() if $disabled{shared}; "" -} !
|
|
|
|
|
2018-11-07 23:13:57 +08:00
|
|
|
install_programs : check_INSTALLTOP install_runtime_libs build_programs
|
2018-10-25 15:09:20 +08:00
|
|
|
@ {- output_off() if $disabled{apps}; "" -} !
|
|
|
|
@ ! Install the main program
|
|
|
|
- CREATE/DIR ossl_installroot:[EXE.'arch']
|
|
|
|
COPY/PROT=W:RE [.APPS]openssl.EXE -
|
|
|
|
ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
|
|
|
|
@ ! Install scripts
|
|
|
|
COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
|
|
|
|
@ ! {- output_on() if $disabled{apps}; "" -}
|
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
|
2016-07-02 15:51:06 +08:00
|
|
|
[.VMS]openssl_utils.com, check_INSTALLTOP
|
2016-03-24 07:28:38 +08:00
|
|
|
- CREATE/DIR ossl_installroot:[SYS$STARTUP]
|
2016-07-07 00:53:56 +08:00
|
|
|
COPY/PROT=W:RE [.VMS]openssl_startup.com -
|
|
|
|
ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
|
|
|
|
COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
|
|
|
|
ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
|
|
|
|
COPY/PROT=W:RE [.VMS]openssl_utils.com -
|
|
|
|
ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2016-07-02 16:28:39 +08:00
|
|
|
install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
|
|
|
|
- CREATE/DIR ossl_installroot:[SYSTEST]
|
2016-07-07 00:53:56 +08:00
|
|
|
COPY/PROT=W:RE [.VMS]openssl_ivp.com -
|
|
|
|
ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
|
2016-07-02 16:28:39 +08:00
|
|
|
|
2016-05-14 16:51:58 +08:00
|
|
|
[.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
|
2016-03-24 07:28:38 +08:00
|
|
|
- CREATE/DIR [.VMS]
|
2016-01-30 14:14:58 +08:00
|
|
|
$(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
|
|
|
|
{- sourcefile("VMS", "openssl_startup.com.in") -} -
|
|
|
|
> [.VMS]openssl_startup.com
|
|
|
|
|
2016-07-02 15:51:06 +08:00
|
|
|
[.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
|
|
|
|
- CREATE/DIR [.VMS]
|
|
|
|
$(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
|
|
|
|
{- sourcefile("VMS", "openssl_utils.com.in") -} -
|
|
|
|
> [.VMS]openssl_utils.com
|
|
|
|
|
2016-05-14 16:51:58 +08:00
|
|
|
[.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
|
2016-03-24 07:28:38 +08:00
|
|
|
- CREATE/DIR [.VMS]
|
2016-01-30 14:14:58 +08:00
|
|
|
$(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
|
|
|
|
{- sourcefile("VMS", "openssl_shutdown.com.in") -} -
|
|
|
|
> [.VMS]openssl_shutdown.com
|
|
|
|
|
2016-07-02 16:28:39 +08:00
|
|
|
[.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
|
|
|
|
- CREATE/DIR [.VMS]
|
|
|
|
$(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
|
|
|
|
{- sourcefile("VMS", "openssl_ivp.com.in") -} -
|
|
|
|
> [.VMS]openssl_ivp.com
|
|
|
|
|
2016-02-19 09:30:51 +08:00
|
|
|
vmsconfig.pm : configdata.pm
|
2016-01-30 14:14:58 +08:00
|
|
|
OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
|
|
|
|
WRITE CONFIG "package vmsconfig;"
|
|
|
|
WRITE CONFIG "use strict; use warnings;"
|
|
|
|
WRITE CONFIG "use Exporter;"
|
|
|
|
WRITE CONFIG "our @ISA = qw(Exporter);"
|
2016-02-26 15:46:44 +08:00
|
|
|
WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
|
2016-01-30 14:14:58 +08:00
|
|
|
WRITE CONFIG "our %config = ("
|
2016-07-02 14:31:00 +08:00
|
|
|
WRITE CONFIG " target => '","{- $config{target} -}","',"
|
|
|
|
WRITE CONFIG " version => '","{- $config{version} -}","',"
|
2018-12-11 02:48:37 +08:00
|
|
|
WRITE CONFIG " shlib_version => '","{- $config{shlib_version} -}","',"
|
2016-07-02 14:31:00 +08:00
|
|
|
WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
|
|
|
|
WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
|
2016-02-22 20:52:46 +08:00
|
|
|
WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
|
2016-01-30 14:14:58 +08:00
|
|
|
WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
|
|
|
|
WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
|
2016-07-02 14:31:00 +08:00
|
|
|
WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
|
2016-01-30 14:14:58 +08:00
|
|
|
WRITE CONFIG ");"
|
|
|
|
WRITE CONFIG "our %target = ();"
|
2016-02-26 15:46:44 +08:00
|
|
|
WRITE CONFIG "our %disabled = ();"
|
2016-01-30 14:14:58 +08:00
|
|
|
WRITE CONFIG "our %withargs = ();"
|
|
|
|
WRITE CONFIG "our %unified_info = ();"
|
|
|
|
WRITE CONFIG "1;"
|
|
|
|
CLOSE CONFIG
|
|
|
|
|
2016-09-01 04:57:25 +08:00
|
|
|
install_html_docs : check_INSTALLTOP build_html_docs
|
|
|
|
@ WRITE SYS$OUTPUT "*** Installing HTML docs"
|
|
|
|
- CREATE/DIR ossl_installroot:[HTML.MAN1]
|
|
|
|
- CREATE/DIR ossl_installroot:[HTML.MAN3]
|
|
|
|
- CREATE/DIR ossl_installroot:[HTML.MAN5]
|
|
|
|
- CREATE/DIR ossl_installroot:[HTML.MAN7]
|
|
|
|
{- join("\n ",
|
|
|
|
( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN1]" }
|
|
|
|
@{$unified_info{htmldocs}->{man1}} ),
|
|
|
|
( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN3]" }
|
|
|
|
@{$unified_info{htmldocs}->{man3}} ),
|
|
|
|
( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN5]" }
|
|
|
|
@{$unified_info{htmldocs}->{man5}} ),
|
|
|
|
( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN7]" }
|
|
|
|
@{$unified_info{htmldocs}->{man7}} )) -}
|
2016-05-19 22:33:58 +08:00
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
check_INSTALLTOP :
|
|
|
|
@ IF "$(INSTALLTOP)" .EQS. "" THEN -
|
|
|
|
WRITE SYS$ERROR "INSTALLTOP should not be empty"
|
|
|
|
@ IF "$(INSTALLTOP)" .EQS. "" THEN -
|
|
|
|
EXIT %x10000002
|
|
|
|
|
|
|
|
# Developer targets ##################################################
|
|
|
|
|
|
|
|
debug_logicals :
|
2016-05-24 00:35:23 +08:00
|
|
|
SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
# Building targets ###################################################
|
|
|
|
|
2022-02-23 18:00:39 +08:00
|
|
|
descrip.mms : configdata.pm {- join(" ", @{$config{build_file_templates}}) -}
|
|
|
|
perl configdata.pm
|
|
|
|
@ WRITE SYS$OUTPUT "*************************************************"
|
|
|
|
@ WRITE SYS$OUTPUT "*** ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*** ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*************************************************"
|
|
|
|
@ PIPE ( EXIT %X10000000 )
|
|
|
|
|
|
|
|
configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_infos}}, @{$config{conf_files}}) -}
|
2018-02-03 03:33:13 +08:00
|
|
|
perl configdata.pm -r
|
2016-01-30 14:14:58 +08:00
|
|
|
@ WRITE SYS$OUTPUT "*************************************************"
|
|
|
|
@ WRITE SYS$OUTPUT "*** ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*** ***"
|
|
|
|
@ WRITE SYS$OUTPUT "*************************************************"
|
2016-02-19 09:30:51 +08:00
|
|
|
@ PIPE ( EXIT %X10000000 )
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-02-01 17:35:59 +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 14:14:58 +08:00
|
|
|
{-
|
|
|
|
use File::Basename;
|
|
|
|
use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
|
2021-05-17 22:56:28 +08:00
|
|
|
use File::Spec::Unix;
|
2016-03-07 21:38:54 +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-11-10 03:01:51 +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 {
|
2018-10-23 21:00:36 +08:00
|
|
|
# Depending on shared libraries:
|
|
|
|
# On Windows POSIX layers, we depend on {libname}.dll.a
|
|
|
|
# On Unix platforms, we depend on {shlibname}.so
|
2019-01-31 01:18:34 +08:00
|
|
|
return map {
|
|
|
|
{ lib => platform->sharedlib($_) // platform->staticlib($_),
|
2019-10-04 05:30:58 +08:00
|
|
|
attrs => $unified_info{attributes}->{libraries}->{$_} }
|
2019-01-31 01:18:34 +08:00
|
|
|
} @_;
|
2016-11-10 03:01:51 +08:00
|
|
|
}
|
|
|
|
|
2018-02-14 03:47:34 +08:00
|
|
|
# Helper function to deal with inclusion directory specs.
|
2021-05-17 22:56:28 +08:00
|
|
|
# We're dealing with two issues:
|
|
|
|
# 1. A lot of include directory specs take up a lot of command line real
|
|
|
|
# estate, and the DCL command line is very limited (2KiB).
|
|
|
|
# 2. For optimal usage, include directory paths must be in Unix form,
|
|
|
|
# that's the only way the C compiler can merge multiple include paths
|
|
|
|
# in a sane way (we can stop worrying about 1.h including foo/2.h
|
|
|
|
# including ../3.h).
|
|
|
|
#
|
|
|
|
# To resolve 1, we need to create a file with include directory pragmas,
|
|
|
|
# and let the compiler use it with /FIRST_INCLUDE=.
|
|
|
|
# To resolve 2, we convert all include directory specs we get to Unix,
|
|
|
|
# with available File::Spec functions.
|
2018-02-14 03:47:34 +08:00
|
|
|
#
|
2021-05-17 22:56:28 +08:00
|
|
|
# We use CRC-24 from https://tools.ietf.org/html/rfc4880#section-6,
|
|
|
|
# reimplemented in Perl to get a workable and constant file name for each
|
|
|
|
# combination of include directory specs. It is assumed that the order of
|
|
|
|
# these directories don't matter.
|
|
|
|
#
|
|
|
|
# This function takes as input a list of include directories
|
|
|
|
# This function returns a list two things:
|
|
|
|
# 1. The file name to use with /FIRST_INCLUDE=
|
|
|
|
# 2. Text to insert into descrip.mms (may be the empty string)
|
|
|
|
sub crc24 {
|
|
|
|
my $input = shift;
|
|
|
|
|
|
|
|
my $init_value = 0x00B704CE;
|
|
|
|
my $poly_value = 0x01864CFB;
|
|
|
|
|
|
|
|
my $crc = $init_value;
|
|
|
|
|
|
|
|
foreach my $x (unpack ('C*', $input)) {
|
|
|
|
$crc ^= $x << 16;
|
|
|
|
|
|
|
|
for (my $i; $i < 8; $i++) {
|
|
|
|
$crc <<= 1;
|
|
|
|
if ($crc & 0x01000000) {
|
|
|
|
$crc ^= $poly_value;
|
|
|
|
}
|
2018-02-14 03:47:34 +08:00
|
|
|
}
|
|
|
|
}
|
2021-05-17 22:56:28 +08:00
|
|
|
$crc &= 0xFFFFFF;
|
|
|
|
|
|
|
|
return $crc;
|
|
|
|
}
|
|
|
|
my %includefile_cache;
|
|
|
|
sub make_includefile {
|
|
|
|
my %dirs = map {
|
|
|
|
my $udir = make_unix_path(rel2abs($_));
|
|
|
|
|
|
|
|
$udir => 1;
|
|
|
|
} @_;
|
|
|
|
my @dirs = sort keys %dirs;
|
|
|
|
my $filename = sprintf 'incdirs_%x.h', crc24(join(',', @dirs));
|
|
|
|
|
|
|
|
if ($includefile_cache{$filename}) {
|
|
|
|
return ($filename, "");
|
|
|
|
}
|
|
|
|
|
|
|
|
my $scripture = <<"EOF";
|
|
|
|
$filename :
|
|
|
|
open/write inc_output $filename
|
|
|
|
EOF
|
|
|
|
foreach (@dirs) {
|
|
|
|
$scripture .= <<"EOF";
|
|
|
|
write inc_output "#pragma include_directory ""$_"""
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
$scripture .= <<"EOF";
|
|
|
|
close inc_output
|
|
|
|
EOF
|
|
|
|
$includefile_cache{$filename} = $scripture;
|
|
|
|
|
|
|
|
return ($filename, $scripture);
|
2018-02-14 03:47:34 +08:00
|
|
|
}
|
|
|
|
|
2022-02-23 16:05:10 +08:00
|
|
|
# On VMS, (some) header file directories include the files
|
|
|
|
# __DECC_INCLUDE_EPILOGUE.H and __DECC_INCLUDE_PROLOGUE.H.
|
|
|
|
# When header files are generated, and the build directory
|
|
|
|
# isn't the same as the source directory, these files must
|
|
|
|
# be copied alongside the generated header file, or their
|
|
|
|
# effect will be lost.
|
|
|
|
# We use the same include file cache as make_includefile
|
|
|
|
# to check if the scripture to copy these files has already
|
|
|
|
# been generated.
|
|
|
|
sub make_decc_include_files {
|
|
|
|
my $outd = shift;
|
|
|
|
my $ind = shift;
|
|
|
|
|
|
|
|
# If the build directory and the source directory are the
|
|
|
|
# same, there's no need to copy the prologue and epilogue
|
|
|
|
# files.
|
|
|
|
return ('') if $outd eq $ind;
|
|
|
|
|
|
|
|
my $outprologue = catfile($outd, '__DECC_INCLUDE_PROLOGUE.H');
|
|
|
|
my $outepilogue = catfile($outd, '__DECC_INCLUDE_EPILOGUE.H');
|
|
|
|
my $inprologue = catfile($ind, '__DECC_INCLUDE_PROLOGUE.H');
|
|
|
|
my $inepilogue = catfile($ind, '__DECC_INCLUDE_EPILOGUE.H');
|
|
|
|
my @filenames = ();
|
|
|
|
my $scripture = '';
|
|
|
|
|
|
|
|
if ($includefile_cache{$outprologue}) {
|
|
|
|
push @filenames, $outprologue;
|
|
|
|
} elsif (-f $inprologue) {
|
|
|
|
my $local_scripture .= <<"EOF";
|
|
|
|
$outprologue : $inprologue
|
|
|
|
COPY $inprologue $outprologue
|
|
|
|
EOF
|
|
|
|
$includefile_cache{$outprologue} = $local_scripture;
|
|
|
|
|
|
|
|
push @filenames, $outprologue;
|
|
|
|
$scripture .= $local_scripture;
|
|
|
|
}
|
|
|
|
if ($includefile_cache{$outepilogue}) {
|
|
|
|
push @filenames, $outepilogue;
|
|
|
|
} elsif (-f $inepilogue) {
|
|
|
|
my $local_scripture .= <<"EOF";
|
|
|
|
$outepilogue : $inepilogue
|
|
|
|
COPY $inepilogue $outepilogue
|
|
|
|
EOF
|
|
|
|
$includefile_cache{$outepilogue} = $local_scripture;
|
|
|
|
|
|
|
|
push @filenames, $outepilogue;
|
|
|
|
$scripture .= $local_scripture;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (@filenames, $scripture);
|
|
|
|
}
|
|
|
|
|
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}});
|
2021-05-24 20:19:38 +08:00
|
|
|
my $deps = join(", -\n\t\t",
|
|
|
|
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;
|
|
|
|
my $mkpod2html = sourcefile('util', 'mkpod2html.pl');
|
2021-08-23 20:12:28 +08:00
|
|
|
my $srcdoc = sourcedir('doc');
|
2021-02-26 00:43:57 +08:00
|
|
|
return <<"EOF";
|
2021-05-17 20:53:48 +08:00
|
|
|
$args{src} : $pod
|
2021-08-23 20:12:28 +08:00
|
|
|
\$(PERL) $mkpod2html -i $pod -o \$\@ -t "$title" -r "$srcdoc"
|
2016-09-01 04:57:25 +08:00
|
|
|
EOF
|
2021-05-17 20:53:48 +08:00
|
|
|
} elsif ($args{src} =~ /\.(\d)$/) {
|
|
|
|
#
|
|
|
|
# Man-page generator, on VMS we simply ignore man-pages
|
|
|
|
#
|
|
|
|
return "";
|
2016-09-01 04:57:25 +08:00
|
|
|
} elsif (platform->isdef($args{src})) {
|
2021-02-26 00:43:57 +08:00
|
|
|
#
|
|
|
|
# Linker script-ish generator
|
|
|
|
#
|
2018-10-23 21:00:36 +08:00
|
|
|
my $target = platform->def($args{src});
|
2018-09-30 20:44:59 +08:00
|
|
|
my $mkdef = sourcefile('util', 'mkdef.pl');
|
2021-09-08 15:40:37 +08:00
|
|
|
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION_NUMBER)' : '';
|
2018-10-04 23:41:12 +08:00
|
|
|
my $ord_name =
|
|
|
|
$args{generator}->[1] || basename($args{product}, '.EXE');
|
2018-10-05 06:10:35 +08:00
|
|
|
my $case_insensitive =
|
|
|
|
$target{$args{intent}.'_cflags'} =~ m|/NAMES=[^/]*AS_IS|i
|
|
|
|
? '' : ' --case-insensitive';
|
2018-09-30 20:44:59 +08:00
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$target : $gen0 $deps $mkdef
|
2022-05-10 20:39:19 +08:00
|
|
|
\$(PERL) $mkdef$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name "--OS" "VMS"$case_insensitive > $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
|
|
|
|
#
|
2021-05-18 00:21:45 +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}};
|
2016-10-14 23:10:15 +08:00
|
|
|
my $defs = join("", map { ",".$_ } @{$args{defs}});
|
2022-11-03 22:24:52 +08:00
|
|
|
my $target = platform->isasm($args{src})
|
|
|
|
? platform->asm($args{src})
|
|
|
|
: $args{src};
|
2019-09-13 05:58:07 +08:00
|
|
|
|
2021-02-26 00:43:57 +08:00
|
|
|
my $generator;
|
|
|
|
if ($gen0 =~ /\.pl$/) {
|
|
|
|
$generator = '$(PERL)'.$gen_incs.' '.$gen0.$gen_args
|
2019-09-13 05:58:07 +08:00
|
|
|
.' '.$cppflags;
|
2021-02-26 00:43:57 +08:00
|
|
|
} elsif ($gen0 =~ /\.S$/) {
|
2019-09-13 05:58:07 +08:00
|
|
|
$generator = undef;
|
|
|
|
} else {
|
2021-02-26 00:43:57 +08:00
|
|
|
die "Generator type for $src unknown: $gen0.$gen_args\n";
|
2019-09-13 05:58:07 +08:00
|
|
|
}
|
|
|
|
|
2018-02-14 03:47:34 +08:00
|
|
|
if (defined($generator)) {
|
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$target : $gen0 $deps
|
2019-09-13 05:58:07 +08:00
|
|
|
\@ extradefines = "$defs"
|
2018-02-14 03:47:34 +08:00
|
|
|
$generator \$\@
|
2019-09-13 05:58:07 +08:00
|
|
|
\@ DELETE/SYMBOL/LOCAL extradefines
|
2018-02-14 03:47:34 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
return <<"EOF";
|
2021-02-26 00:43:57 +08:00
|
|
|
$target : $gen0 $deps
|
2016-10-14 23:10:15 +08:00
|
|
|
\@ extradefines = "$defs"
|
2021-02-26 00:43:57 +08:00
|
|
|
PIPE \$(CPP) $cppflags $gen0 | -
|
2018-02-14 03:47:34 +08:00
|
|
|
\$(PERL) "-ne" "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" > \$\@
|
2016-10-14 23:10:15 +08:00
|
|
|
\@ DELETE/SYMBOL/LOCAL extradefines
|
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}));
|
2021-05-24 20:19:38 +08:00
|
|
|
my @perlmodules = ( 'configdata.pm',
|
|
|
|
grep { $_ =~ m|\.pm$| } @{$args{deps}} );
|
|
|
|
my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules;
|
2022-02-23 16:05:10 +08:00
|
|
|
my @decc_include_data
|
|
|
|
= make_decc_include_files(dirname($args{src}), dirname($gen0));
|
|
|
|
my $decc_include_scripture = pop @decc_include_data;
|
|
|
|
$deps = join(' ', $deps, @decc_include_data,
|
|
|
|
compute_platform_depends(@perlmodules));
|
2021-05-24 20:19:38 +08:00
|
|
|
@perlmodules = map { '"-M'.basename($_, '.pm').'"' } @perlmodules;
|
|
|
|
my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
|
2022-02-23 16:05:10 +08:00
|
|
|
|
2021-02-26 00:43:57 +08:00
|
|
|
return <<"EOF";
|
2021-05-17 20:53:48 +08:00
|
|
|
$args{src} : $gen0 $deps
|
2021-05-24 20:19:38 +08:00
|
|
|
\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
|
2022-02-23 16:05:10 +08:00
|
|
|
$decc_include_scripture
|
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
|
2021-02-26 00:43:57 +08:00
|
|
|
$gen0 = platform->bin($gen0);
|
|
|
|
return <<"EOF";
|
2021-05-17 20:53:48 +08:00
|
|
|
$args{src} : $gen0 $deps
|
2021-05-21 11:52:01 +08:00
|
|
|
PIPE MCR $gen0$gen_args > \$@
|
2021-02-26 00:43:57 +08:00
|
|
|
EOF
|
|
|
|
} else {
|
|
|
|
#
|
|
|
|
# Generic generator using Perl
|
|
|
|
#
|
|
|
|
return <<"EOF";
|
2021-05-17 20:53:48 +08:00
|
|
|
$args{src} : $gen0 $deps
|
2021-02-26 00:43:57 +08:00
|
|
|
\$(PERL)$gen_incs $gen0$gen_args > \$\@
|
2018-02-14 03:47:34 +08:00
|
|
|
EOF
|
2016-03-07 21:38:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-30 14:14:58 +08:00
|
|
|
sub src2obj {
|
2019-03-19 21:43:31 +08:00
|
|
|
my $asmext = platform->asmext();
|
2016-01-30 14:14:58 +08:00
|
|
|
my %args = @_;
|
2019-03-19 21:43:31 +08:00
|
|
|
my @srcs =
|
|
|
|
map { my $x = $_;
|
|
|
|
(platform->isasm($x) && grep { $x eq $_ } @generated)
|
|
|
|
? platform->asm($x) : $x }
|
|
|
|
( @{$args{srcs}} );
|
2018-10-23 21:00:36 +08:00
|
|
|
my $obj = platform->obj($args{obj});
|
2019-03-19 21:43:31 +08:00
|
|
|
my $dep = platform->dep($args{obj});
|
2018-02-14 03:47:34 +08:00
|
|
|
my $deps = join(", -\n\t\t", @srcs, @{$args{deps}});
|
2016-01-30 14:14:58 +08:00
|
|
|
|
|
|
|
# Because VMS C isn't very good at combining a /INCLUDE path with
|
|
|
|
# #includes having a relative directory (like '#include "../foo.h"),
|
|
|
|
# the best choice is to move to the first source file's intended
|
|
|
|
# directory before compiling, and make sure to write the object file
|
|
|
|
# in the correct position (important when the object tree is other
|
|
|
|
# than the source tree).
|
|
|
|
my $forward = dirname($args{srcs}->[0]);
|
|
|
|
my $backward = abs2rel(rel2abs("."), rel2abs($forward));
|
|
|
|
my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
|
2019-03-19 21:43:31 +08:00
|
|
|
my $objn = basename($obj);
|
|
|
|
my $depd = abs2rel(rel2abs(dirname($dep)), rel2abs($forward));
|
|
|
|
my $depn = basename($dep);
|
2016-01-30 14:14:58 +08:00
|
|
|
my $srcs =
|
2018-02-14 03:47:34 +08:00
|
|
|
join(", ", map { abs2rel(rel2abs($_), rel2abs($forward)) } @srcs);
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
my $incextra = join(',', map { "\"$_\"" }
|
|
|
|
@{$unified_info{includes_extra}->{$obj}});
|
|
|
|
$incextra = "/INCLUDE=($incextra)" if $incextra;
|
2018-10-23 21:00:36 +08:00
|
|
|
|
2018-02-14 03:47:34 +08:00
|
|
|
my $cflags;
|
2019-01-22 22:46:54 +08:00
|
|
|
if ($args{attrs}->{noinst}) {
|
2021-05-18 00:21:45 +08:00
|
|
|
$cflags .= { shlib => $lib_cflags_no_inst,
|
|
|
|
lib => $lib_cflags_no_inst,
|
|
|
|
dso => $dso_cflags_no_inst,
|
|
|
|
bin => $bin_cflags_no_inst } -> {$args{intent}};
|
2019-01-22 22:46:54 +08:00
|
|
|
} else {
|
2021-05-18 00:21:45 +08:00
|
|
|
$cflags .= { shlib => $lib_cflags,
|
|
|
|
lib => $lib_cflags,
|
|
|
|
dso => $dso_cflags,
|
|
|
|
bin => $bin_cflags } -> {$args{intent}};
|
2016-09-09 01:23:38 +08:00
|
|
|
}
|
2021-05-18 00:21:45 +08:00
|
|
|
$cflags .= { shlib => $lib_cppflags,
|
|
|
|
lib => $lib_cppflags,
|
|
|
|
dso => $dso_cppflags,
|
|
|
|
bin => $bin_cppflags } -> {$args{intent}};
|
Configurations/descrip.mms.tmpl: rework the inclusion hacks
Because VMS C has some trouble with recursive inclusion of header
files, we have had to help it out for object files where there is such
an inclusion structure.
Previously, we did so with temporary logical names that were the same
as the first directory in an inclusion, so for example, to enable this
inclusion (found in ssl/ssl_local.h), we created the logical name
"record" when building any of the object files in the ssl/
subdirectories:
#include "record/record.h"
However, there is another way with the VMS C compiler, to selectively
specify extra include directories in Unix form directly to the
compiler. The logic is that from the directory where the source file
to compile is located, the specified inclusion directory merged with
the inclusion string should be able to access to specified header
file.
So for example, when a file in ssl/record/ is compiled, the following
inclusion is found:
#include "../ssl_local.h"
So far so good, VMS C handles it properly. However, the recursive
inclusion of "record/record.h" fails. However, if the compiler is
helped out a little bit, with the following extra qualifier, then it
works:
/INCLUDE="../"
The reason is that the compiler merges "../" and "record/record.h"
into "../record/record.h", which is the correct path to that header
file from the directory of the source file being compiled.
All that remained was to figure out all places where this trouble may
occur, and specify extra Unix formatted inclusion directories to
specify on per object file basis.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15369)
2021-05-19 16:57:48 +08:00
|
|
|
$cflags .= $incextra;
|
2016-10-14 23:10:15 +08:00
|
|
|
my $defs = join("", map { ",".$_ } @{$args{defs}});
|
2021-05-18 00:21:45 +08:00
|
|
|
my $asflags = { shlib => $lib_asflags,
|
|
|
|
lib => $lib_asflags,
|
|
|
|
dso => $dso_asflags,
|
|
|
|
bin => $bin_asflags } -> {$args{intent}};
|
2018-02-14 03:47:34 +08:00
|
|
|
|
2019-03-19 21:43:31 +08:00
|
|
|
if ($srcs[0] =~ /\Q${asmext}\E$/) {
|
2018-12-13 04:22:29 +08:00
|
|
|
return <<"EOF";
|
2019-03-19 21:43:31 +08:00
|
|
|
$obj : $deps
|
2018-12-13 04:22:29 +08:00
|
|
|
SET DEFAULT $forward
|
2019-03-19 21:43:31 +08:00
|
|
|
\$(AS) $asflags \$(ASOUTFLAG)${objd}${objn} $srcs
|
2018-12-13 04:22:29 +08:00
|
|
|
SET DEFAULT $backward
|
2019-03-19 21:43:31 +08:00
|
|
|
- PURGE $obj
|
2018-12-13 04:22:29 +08:00
|
|
|
EOF
|
|
|
|
} elsif ($srcs[0] =~ /.S$/) {
|
|
|
|
return <<"EOF";
|
2019-03-19 21:43:31 +08:00
|
|
|
$obj : $deps
|
2018-12-13 04:22:29 +08:00
|
|
|
SET DEFAULT $forward
|
|
|
|
\@ $incs_on
|
|
|
|
\@ extradefines = "$defs"
|
|
|
|
PIPE \$(CPP) ${cflags} $srcs | -
|
|
|
|
\$(PERL) -ne "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" -
|
2019-03-19 21:43:31 +08:00
|
|
|
> ${objd}${objn}-asm
|
2018-12-13 04:22:29 +08:00
|
|
|
\@ DELETE/SYMBOL/LOCAL extradefines
|
|
|
|
\@ $incs_off
|
|
|
|
SET DEFAULT $backward
|
2019-03-19 21:43:31 +08:00
|
|
|
\$(AS) $asflags \$(ASOUTFLAG)$obj $obj-asm
|
|
|
|
- PURGE $obj
|
2018-12-13 04:22:29 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2021-05-17 22:56:28 +08:00
|
|
|
my ($incdir_filename, $incdir_scripture) =
|
|
|
|
make_includefile(@{ { shlib => [ @lib_cppincludes ],
|
|
|
|
lib => [ @lib_cppincludes ],
|
|
|
|
dso => [ @dso_cppincludes ],
|
|
|
|
bin => [ @bin_cppincludes ] } -> {$args{intent}} },
|
|
|
|
@{$args{incs}});
|
|
|
|
$deps .= ", -\n\t\t$incdir_filename";
|
|
|
|
$cflags =
|
|
|
|
$target{cflag_incfirst}
|
|
|
|
. '"'.make_unix_path(rel2abs($incdir_filename)).'"'
|
|
|
|
. $cflags;
|
|
|
|
|
2016-03-09 08:16:10 +08:00
|
|
|
my $depbuild = $disabled{makedepend} ? ""
|
2019-03-19 21:43:31 +08:00
|
|
|
: " /MMS=(FILE=${depd}${depn},TARGET=$obj)";
|
2016-01-30 14:14:58 +08:00
|
|
|
|
2018-03-16 01:06:18 +08:00
|
|
|
return <<"EOF";
|
2018-10-23 21:00:36 +08:00
|
|
|
$obj : $deps
|
2016-02-19 09:34:20 +08:00
|
|
|
SET DEFAULT $forward
|
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
|
|
|
\@ $incs_on
|
2016-10-14 23:10:15 +08:00
|
|
|
\@ extradefines = "$defs"
|
2019-03-19 21:43:31 +08:00
|
|
|
\$(CC) ${cflags}${depbuild} /OBJECT=${objd}${objn} /REPOSITORY=$backward $srcs
|
2016-10-14 23:10:15 +08:00
|
|
|
\@ DELETE/SYMBOL/LOCAL extradefines
|
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
|
|
|
\@ $incs_off
|
2016-01-30 14:14:58 +08:00
|
|
|
SET DEFAULT $backward
|
2018-10-23 21:00:36 +08:00
|
|
|
- PURGE $obj
|
2021-05-17 22:56:28 +08:00
|
|
|
$incdir_scripture
|
2017-12-12 04:01:18 +08:00
|
|
|
EOF
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
2018-09-12 16:59:06 +08:00
|
|
|
sub obj2shlib {
|
2016-01-30 14:14:58 +08:00
|
|
|
my %args = @_;
|
2018-10-23 21:00:36 +08:00
|
|
|
my $shlibname = platform->sharedname($args{lib});
|
|
|
|
my $shlib = platform->sharedlib($args{lib});
|
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) }
|
2017-12-20 18:02:39 +08:00
|
|
|
@{$args{objs}};
|
2018-10-23 21:00:36 +08:00
|
|
|
my @defs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-09-30 20:44:59 +08:00
|
|
|
@{$args{objs}};
|
2016-11-10 03:01:51 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
2017-12-04 21:27:58 +08:00
|
|
|
die "More than one symbol vector" if scalar @defs > 1;
|
2019-01-31 01:18:34 +08:00
|
|
|
my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
|
2016-02-22 20:52:46 +08:00
|
|
|
my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
|
2016-01-30 14:14:58 +08:00
|
|
|
my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"VMS", "translatesyms.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
# The "[]" hack is because in .OPT files, each line inherits the
|
|
|
|
# previous line's file spec as default, so if no directory spec
|
|
|
|
# is present in the current line and the previous line has one that
|
|
|
|
# doesn't apply, you're in for a surprise.
|
2017-12-20 18:02:39 +08:00
|
|
|
my $write_opt1 =
|
|
|
|
join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
|
|
|
|
"WRITE OPT_FILE \"$x" } @objs).
|
|
|
|
"\"";
|
|
|
|
my $write_opt2 =
|
2019-01-31 01:18:34 +08:00
|
|
|
join("\n\t", map { my $x = $_->{lib} =~ /\[/
|
|
|
|
? $_->{lib} : "[]".$_->{lib};
|
2016-01-30 14:14:58 +08:00
|
|
|
$x =~ s|(\.EXE)|$1/SHARE|;
|
2016-02-20 06:49:05 +08:00
|
|
|
$x =~ s|(\.OLB)|$1/LIB|;
|
2016-01-30 14:14:58 +08:00
|
|
|
"WRITE OPT_FILE \"$x\"" } @deps)
|
|
|
|
|| "\@ !";
|
2017-03-16 00:10:48 +08:00
|
|
|
return <<"EOF"
|
2018-10-23 21:00:36 +08:00
|
|
|
$shlib : $deps
|
2017-12-04 21:27:58 +08:00
|
|
|
\$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $defs[0] > $defs[0]-translated
|
2018-10-23 21:00:36 +08:00
|
|
|
OPEN/WRITE/SHARE=READ OPT_FILE $shlibname-components.OPT
|
2017-12-20 18:02:39 +08:00
|
|
|
$write_opt1
|
|
|
|
$write_opt2
|
|
|
|
CLOSE OPT_FILE
|
2021-05-18 00:21:45 +08:00
|
|
|
LINK ${lib_ldflags}/SHARE=\$\@ $defs[0]-translated/OPT,-
|
2018-10-23 21:00:36 +08:00
|
|
|
$shlibname-components.OPT/OPT \$(LIB_EX_LIBS)
|
|
|
|
DELETE $defs[0]-translated;*,$shlibname-components.OPT;*
|
|
|
|
PURGE $shlibname.EXE,$shlibname.MAP
|
2016-01-30 14:14:58 +08:00
|
|
|
EOF
|
2017-03-16 00:10:48 +08:00
|
|
|
. ($config{target} =~ m|alpha| ? "" : <<"EOF"
|
|
|
|
SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
|
|
|
|
EOF
|
|
|
|
);
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
2016-02-16 01:45:54 +08:00
|
|
|
sub obj2dso {
|
2016-01-30 14:14:58 +08:00
|
|
|
my %args = @_;
|
2019-10-04 05:30:58 +08:00
|
|
|
my $dsoname = platform->dsoname($args{module});
|
|
|
|
my $dso = platform->dso($args{module});
|
2018-10-23 21:00:36 +08:00
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) }
|
2018-10-04 23:41:12 +08:00
|
|
|
@{$args{objs}};
|
2018-10-23 21:00:36 +08:00
|
|
|
my @defs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-10-04 23:41:12 +08:00
|
|
|
@{$args{objs}};
|
2016-11-10 03:01:51 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
2019-01-31 01:18:34 +08:00
|
|
|
my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
|
2018-10-04 23:41:12 +08:00
|
|
|
die "More than one symbol vector" if scalar @defs > 1;
|
2016-02-22 20:52:46 +08:00
|
|
|
my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
|
2016-01-30 14:14:58 +08:00
|
|
|
# The "[]" hack is because in .OPT files, each line inherits the
|
|
|
|
# previous line's file spec as default, so if no directory spec
|
|
|
|
# is present in the current line and the previous line has one that
|
|
|
|
# doesn't apply, you're in for a surprise.
|
2022-10-01 17:18:57 +08:00
|
|
|
# Furthermore, we collect all object files and static libraries in
|
|
|
|
# an explicit cluster, to make it clear to the linker that these files
|
|
|
|
# shall be processed before shareable images.
|
|
|
|
# The shareable images are used with /SELECTIVE, to avoid warnings of
|
|
|
|
# multiply defined symbols when the module object files override some
|
|
|
|
# symbols that are present in the shareable image.
|
2016-09-21 07:49:53 +08:00
|
|
|
my $write_opt1 =
|
2022-10-01 17:18:57 +08:00
|
|
|
join(",-\"\n\t",
|
|
|
|
"\@ WRITE OPT_FILE \"CLUSTER=_,,",
|
|
|
|
(map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
|
|
|
|
"\@ WRITE OPT_FILE \"$x" } @objs),
|
|
|
|
(map { my $x = ($_->{lib} =~ /\[/) ? $_->{lib} : "[]".$_->{lib};
|
|
|
|
"\@ WRITE OPT_FILE \"$x/LIB" }
|
|
|
|
grep { $_->{lib} =~ m|\.OLB$| }
|
|
|
|
@deps))
|
|
|
|
."\"";
|
2016-09-21 07:49:53 +08:00
|
|
|
my $write_opt2 =
|
2022-10-01 17:18:57 +08:00
|
|
|
join("\n\t",
|
|
|
|
(map { my $x = ($_->{lib} =~ /\[/) ? $_->{lib} : "[]".$_->{lib};
|
|
|
|
"\@ WRITE OPT_FILE \"$x/SHARE/SELECTIVE\"" }
|
|
|
|
grep { $_->{lib} =~ m|\.EXE$| }
|
|
|
|
@deps))
|
2016-01-30 14:14:58 +08:00
|
|
|
|| "\@ !";
|
2017-03-16 00:10:48 +08:00
|
|
|
return <<"EOF"
|
2018-10-23 21:00:36 +08:00
|
|
|
$dso : $deps
|
|
|
|
OPEN/WRITE/SHARE=READ OPT_FILE $dsoname-components.OPT
|
2016-09-21 07:49:53 +08:00
|
|
|
$write_opt1
|
|
|
|
$write_opt2
|
2016-01-30 14:14:58 +08:00
|
|
|
CLOSE OPT_FILE
|
2021-05-18 00:21:45 +08:00
|
|
|
LINK ${dso_ldflags}/SHARE=\$\@ $defs[0]/OPT,-
|
2018-10-23 21:00:36 +08:00
|
|
|
$dsoname-components.OPT/OPT \$(DSO_EX_LIBS)
|
|
|
|
- PURGE $dsoname.EXE,$dsoname.OPT,$dsoname.MAP
|
2016-01-30 14:14:58 +08:00
|
|
|
EOF
|
2017-03-16 00:10:48 +08:00
|
|
|
. ($config{target} =~ m|alpha| ? "" : <<"EOF"
|
|
|
|
SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
|
|
|
|
EOF
|
|
|
|
);
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
|
|
|
sub obj2lib {
|
|
|
|
my %args = @_;
|
2018-10-23 21:00:36 +08:00
|
|
|
my $lib = platform->staticlib($args{lib});
|
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) }
|
|
|
|
@{$args{objs}};
|
2017-12-04 21:27:58 +08:00
|
|
|
my $objs = join(", -\n\t\t", @objs);
|
2018-10-23 21:00:36 +08:00
|
|
|
my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib $_" } @objs));
|
2016-01-30 14:14:58 +08:00
|
|
|
return <<"EOF";
|
2018-10-23 21:00:36 +08:00
|
|
|
$lib : $objs
|
|
|
|
LIBRARY/CREATE/OBJECT $lib
|
2016-01-30 14:14:58 +08:00
|
|
|
$fill_lib
|
2018-10-23 21:00:36 +08:00
|
|
|
- PURGE $lib
|
2016-01-30 14:14:58 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2bin {
|
|
|
|
my %args = @_;
|
2018-10-23 21:00:36 +08:00
|
|
|
my $bin = platform->bin($args{bin});
|
|
|
|
my $binname = platform->binname($args{bin});
|
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) }
|
|
|
|
@{$args{objs}};
|
2017-04-19 18:32:42 +08:00
|
|
|
my $objs = join(",", @objs);
|
2016-11-10 03:01:51 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
2019-01-31 01:18:34 +08:00
|
|
|
my $deps = join(", -\n\t\t", @objs, map { $_->{lib} } @deps);
|
2017-04-19 18:32:42 +08:00
|
|
|
|
2019-01-31 01:18:34 +08:00
|
|
|
my $olb_count = scalar grep(m|\.OLB$|, map { $_->{lib} } @deps);
|
2017-04-19 18:32:42 +08:00
|
|
|
my $analyse_objs = "@ !";
|
|
|
|
if ($olb_count > 0) {
|
|
|
|
my $analyse_quals =
|
|
|
|
$config{target} =~ m|alpha| ? "/GSD" : "/SECTIONS=SYMTAB";
|
|
|
|
$analyse_objs = "- pipe ANALYSE/OBJECT$analyse_quals $objs | SEARCH SYS\$INPUT \"\"\"main\"\"\" ; nomain = \$severity .NE. 1"
|
|
|
|
}
|
2016-01-30 14:14:58 +08:00
|
|
|
# The "[]" hack is because in .OPT files, each line inherits the
|
|
|
|
# previous line's file spec as default, so if no directory spec
|
|
|
|
# is present in the current line and the previous line has one that
|
|
|
|
# doesn't apply, you're in for a surprise.
|
2016-09-21 07:49:53 +08:00
|
|
|
my $write_opt1 =
|
2022-10-01 17:18:57 +08:00
|
|
|
"\@ WRITE OPT_FILE \"CASE_SENSITIVE=YES\"\n\t"
|
|
|
|
.join(",-\"\n\t",
|
|
|
|
"\@ WRITE OPT_FILE \"CLUSTER=_,,",
|
|
|
|
(map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
|
|
|
|
"\@ WRITE OPT_FILE \"$x" } @objs),
|
|
|
|
(map { my $x = ($_->{lib} =~ /\[/) ? $_->{lib} : "[]".$_->{lib};
|
2022-10-05 18:47:32 +08:00
|
|
|
# Special hack to include the MAIN object module
|
|
|
|
# explicitly, if it's known that there is one.
|
|
|
|
# |incmain| is defined in the rule generation further
|
|
|
|
# down, with the necessary /INCLUDE=main option unless
|
|
|
|
# the program has been determined to have a main function
|
|
|
|
# already.
|
|
|
|
$_->{attrs}->{has_main}
|
|
|
|
? "\@ WRITE OPT_FILE \"$x/LIB''incmain'"
|
|
|
|
: "\@ WRITE OPT_FILE \"$x/LIB" }
|
2022-10-01 17:18:57 +08:00
|
|
|
grep { $_->{lib} =~ m|\.OLB$| }
|
|
|
|
@deps))
|
|
|
|
."\"";
|
2016-09-21 07:49:53 +08:00
|
|
|
my $write_opt2 =
|
2022-10-01 17:18:57 +08:00
|
|
|
join("\n\t",
|
|
|
|
(map { my $x = $_->{lib} =~ /\[/ ? $_->{lib} : "[]".$_->{lib};
|
|
|
|
"\@ WRITE OPT_FILE \"$x/SHARE/SELECTIVE\"" }
|
|
|
|
grep { $_->{lib} =~ m|\.EXE$| }
|
|
|
|
@deps))
|
2016-01-30 14:14:58 +08:00
|
|
|
|| "\@ !";
|
2016-10-27 04:31:29 +08:00
|
|
|
# The linking commands looks a bit complex, but it's for good reason.
|
|
|
|
# When you link, say, foo.obj, bar.obj and libsomething.exe/share, and
|
|
|
|
# bar.obj happens to have a symbol that also exists in libsomething.exe,
|
|
|
|
# the linker will warn about it, loudly, and will then choose to pick
|
|
|
|
# the first copy encountered (the one in bar.obj in this example).
|
2018-05-06 23:50:23 +08:00
|
|
|
# On Unix and on Windows, the corresponding maneuver goes through
|
2016-10-27 04:31:29 +08:00
|
|
|
# silently with the same effect.
|
|
|
|
# With some test programs, made for checking the internals of OpenSSL,
|
|
|
|
# we do this kind of linking deliberately, picking a few specific object
|
|
|
|
# files from within [.crypto] or [.ssl] so we can reach symbols that are
|
|
|
|
# otherwise unreachable (since the shareable images only exports the
|
|
|
|
# symbols listed in [.util]*.num), and then with the shared libraries
|
|
|
|
# themselves. So we need to silence the warning about multiply defined
|
|
|
|
# symbols, to mimic the way linking work on Unix and Windows, and so
|
|
|
|
# the build isn't interrupted (MMS stops when warnings are signaled,
|
|
|
|
# by default), and so someone building doesn't have to worry where it
|
|
|
|
# isn't necessary. If there are other warnings, however, we show them
|
|
|
|
# and let it break the build.
|
2017-03-16 00:10:48 +08:00
|
|
|
return <<"EOF"
|
2018-10-23 21:00:36 +08:00
|
|
|
$bin : $deps
|
2017-04-19 18:32:42 +08:00
|
|
|
$analyse_objs
|
2022-10-05 18:47:32 +08:00
|
|
|
@ incmain = "/INCLUDE=main"
|
|
|
|
@ IF .NOT. nomain THEN incmain = ""
|
2018-10-23 21:00:36 +08:00
|
|
|
@ OPEN/WRITE/SHARE=READ OPT_FILE $binname.OPT
|
2016-09-21 07:49:53 +08:00
|
|
|
$write_opt1
|
|
|
|
$write_opt2
|
2017-04-19 18:32:42 +08:00
|
|
|
@ CLOSE OPT_FILE
|
2018-10-23 21:00:36 +08:00
|
|
|
TYPE $binname.OPT ! For debugging
|
|
|
|
- pipe SPAWN/WAIT/NOLOG/OUT=$binname.LINKLOG -
|
2021-05-18 00:21:45 +08:00
|
|
|
LINK ${bin_ldflags}/EXEC=\$\@ $binname.OPT/OPT \$(BIN_EX_LIBS) ; -
|
2016-10-27 04:31:29 +08:00
|
|
|
link_status = \$status ; link_severity = link_status .AND. 7
|
|
|
|
@ search_severity = 1
|
|
|
|
-@ IF link_severity .EQ. 0 THEN -
|
2018-10-23 21:00:36 +08:00
|
|
|
pipe SEARCH $binname.LINKLOG "%","-"/MATCH=AND | -
|
2016-10-27 04:31:29 +08:00
|
|
|
SPAWN/WAIT/NOLOG/OUT=NLA0: -
|
|
|
|
SEARCH SYS\$INPUT: "-W-MULDEF,"/MATCH=NOR ; -
|
|
|
|
search_severity = \$severity
|
|
|
|
@ ! search_severity is 3 when the last search didn't find any matching
|
|
|
|
@ ! string: %SEARCH-I-NOMATCHES, no strings matched
|
2016-11-04 21:08:25 +08:00
|
|
|
@ ! If that was the result, we pretend linking got through without
|
|
|
|
@ ! fault or warning.
|
|
|
|
@ IF search_severity .EQ. 3 THEN link_severity = 1
|
|
|
|
@ ! At this point, if link_severity shows that there was a fault
|
|
|
|
@ ! or warning, make sure to restore the linking status.
|
2018-10-23 21:00:36 +08:00
|
|
|
-@ IF .NOT. link_severity THEN TYPE $binname.LINKLOG
|
|
|
|
-@ DELETE $binname.LINKLOG;*
|
2016-11-04 21:08:25 +08:00
|
|
|
@ IF .NOT. link_severity THEN SPAWN/WAIT/NOLOG EXIT 'link_status'
|
2018-10-23 21:00:36 +08:00
|
|
|
- PURGE $bin,$binname.OPT
|
2016-01-30 14:14:58 +08:00
|
|
|
EOF
|
2017-04-19 18:32:42 +08:00
|
|
|
. ($config{target} =~ m|alpha| ? "" : <<"EOF"
|
2017-03-16 00:10:48 +08:00
|
|
|
SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
|
|
|
|
EOF
|
|
|
|
);
|
2016-01-30 14:14:58 +08:00
|
|
|
}
|
|
|
|
sub in2script {
|
|
|
|
my %args = @_;
|
|
|
|
my $script = $args{script};
|
|
|
|
return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
|
|
|
|
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
|
2016-06-15 04:03:08 +08:00
|
|
|
\$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
|
2016-02-14 15:47:47 +08:00
|
|
|
"-o$target{build_file}" $sources > $script
|
2016-01-30 14:14:58 +08:00
|
|
|
SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
|
|
|
|
PURGE $script
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|