create-windef.pl 797 B

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