Refactor util/mknum.pl for clearer separation of functionality

Rewrite util/mknum.pl to become cleaner, and to use the separate
generic C header parsing module, as well as the separate ordinals
manipulation module.
Adapt the build files.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7191)
This commit is contained in:
Richard Levitte 2018-09-14 15:28:39 +02:00
parent 15ba109631
commit 30699aa194
2 changed files with 144 additions and 1340 deletions

View File

@ -809,9 +809,47 @@ errors:
-conf $$E `basename $$E .ec`.c ; \
done )
{- use File::Basename;
our @sslheaders =
qw( include/openssl/ssl.h
include/openssl/ssl2.h
include/openssl/ssl3.h
include/openssl/sslerr.h
include/openssl/tls1.h
include/openssl/dtls1.h
include/openssl/srtp.h );
our @cryptoheaders =
qw( include/internal/dso.h
include/internal/o_dir.h
include/internal/o_str.h
include/internal/err.h
include/internal/sslconf.h );
our @cryptoskipheaders = ( @sslheaders,
qw( include/openssl/conf_api.h
include/openssl/ebcdic.h
include/openssl/opensslconf.h
include/openssl/symhacks.h ) );
foreach my $f ( glob(catfile($config{sourcedir},
'include','openssl','*.h')) ) {
my $fn = "include/openssl/" . basename($f);
push @cryptoheaders, $fn unless grep { $_ eq $fn } @cryptoskipheaders;
}
"";
-}
CRYPTOHEADERS={- join(" \\\n\t", sort @cryptoheaders) -}
SSLHEADERS={- join(" \\\n\t", sort @sslheaders) -}
ordinals:
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mknum.pl crypto update )
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mknum.pl ssl update )
( cd $(SRCDIR); \
$(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
--ordinals util/libcrypto.num \
--symhacks include/openssl/symhacks.h \
$(CRYPTOHEADERS) )
( cd $(SRCDIR); \
$(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
--ordinals util/libssl.num \
--symhacks include/openssl/symhacks.h \
$(SSLHEADERS))
test_ordinals:
( cd test; \

1442
util/mknum.pl Executable file → Normal file

File diff suppressed because it is too large Load Diff