{- use File::Basename;
- our @sslheaders =
+ my @sslheaders_tmpl =
qw( include/openssl/ssl.h
include/openssl/ssl2.h
include/openssl/ssl3.h
include/openssl/tls1.h
include/openssl/dtls1.h
include/openssl/srtp.h );
- our @cryptoheaders =
+ my @cryptoheaders_tmpl =
qw( include/internal/dso.h
include/internal/o_dir.h
include/internal/err.h
include/internal/pem.h
include/internal/asn1.h
include/internal/sslconf.h );
- our @cryptoskipheaders = ( @sslheaders,
+ my @cryptoskipheaders = ( @sslheaders_tmpl,
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;
+ our @cryptoheaders = ();
+ our @sslheaders = ();
+ foreach my $d ( qw( include/openssl include/internal ) ) {
+ my @header_patterns =
+ map { catfile($config{sourcedir}, $d, $_) } ( '*.h', '*.h.in' );
+ foreach my $f ( map { glob($_) } @header_patterns ) {
+ my $base = basename($f);
+ my $base_in = basename($f, '.in');
+ my $dir = catfile($config{sourcedir}, $d);
+ if ($base ne $base_in) {
+ # We have a .h.in file, which means the header file is in the
+ # build tree.
+ $base = $base_in;
+ $dir = catfile($config{builddir}, $d);
+ }
+ my $new_f = catfile($dir, $base);
+ my $fn = "$d/$base";
+ # The logic to add files to @cryptoheaders is a bit complex. The
+ # file to be added must be either in the public header directory
+ # or one of the pre-declared internal headers, and must under no
+ # circumstances be one of those that must be skipped.
+ push @cryptoheaders, $new_f
+ if (($d eq 'include/openssl'
+ || ( grep { $_ eq $fn } @cryptoheaders_tmpl ))
+ && !( grep { $_ eq $fn } @cryptoskipheaders ));
+ # The logic to add files to @sslheaders is much simpler...
+ push @sslheaders, $new_f if grep { $_ eq $fn } @sslheaders_tmpl;
+ }
}
"";
-}
fill_lines(" ", $COLUMNS - 14, sort @cryptoheaders)) -}
SSLHEADERS={- join(" \\\n" . ' ' x 11,
fill_lines(" ", $COLUMNS - 11, sort @sslheaders)) -}
-ordinals:
- ( 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))
+ordinals: build_generated
+ $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
+ --ordinals $(SRCDIR)/util/libcrypto.num \
+ --symhacks $(SRCDIR)/include/openssl/symhacks.h \
+ $(CRYPTOHEADERS)
+ $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
+ --ordinals $(SRCDIR)/util/libssl.num \
+ --symhacks $(SRCDIR)/include/openssl/symhacks.h \
+ $(SSLHEADERS)
test_ordinals:
( cd test; \