mirror of
https://github.com/openssl/openssl.git
synced 2025-03-19 19:50:42 +08:00
Refactor util/mkdef.pl for clearer separation of functionality
Move the .num updating functionality to util/mknum.pl. Rewrite util/mkdef.pl to create .def / .map / .opt files exclusively, using the separate ordinals reading module. Adapt the build files. Adapt the symbol presence test. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7191)
This commit is contained in:
parent
91a99748d3
commit
8effd8fa67
@ -760,7 +760,7 @@ reconfigure reconf :
|
||||
my $mkdef = sourcefile('util', 'mkdef.pl');
|
||||
return <<"EOF";
|
||||
$target : $args{generator}->[0] $deps
|
||||
\$(PERL) $mkdef $args{generator}->[1] "VMS" > $target
|
||||
\$(PERL) $mkdef --ordinals $args{generator}->[0] --name $args{generator}->[1] "--OS" "VMS" > $target
|
||||
EOF
|
||||
} elsif ($target !~ /\.[sS]$/) {
|
||||
my $target = $args{src};
|
||||
|
@ -810,8 +810,8 @@ errors:
|
||||
done )
|
||||
|
||||
ordinals:
|
||||
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
|
||||
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
|
||||
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mknum.pl crypto update )
|
||||
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mknum.pl ssl update )
|
||||
|
||||
test_ordinals:
|
||||
( cd test; \
|
||||
@ -965,7 +965,7 @@ reconfigure reconf:
|
||||
(my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
|
||||
return <<"EOF";
|
||||
$target: $args{generator}->[0] $deps
|
||||
\$(PERL) \$(SRCDIR)/util/mkdef.pl $args{generator}->[1] $mkdef_os > $target
|
||||
\$(PERL) \$(SRCDIR)/util/mkdef.pl --ordinals $args{generator}->[0] --name $args{generator}->[1] --OS $mkdef_os > $target
|
||||
EOF
|
||||
} elsif ($args{src} !~ /\.[sS]$/) {
|
||||
if ($args{generator}->[0] =~ m|^.*\.in$|) {
|
||||
|
@ -514,7 +514,7 @@ reconfigure reconf:
|
||||
rel2abs($config{builddir}));
|
||||
return <<"EOF";
|
||||
$target: $args{generator}->[0] $deps
|
||||
\$(PERL) $mkdef $args{generator}->[1] 32 > $target
|
||||
\$(PERL) $mkdef --ordinals $args{generator}->[0] --name $args{generator}->[1] --OS windows > $target
|
||||
EOF
|
||||
} elsif ($args{src} !~ /\.[sS]$/) {
|
||||
my $target = $args{src};
|
||||
|
@ -1,4 +1,6 @@
|
||||
{-
|
||||
use File::Spec::Functions;
|
||||
|
||||
our $sover = $config{shlib_version_number};
|
||||
our $sover_filename = $sover;
|
||||
$sover_filename =~ s|\.|_|g
|
||||
@ -28,8 +30,8 @@ IF[{- defined $target{shared_defflag} -}]
|
||||
SHARED_SOURCE[libcrypto]=libcrypto.ld
|
||||
SHARED_SOURCE[libssl]=libssl.ld
|
||||
|
||||
GENERATE[libcrypto.ld]=util/libcrypto.num crypto
|
||||
GENERATE[libssl.ld]=util/libssl.num ssl
|
||||
GENERATE[libcrypto.ld]=util/libcrypto.num libcrypto
|
||||
GENERATE[libssl.ld]=util/libssl.num libssl
|
||||
ENDIF
|
||||
|
||||
IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}]
|
||||
|
@ -49,8 +49,9 @@ foreach my $libname (@libnames) {
|
||||
my @def_lines;
|
||||
indir $bldtop => sub {
|
||||
my $mkdefpath = srctop_file("util", "mkdef.pl");
|
||||
@def_lines = map { s|\R$||; $_ } `$^X $mkdefpath $libname linux 2> /dev/null`;
|
||||
ok($? == 0, "running 'cd $bldtop; $^X $mkdefpath $libname linux' => $?");
|
||||
my $libnumpath = srctop_file("util", "lib$libname.num");
|
||||
@def_lines = map { s|\R$||; $_ } `$^X $mkdefpath --ordinals $libnumpath --name $libname --OS linux 2> /dev/null`;
|
||||
ok($? == 0, "running 'cd $bldtop; $^X $mkdefpath --ordinals $libnumpath --name $libname --OS linux' => $?");
|
||||
}, create => 0, cleanup => 0;
|
||||
|
||||
note "Number of lines in \@nm_lines before massaging: ", scalar @nm_lines;
|
||||
|
1827
util/mkdef.pl
1827
util/mkdef.pl
File diff suppressed because it is too large
Load Diff
1357
util/mknum.pl
Executable file
1357
util/mknum.pl
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user