14 GetOptions
("def=s" => \
$def_name,
16 "help|?" => \
$show_help) or pod2usage
( -exitval
=> 2,
18 pod2usage
( -exitval
=> 1,
19 -verbose
=> 3 ) if $show_help or !$def_name or !$vs_name;
21 open (my $def, '<', $def_name) or die $!;
22 open (my $vs, '<', $vs_name) or die $!;
24 # First go through the version-script
30 next unless m/^([^#]+)/;
32 @a = split(/\s+|({|})/,$1);
36 when (/global\:/) { $global = 1; }
37 when (/{|}|.*\:/) { $global = 0; }
38 when (/(.*)\;/ and $global == 1) {
48 next unless m/^;!([^;]+)/ or m/^([^;]+);?(!?)/;
50 @a = split(/\s+/, $1);
53 next if $f =~ /EXPORTS/ or $f =~ /DATA/ or not $f;
55 if (not exists $syms{$f} and not $2) {
56 print "$f: Only in DEF\n";
63 #while (($k,$v) = each %syms) {
64 for $k (sort keys %syms) {
65 print "$k: Only in VS\n";
72 if ($def_only or $vs_only) {
73 print "\nMismatches found.\n";
81 w32-sync-exported-symbols.pl - Synchronize Windows .def with version-script
85 w32-sync-exported-symbols.pl {options}
88 --def Name of .def file
89 --vs Name of version-script file
93 Verifies that all the symbols exported by the version-script is also
94 accounted for in the .def file. Also checks that no extra symbols are
95 exported by the .def file unless they are marked as safe.