From 30699aa1943b10b265c52334d9f582c04c4eccba Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 14 Sep 2018 15:28:39 +0200 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/7191) --- Configurations/unix-Makefile.tmpl | 42 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'Configurations') diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 153d5cc40e..662fb05229 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -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; \ -- cgit v1.2.3