11 'format:s' => \
$format,
12 'libname:s' => \
$libname,
14 'output:s' => \
$output) or die "wrong arguments";
16 if (not( $format eq 'aix'
17 or $format eq 'darwin'
21 die "$0: $format is not yet handled (only aix, darwin, gnu, win are)\n";
24 open(my $input_handle, '<', $input)
25 or die "$0: could not open input file '$input': $!\n";
27 open(my $output_handle, '>', $output)
28 or die "$0: could not open output file '$output': $!\n";
33 print $output_handle "{
37 elsif ($format eq 'win')
39 # XXX: Looks like specifying LIBRARY $libname is optional, which makes it
40 # easier to build a generic command for generating export files...
43 print $output_handle "LIBRARY $libname\n";
45 print $output_handle "EXPORTS\n";
48 while (<$input_handle>)
52 # don't do anything with a comment
54 elsif (/^(\S+)\s+(\S+)/)
58 print $output_handle "$1\n";
60 elsif ($format eq 'darwin')
62 print $output_handle "_$1\n";
64 elsif ($format eq 'gnu')
66 print $output_handle " $1;\n";
68 elsif ($format eq 'win')
70 print $output_handle "$1 @ $2\n";
75 die "$0: unexpected line $_\n";
81 print $output_handle " local: *;