提交 98b7b741 编写于 作者: R Richard Levitte

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: NTim Hudson <tjh@openssl.org>
Reviewed-by: NPaul Dale <pauli@openssl.org>
Reviewed-by: NDmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17755)
上级 18cb1740
......@@ -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}}) {
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册