Fix checking of header environment variable
[mono-project.git] / msvc / create-windef.pl
blob129314ca64a7c0b5f894069502d3cd2ff1cc78af
1 #!/usr/bin/perl -w
3 use strict;
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";
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 )} = ();
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;
27 close (SYMS);
28 push @symbols, "MonoFixupCorEE";
29 @symbols = sort @symbols;
31 open (OUT, ">$outfile") || die "Cannot open '$outfile': $!\n";
32 print OUT "; file generated by create-windef.pl\n";
33 print OUT "LIBRARY $dllname\nEXPORTS\n";
34 print OUT join ("\n", @symbols);
35 print OUT "\n";
37 close (OUT);
39 sub usage {
40 print "Usage: create-windef.pl output_file soname dllname\n";
41 exit (1);