From: Richard Levitte Date: Thu, 7 Jan 2016 19:49:53 +0000 (+0100) Subject: Enhance util/mkdef.pl to provide a VMS linker option file for shlibs X-Git-Tag: OpenSSL_1_1_0-pre2~113 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a388633da5a535829f6088623ac838031d32dce1;p=oweals%2Fopenssl.git Enhance util/mkdef.pl to provide a VMS linker option file for shlibs Reviewed-by: Tim Hudson --- diff --git a/util/mkdef.pl b/util/mkdef.pl index 877ea16a5d..08dacf2661 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -160,7 +160,7 @@ foreach (@ARGV, split(/ /, $options)) if ($_ eq "linux") { $linux=1; } - $VMS=1 if $_ eq "VMS"; + $VMS=$VMSNonVAX=1 if $_ eq "VMS"; $OS2=1 if $_ eq "OS2"; if ($_ eq "zlib" || $_ eq "enable-zlib" || $_ eq "zlib-dynamic" || $_ eq "enable-zlib-dynamic") { @@ -253,10 +253,12 @@ if (!$libname) { if ($W32 + $VMS + $OS2 + $linux == 0) { $W32 = 1; } +die "Please, only one platform at a time" + if ($W32 + $VMS + $OS2 + $linux > 1); if (!$do_ssl && !$do_crypto) { - print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT | OS2 ]\n"; + print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT | OS2 | linux | VMS ]\n"; exit(1); } @@ -1296,27 +1298,30 @@ sub print_def_file my $what = "OpenSSL: implementation of Secure Socket Layer"; my $description = "$what $version, $name - http://$http_vendor"; my $prevsymversion = "", $prevprevsymversion = ""; - - if (!$linux) - { - if ($W32) - { $libname.="32"; } - elsif ($OS2) - { # DLL names should not clash on the whole system. - # However, they should not have any particular relationship - # to the name of the static library. Chose descriptive names - # (must be at most 8 chars). - my %translate = (ssl => 'open_ssl', crypto => 'cryptssl'); - $libname = $translate{$name} || $name; - $liboptions = < 'open_ssl', crypto => 'cryptssl'); + $libname = $translate{$name} || $name; + $liboptions = <[1] } + sort { $a->[0] <=> $b->[0] } + map { (my $s, my $i) = $_ =~ /^(.*?)\\(.*)$/; + die "Error: $s doesn't have a number assigned\n" + if !defined($nums{$s}); + (my $n, my @rest) = split /\\/, $nums{$s}; + [ $n, $_ ] } (@e, @r, @v)); + } else { + @symbols=((sort @e),(sort @r), (sort @v)); + } my ($baseversion, $currversion) = get_openssl_version(); my $thisversion; @@ -1376,6 +1402,27 @@ EOF $prevsymversion = $symversion; } print OUT " $s2;\n"; + } elsif ($VMS) { + while(++$prevnum < $n) { + if ($symbolcount > 1023) { + print OUT ")\nSYMBOL_VECTOR=(-\n"; + $symbolcount = 0; + } + print OUT $symbolcount + ? " ," : " "; + print OUT "dummy$prevnum=PRIVATE_PROCEDURE -\n"; + $symbolcount++; + } + (my $s_uc = $s) =~ tr/a-z/A-Z/; + if ($symbolcount > 1023) { + print OUT ")\nSYMBOL_VECTOR=(-\n"; + $symbolcount = 0; + } + print OUT $symbolcount + ? " ," : " "; + print OUT "$s_uc/$s=" + , ($v ? "DATA" : "PROCEDURE"), " -\n"; + $symbolcount++; } elsif($v && !$OS2) { printf OUT " %s%-39s @%-8d DATA\n", ($W32)?"":"_",$s2,$n; @@ -1393,7 +1440,14 @@ EOF } else { print OUT " local: *;\n};\n\n"; } - } + } elsif ($VMS) { + print OUT ")\n"; + (my $libvmaj, my $libvmin, my $libvedit) = + $currversion =~ /^(\d+)_(\d+)_(\d+)$/; + # The reason to multiply the edit number with 100 is to make space + # for the possibility that we want to encode the patch letters + print OUT "GSMATCH=LEQUAL,",($libvmaj * 100 + $libvmin),",",($libvedit * 100),"\n"; + } printf OUT "\n"; }