summaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2022-02-23 09:05:10 +0100
committerRichard Levitte <levitte@openssl.org>2022-02-25 07:50:51 +0100
commit98b7b74122e66f63c4ec67a74e345c64a55c68db (patch)
tree328537f650f797907e968544e9bdfd7e588fb827 /Configurations
parent18cb1740cc0fd11940836fa2fcaf6d3634c00e90 (diff)
VMS: copy prologue/epilogue headers when header files are generated
This is crucial when the build tree isn't the source tree, as they only take effect in directories where included header files reside. The issue only comes up when linking with the static libraries, since the shared libraries have upper case aliases of all symbols. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/17755)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/descrip.mms.tmpl61
1 files changed, 60 insertions, 1 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index c819733765..0c660152da 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -871,6 +871,59 @@ EOF
return ($filename, $scripture);
}
+ # 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);
+ }
+
sub generatetarget {
my %args = @_;
my $deps = join(" ", compute_platform_depends(@{$args{deps}}));
@@ -984,12 +1037,18 @@ EOF
my @perlmodules = ( 'configdata.pm',
grep { $_ =~ m|\.pm$| } @{$args{deps}} );
my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules;
- $deps = join(' ', $deps, compute_platform_depends(@perlmodules));
+ 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));
@perlmodules = map { '"-M'.basename($_, '.pm').'"' } @perlmodules;
my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
+
return <<"EOF";
$args{src} : $gen0 $deps
\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
+$decc_include_scripture
EOF
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
#