my $VMSNonVAX=0;
my $VMS=0;
my $W32=0;
-my $W16=0;
my $NT=0;
my $OS2=0;
# Set this to make typesafe STACK definitions appear in DEF
my $safe_stack_def = 0;
-my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT",
+my @known_platforms = ( "__FreeBSD__", "PERL5",
"EXPORT_VAR_AS_FUNCTION", "ZLIB",
"OPENSSL_FIPS", "OPENSSL_FIPSCAPABLE" );
-my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" );
+my @known_ossl_platforms = ( "VMS", "WIN32", "WINNT", "OS2" );
my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
"CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1",
"SHA256", "SHA512", "RIPEMD",
"CMS",
# CryptoAPI Engine
"CAPIENG",
- # SSL v2
- "SSL2",
# SSL v3 method
"SSL3_METHOD",
# JPAKE
my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw;
my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated;
my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng;
-my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc;
+my $no_jpake; my $no_srp; my $no_ec2m; my $no_nistp_gcc;
my $no_nextprotoneg; my $no_sctp; my $no_srtp; my $no_ssl_trace;
my $no_unit_test; my $no_ssl3_method;
{
$debug=1 if $_ eq "debug";
$W32=1 if $_ eq "32";
- $W16=1 if $_ eq "16";
+ die "win16 not supported" if $_ eq "16";
if($_ eq "NT") {
$W32 = 1;
$NT = 1;
elsif (/^no-ec2m$/) { $no_ec2m=1; }
elsif (/^no-ec-nistp224-64-gcc-128$/) { $no_nistp_gcc=1; }
elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; }
- elsif (/^no-ssl2$/) { $no_ssl2=1; }
elsif (/^no-ssl3-method$/) { $no_ssl3_method=1; }
elsif (/^no-ssl-trace$/) { $no_ssl_trace=1; }
elsif (/^no-capieng$/) { $no_capieng=1; }
elsif (/^no-sctp$/) { $no_sctp=1; }
elsif (/^no-srtp$/) { $no_srtp=1; }
elsif (/^no-unit-test$/){ $no_unit_test=1; }
+ elsif (/^no-deprecated$/) { $no_deprecated=1; }
}
}
# If no platform is given, assume WIN32
-if ($W32 + $W16 + $VMS + $OS2 == 0) {
+if ($W32 + $VMS + $OS2 == 0) {
$W32 = 1;
}
-# Add extra knowledge
-if ($W16) {
- $no_fp_api=1;
-}
-
if (!$do_ssl && !$do_crypto)
{
print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT | OS2 ]\n";
$crypto.=" crypto/jpake/jpake.h";
$crypto.=" crypto/srp/srp.h";
$crypto.=" crypto/modes/modes.h";
-#$crypto.=" fips/fips.h fips/rand/fips_rand.h";
my $symhacks="crypto/symhacks.h";
# is the same name as the original.
my $cpp;
my %unknown_algorithms = ();
+ my $parens = 0;
foreach $file (split(/\s+/,$symhacksfile." ".$files))
{
(map { $_ => 0 } @known_platforms),
(map { "OPENSSL_SYS_".$_ => 0 } @known_ossl_platforms),
(map { "OPENSSL_NO_".$_ => 0 } @known_algorithms),
+ (map { "OPENSSL_USE_".$_ => 0 } @known_algorithms),
NOPROTO => 0,
PERL5 => 0,
_WINDLL => 0,
print STDERR "DEBUG: parsing ----------\n" if $debug;
while(<IN>) {
+ if($parens > 0) {
+ #Inside a DECLARE_DEPRECATED
+ $parens += count_parens($_);
+ next;
+ }
if (/\/\* Error codes for the \w+ functions\. \*\//)
{
undef @tag;
pop(@tag);
if ($t =~ /^OPENSSL_NO_([A-Z0-9_]+)$/) {
$t=$1;
+ } elsif($t =~ /^OPENSSL_USE_([A-Z0-9_]+)$/) {
+ $t=$1;
} else {
$t="";
}
map { $tag{"OPENSSL_SYS_".$_} == 1 ? $_ :
$tag{"OPENSSL_SYS_".$_} == -1 ? "!".$_ : "" }
@known_ossl_platforms);
+ @current_algorithms = ();
@current_algorithms =
grep(!/^$/,
map { $tag{"OPENSSL_NO_".$_} == -1 ? $_ : "" }
@known_algorithms);
+ push @current_algorithms
+ , grep(!/^$/,
+ map { $tag{"OPENSSL_USE_".$_} == 1 ? $_ : "" }
+ @known_algorithms);
$def .=
"#INFO:"
.join(',',@current_platforms).":"
} elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_rw_const\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .= "int PEM_write_$1(void);";
} elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_const\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_write_$1(void);";
$def .=
next;
} elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .=
&$make_variant("_shadow_$2","_shadow_$2",
"EXPORT_VAR_AS_FUNCTION",
"FUNCTION");
+ } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) {
+ $def .= "$1(void);";
+ $parens = count_parens($_);
+ next;
} elsif ($tag{'CONST_STRICT'} != 1) {
if (/\{|\/\*|\([^\)]*$/) {
$line = $_;
# Prune the returned symbols
delete $syms{"bn_dump1"};
- $platform{"BIO_s_log"} .= ",!WIN32,!WIN16,!macintosh";
+ $platform{"BIO_s_log"} .= ",!WIN32,!macintosh";
$platform{"PEM_read_NS_CERT_SEQ"} = "VMS";
$platform{"PEM_write_NS_CERT_SEQ"} = "VMS";
if ($keyword eq "VMSNonVAX" && $VMSNonVAX) { return 1; }
if ($keyword eq "VMS" && $VMS) { return 1; }
if ($keyword eq "WIN32" && $W32) { return 1; }
- if ($keyword eq "WIN16" && $W16) { return 1; }
if ($keyword eq "WINNT" && $NT) { return 1; }
if ($keyword eq "OS2" && $OS2) { return 1; }
# Special platforms:
# EXPORT_VAR_AS_FUNCTION means that global variables
# will be represented as functions. This currently
# only happens on VMS-VAX.
- if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) {
+ if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32)) {
return 1;
}
if ($keyword eq "OPENSSL_FIPSCAPABLE") {
{ return 0; }
if ($keyword eq "EC2M" && $no_ec2m) { return 0; }
if ($keyword eq "NEXTPROTONEG" && $no_nextprotoneg) { return 0; }
- if ($keyword eq "SSL2" && $no_ssl2) { return 0; }
if ($keyword eq "SSL3_METHOD" && $no_ssl3_method) { return 0; }
if ($keyword eq "SSL_TRACE" && $no_ssl_trace) { return 0; }
if ($keyword eq "CAPIENG" && $no_capieng) { return 0; }
if ($W32)
{ $libname.="32"; }
- elsif ($W16)
- { $libname.="16"; }
elsif ($OS2)
{ # DLL names should not clash on the whole system.
# However, they should not have any particular relationship
EOF
- if ($W16) {
- print <<"EOF";
-CODE PRELOAD MOVEABLE
-DATA PRELOAD MOVEABLE SINGLE
-
-EXETYPE WINDOWS
-
-HEAPSIZE 4096
-STACKSIZE 8192
-
-EOF
- }
-
print "EXPORTS\n";
(@e)=grep(/^SSLeay(\{[0-9]+\})?\\.*?:.*?:FUNCTION/,@symbols);
}
}
+sub count_parens
+{
+ my $line = shift(@_);
+
+ my $open = $line =~ tr/\(//;
+ my $close = $line =~ tr/\)//;
+
+ return $open - $close;
+}
+