Mono runtime: Add support for mixed-mode assemblies. Contributed under MIT/X11 license.
[mono.git] / msvc / create-windef.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my $outfile = shift || usage ();
6 my @symbols = ();
7 my %excludes = ();
8 my $cmd = "nm -D ../mono/mini/.libs/libmono.so";
9
10 @excludes {qw(
11         mono_class_setup_vtable_general_new mono_debugger_init mono_debugger_main
12         mono_once mono_pthread_key_for_tls
13 )} = ();
14
15 open (SYMS, "$cmd |") || die "Cannot run \$cmd': $!\n";
16 while (<SYMS>) {
17         next unless / T (mono_.*)/;
18         next if exists $excludes {$1};
19         push @symbols, $1;
20 }
21 close (SYMS);
22 push @symbols, "MonoFixupCorEE";
23 @symbols = sort @symbols;
24
25 open (OUT, ">$outfile") || die "Cannot open '$outfile': $!\n";
26 print OUT "; file generated by create-windef.pl\n";
27 print OUT "LIBRARY mono.dll\nEXPORTS\n";
28 print OUT join ("\n", @symbols);
29
30 close (OUT);
31
32 sub usage {
33         print "Usage: create-windef.pl output_file\n";
34         exit (1);
35 }
36