Like MD_Init, MD now must include a NULL engine pointer in its definition.
[openssl.git] / util / mkdef.pl
index 2c003c4b23a3d5bbb4754c860b817adfbaaad976..9243c0bb6151b2e02be7927d641f05edffe3c6df 100755 (executable)
@@ -60,7 +60,7 @@ my $crypto_num= "util/libeay.num";
 my $ssl_num=    "util/ssleay.num";
 
 my $do_update = 0;
-my $do_rewrite = 0;
+my $do_rewrite = 1;
 my $do_crypto = 0;
 my $do_ssl = 0;
 my $do_ctest = 0;
@@ -195,7 +195,7 @@ my $ssl="ssl/ssl.h";
 $ssl.=" ssl/kssl.h";
 
 my $crypto ="crypto/crypto.h";
-$crypto.=" crypto/des/des.h" ; # unless $no_des;
+$crypto.=" crypto/des/des.h crypto/des/des_old.h" ; # unless $no_des;
 $crypto.=" crypto/idea/idea.h" ; # unless $no_idea;
 $crypto.=" crypto/rc4/rc4.h" ; # unless $no_rc4;
 $crypto.=" crypto/rc5/rc5.h" ; # unless $no_rc5;
@@ -243,7 +243,8 @@ $crypto.=" crypto/x509v3/x509v3.h";
 $crypto.=" crypto/rand/rand.h";
 $crypto.=" crypto/comp/comp.h" ; # unless $no_comp;
 $crypto.=" crypto/ocsp/ocsp.h";
-$crypto.=" crypto/ui/ui.h";
+$crypto.=" crypto/ui/ui.h crypto/ui/ui_compat.h";
+$crypto.=" crypto/krb5/krb5_asn.h";
 $crypto.=" crypto/tmdiff.h";
 
 my $symhacks="crypto/symhacks.h";
@@ -259,7 +260,6 @@ if ($do_ssl == 1) {
        if ($do_rewrite == 1) {
                open(OUT, ">$ssl_num");
                &rewrite_numbers(*OUT,"SSLEAY",*ssl_list,@ssl_symbols);
-               close OUT;
        } else {
                open(OUT, ">>$ssl_num");
        }
@@ -332,6 +332,7 @@ sub do_defs
 
        foreach $file (split(/\s+/,$symhacksfile." ".$files))
                {
+               print STDERR "DEBUG: starting on $file:\n" if $debug;
                open(IN,"<$file") || die "unable to open $file:$!\n";
                my $line = "", my $def= "";
                my %tag = (
@@ -400,7 +401,7 @@ sub do_defs
 
                print STDERR "DEBUG: parsing ----------\n" if $debug;
                while(<IN>) {
-                       last if (/BEGIN ERROR CODES/);
+                       last if (/\/\* Error codes for the \w+ functions\. \*\//);
                        if ($line ne '') {
                                $_ = $line . $_;
                                $line = '';
@@ -785,14 +786,18 @@ sub do_defs
                        if (/^\#INFO:([^:]*):(.*)$/) {
                                $plats = $1;
                                $algs = $2;
+                               print STDERR "DEBUG: found info on platforms ($plats) and algorithms ($algs)\n" if $debug;
                                next;
                        } elsif (/^\s*OPENSSL_EXTERN\s.*?(\w+(\{[0-9]+\})?)(\[[0-9]*\])*\s*$/) {
                                $s = $1;
                                $k = "VARIABLE";
+                               print STDERR "DEBUG: found external variable $s\n" if $debug;
                        } elsif (/\(\*(\w*(\{[0-9]+\})?)\([^\)]+/) {
                                $s = $1;
+                               print STDERR "DEBUG: found ANSI C function $s\n" if $debug;
                        } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s) {
                                # K&R C
+                               print STDERR "DEBUG: found K&R C function $s\n" if $debug;
                                next;
                        } elsif (/\w+\W+\w+(\{[0-9]+\})?\W*\(.*\)$/s) {
                                while (not /\(\)$/s) {
@@ -802,6 +807,7 @@ sub do_defs
                                s/\(void\)//;
                                /(\w+(\{[0-9]+\})?)\W*\(\)/s;
                                $s = $1;
+                               print STDERR "DEBUG: found function $s\n" if $debug;
                        } elsif (/\(/ and not (/=/)) {
                                print STDERR "File $file: cannot parse: $_;\n";
                                next;
@@ -994,7 +1000,7 @@ sub is_valid
                        # 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)) {
+                       if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) {
                                return 1;
                        }
                        return 0;
@@ -1244,7 +1250,10 @@ sub rewrite_numbers
                $syms{$n} = 1;
        }
 
-       my @s=sort { &parse_number($nums{$a},"n") <=> &parse_number($nums{$b},"n") } keys %nums;
+       my @s=sort {
+           &parse_number($nums{$a},"n") <=> &parse_number($nums{$b},"n")
+           || $a cmp $b
+       } keys %nums;
        foreach $sym (@s) {
                (my $n, my $i) = split /\\/, $nums{$sym};
                next if defined($i) && $i =~ /^.*?:.*?:\w+\(\w+\)/;