Attached patch fixes two problems:

1) gendef works from inside visual studio - use a tempfile instead of
redirection, because for some reason you can't redirect dumpbin from
inside (patch from Joachim Wieland)
2) gendef must process only *.obj, or you get weird errors in some build
scenarios when it tries to process a logfile


//Magnus

Index: src/tools/msvc/gendef.pl
===================================================================
RCS file: /projects/cvsroot/pgsql/src/tools/msvc/gendef.pl,v
retrieving revision 1.2
diff -c -r1.2 gendef.pl
*** src/tools/msvc/gendef.pl    22 Oct 2006 17:17:08 -0000      1.2
--- src/tools/msvc/gendef.pl    9 Jan 2007 10:12:59 -0000
***************
*** 10,18 ****

  print "Generating $defname.DEF from directory $ARGV[0]\n";

! while (<$ARGV[0]/*>) {
      print ".";
!       open(F,"dumpbin /symbols $_|") || die "Could not open $_\n";
        while (<F>) {
                s/\(\)//g;
                next unless /^\d/;
--- 10,19 ----

  print "Generating $defname.DEF from directory $ARGV[0]\n";

! while (<$ARGV[0]/*.obj>) {
      print ".";
!       system("dumpbin /symbols /out:symbols.out $_ >NUL") && die "Could not 
call dumpbin";
!       open(F, "<symbols.out") || die "Could not open symbols.out for $_\n";
        while (<F>) {
                s/\(\)//g;
                next unless /^\d/;
***************
*** 31,36 ****
--- 32,38 ----
                push @def, $pieces[6];
        }
        close(F);
+       unlink("symbols.out");
  }
  print "\n";

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to