1*ebfedea0SLionel Sambuc#!/usr/bin/perl -w 2*ebfedea0SLionel Sambucuse strict; 3*ebfedea0SLionel Sambuc 4*ebfedea0SLionel Sambuc# Use as $0 5*ebfedea0SLionel Sambuc# Use as $0 -noname 6*ebfedea0SLionel Sambuc 7*ebfedea0SLionel Sambucmy $did_library; 8*ebfedea0SLionel Sambucmy $did_description; 9*ebfedea0SLionel Sambucmy $do_exports; 10*ebfedea0SLionel Sambucmy @imports; 11*ebfedea0SLionel Sambucmy $noname = (@ARGV and $ARGV[0] eq '-noname' and shift); 12*ebfedea0SLionel Sambucwhile (<>) { 13*ebfedea0SLionel Sambuc unless ($did_library) { 14*ebfedea0SLionel Sambuc s/\b(cryptssl)\b/crypto/ and $did_library = $1 if /^LIBRARY\s+cryptssl\b/; 15*ebfedea0SLionel Sambuc s/\b(open_ssl)\b/ssl/ and $did_library = $1 if /^LIBRARY\s+open_ssl\b/; 16*ebfedea0SLionel Sambuc } 17*ebfedea0SLionel Sambuc unless ($did_description) { 18*ebfedea0SLionel Sambuc s&^(DESCRIPTION\s+(['"])).*&${1}\@#www.openssl.org/:#\@forwarder DLL for pre-0.9.7c+ OpenSSL to the new dll naming scheme$2& and $did_description++; 19*ebfedea0SLionel Sambuc } 20*ebfedea0SLionel Sambuc if ($do_exports) {{ 21*ebfedea0SLionel Sambuc last unless /\S/; 22*ebfedea0SLionel Sambuc warn, last unless /^ \s* ( \w+ ) \s+ \@(\d+)\s*$/x; 23*ebfedea0SLionel Sambuc push @imports, [$1, $2]; 24*ebfedea0SLionel Sambuc s/$/ NONAME/ if $noname; 25*ebfedea0SLionel Sambuc }} 26*ebfedea0SLionel Sambuc $do_exports++ if not $do_exports and /^EXPORTS/; 27*ebfedea0SLionel Sambuc print $_; 28*ebfedea0SLionel Sambuc} 29*ebfedea0SLionel Sambucprint "IMPORTS\n"; 30*ebfedea0SLionel Sambucfor my $imp (@imports) { 31*ebfedea0SLionel Sambuc print "\t$imp->[0]=$did_library.$imp->[1]\n"; 32*ebfedea0SLionel Sambuc} 33