Restructure of mono.sln and build properties to better fix static/dynamic library...
[mono.git] / msvc / create-windef.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my $outfile = shift || usage ();
6 my $soname = shift || usage ();
7 my $dllname = shift || usage ();
8 my @symbols = ();
9 my %excludes = ();
10 my $cmd = "nm -D $soname";
11
12 @excludes {qw(
13         mono_class_setup_vtable_general_new mono_debugger_init mono_debugger_main
14         mono_once mono_pthread_key_for_tls
15         mono_gc_pthread_create mono_gc_pthread_detach mono_gc_pthread_join
16         mono_gc_pthread_exit
17         mono_file_map_fileio mono_file_unmap_fileio
18         mono_file_map_set_allocator 
19 )} = ();
20
21 open (SYMS, "$cmd |") || die "Cannot run \$cmd': $!\n";
22 while (<SYMS>) {
23         next unless / T (mono_.*)/;
24         next if exists $excludes {$1};
25         push @symbols, $1;
26 }
27 close (SYMS);
28 push @symbols, "MonoFixupCorEE";
29 @symbols = sort @symbols;
30
31 open (OUT, ">$outfile") || die "Cannot open '$outfile': $!\n";
32 print OUT "; file generated by create-windef.pl\n";
33 print OUT "EXPORTS\n";
34 print OUT join ("\n", @symbols);
35 print OUT "\n";
36
37 close (OUT);
38
39 sub usage {
40         print "Usage: create-windef.pl output_file soname dllname\n";
41         exit (1);
42 }
43