|
2 | 2 | #
|
3 | 3 | # Script that generates a .DEF file for all objects in a directory
|
4 | 4 | #
|
5 |
| -# $PostgreSQL: pgsql/src/tools/msvc/gendef.pl,v 1.6 2007/05/03 14:04:03 mha Exp $ |
| 5 | +# $PostgreSQL: pgsql/src/tools/msvc/gendef.pl,v 1.7 2008/01/31 03:26:14 adunstan Exp $ |
6 | 6 | #
|
7 | 7 |
|
8 | 8 | die"Usage: gendef.pl <modulepath>\n"unless ($ARGV[0] =~/\\([^\\]+$)/);
|
|
18 | 18 |
|
19 | 19 | while (<$ARGV[0]/*.obj>)
|
20 | 20 | {
|
| 21 | +my$symfile =$_; |
| 22 | +$symfile=~s/\.obj$/.sym/i; |
21 | 23 | print".";
|
22 | 24 | system("dumpbin /symbols /out:symbols.out$_ >NUL") &&die"Could not call dumpbin";
|
23 | 25 | open(F,"<symbols.out") ||die"Could not open symbols.out for$_\n";
|
24 | 26 | while (<F>)
|
25 | 27 | {
|
26 | 28 | s/\(\)//g;
|
27 |
| -nextunless/^\d/; |
28 | 29 | my@pieces =split;
|
| 30 | +nextunless$pieces[0] =~/^[A-F0-9]{3}$/; |
29 | 31 | nextunless$pieces[6];
|
30 | 32 | nextif ($pieces[2]eq"UNDEF");
|
31 | 33 | nextunless ($pieces[4]eq"External");
|
|
41 | 43 | push@def,$pieces[6];
|
42 | 44 | }
|
43 | 45 | close(F);
|
44 |
| -unlink("symbols.out"); |
| 46 | +rename("symbols.out",$symfile); |
45 | 47 | }
|
46 | 48 | print"\n";
|
47 | 49 |
|
|