@@ -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.48 2009/09/19 05:56:50 adunstan Exp $
6+ # $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.49 2009/12/23 13:27:04 mha Exp $
77#
88use Carp;
99use strict;
@@ -20,6 +20,7 @@ sub new
2020options => $options ,
2121numver => ' ' ,
2222strver => ' ' ,
23+ vcver => undef ,
2324 };
2425bless $self ;
2526# integer_datetimes is now the default
@@ -51,9 +52,30 @@ sub new
5152unless $options -> {wal_segsize };# undef or 0 means default
5253die " Bad wal_segsize$options ->{wal_segsize}"
5354unless grep {$_ ==$options -> {wal_segsize }} (1,2,4,8,16,32,64);
55+
56+ $self -> DetermineToolVersions();
57+
5458return $self ;
5559}
5660
61+ sub DetermineToolVersions
62+ {
63+ my $self =shift ;
64+
65+ # Determine version of vcbuild command, to set proper verison of visual studio
66+ open (P," vcbuild /? |" ) ||die " vcbuild command not found" ;
67+ my $line = <P>;
68+ close (P);
69+ if ($line !~/ ^Microsoft\( R\) Visual C\+\+ Project Builder - Command Line Version (\d +)\. 00\.\d +/ ) {
70+ die " Unable to determine vcbuild version from first line of output!" ;
71+ }
72+ if ($1 == 8) {$self -> {vcver } =' 8.00' }
73+ elsif ($1 == 9) {$self -> {vcver } =' 9.00' }
74+ else {die " Unsupported version of Visual Studio:$1 " }
75+ print " Detected Visual Studio version$self ->{vcver}\n " ;
76+ }
77+
78+
5779# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
5880# Special case - if config.pl has changed, always return 1
5981sub IsNewer