@@ -3,7 +3,7 @@ package Solution;
3
3
#
4
4
# Package that encapsulates a Visual C++ solution file generation
5
5
#
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 $
7
7
#
8
8
use Carp;
9
9
use strict;
@@ -20,6 +20,7 @@ sub new
20
20
options => $options ,
21
21
numver => ' ' ,
22
22
strver => ' ' ,
23
+ vcver => undef ,
23
24
};
24
25
bless $self ;
25
26
# integer_datetimes is now the default
@@ -51,9 +52,30 @@ sub new
51
52
unless $options -> {wal_segsize }; # undef or 0 means default
52
53
die " Bad wal_segsize $options ->{wal_segsize}"
53
54
unless grep {$_ == $options -> {wal_segsize }} (1,2,4,8,16,32,64);
55
+
56
+ $self -> DetermineToolVersions();
57
+
54
58
return $self ;
55
59
}
56
60
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
+
57
79
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
58
80
# Special case - if config.pl has changed, always return 1
59
81
sub IsNewer
0 commit comments