@@ -3,7 +3,7 @@ package Solution;
33#
44# Package that encapsulates a Visual C++ solution file generation
55#
6- # $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.32 2007/09 /03 02:51:47 tgl Exp $
6+ # $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.33 2007/10 /03 12:11:00 mha Exp $
77#
88use Carp;
99use strict;
@@ -139,21 +139,8 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
139139 close (I);
140140 }
141141
142- if (IsNewer(" src\\ interfaces\\ libpq\\ libpqdll.def" ," src\\ interfaces\\ libpq\\ exports.txt" ))
143- {
144- print " Generating libpqdll.def...\n " ;
145- open (I," src\\ interfaces\\ libpq\\ exports.txt" ) || confess(" Could not open exports.txt\n " );
146- open (O," >src\\ interfaces\\ libpq\\ libpqdll.def" ) || confess(" Could not open libpqdll.def\n " );
147- print O " LIBRARY LIBPQ\n EXPORTS\n " ;
148- while (<I>)
149- {
150- next if (/ ^#/ );
151- my ($f , $o ) = split ;
152- print O " $f @ $o \n " ;
153- }
154- close (O);
155- close (I);
156- }
142+ $self -> GenerateDefFile(" src\\ interfaces\\ libpq\\ libpqdll.def" ," src\\ interfaces\\ libpq\\ exports.txt" ," LIBPQ" );
143+ $self -> GenerateDefFile(" src\\ interfaces\\ ecpg\\ ecpglib\\ ecpglib.def" ," src\\ interfaces\\ ecpg\\ ecpglib\\ exports.txt" ," LIBECPG" );
157144
158145 if (IsNewer(" src\\ backend\\ utils\\ fmgrtab.c" ," src\\ include\\ catalog\\ pg_proc.h" ))
159146 {
304291 close (O);
305292}
306293
294+ sub GenerateDefFile
295+ {
296+ my ($self , $deffile , $txtfile , $libname ) = @_ ;
297+
298+ if (IsNewer($deffile ,$txtfile ))
299+ {
300+ print " Generating $deffile ...\n " ;
301+ open (I,$txtfile ) || confess(" Could not open $txtfile \n " );
302+ open (O," >$deffile " ) || confess(" Could not open $deffile \n " );
303+ print O " LIBRARY $libname \n EXPORTS\n " ;
304+ while (<I>)
305+ {
306+ next if (/ ^#/ );
307+ next if (/ ^\s *$ / );
308+ my ($f , $o ) = split ;
309+ print O " $f @ $o \n " ;
310+ }
311+ close (O);
312+ close (I);
313+ }
314+ }
315+
307316sub AddProject
308317{
309318 my ($self , $name , $type , $folder , $initialdir ) = @_ ;
0 commit comments