From: Magnus Hagander Date: Wed, 23 Dec 2009 13:27:04 +0000 (+0000) Subject: Add basic build support for Visual Studio 2008, without resorting to X-Git-Tag: REL9_0_ALPHA4~419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df0cdd53d6b849d13d897403dbcaa36c91d7f21c;p=postgresql Add basic build support for Visual Studio 2008, without resorting to generating the build files for 2005 and then converting them. --- diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index 15732b146b..176325e17c 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -3,7 +3,7 @@ package Project; # # Package that encapsulates a Visual C++ project file generation # -# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.21 2009/11/12 00:13:00 tgl Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.22 2009/12/23 13:27:04 mha Exp $ # use Carp; use strict; @@ -32,7 +32,8 @@ sub new defines => ';', solution => $solution, disablewarnings => '4018;4244;4273;4102;4090', - disablelinkerwarnings => '' + disablelinkerwarnings => '', + vcver => $solution->{vcver} }; bless $self; @@ -458,7 +459,7 @@ sub WriteHeader print $f < - + EOF diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 3916011a62..13bfb7bb0e 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -3,7 +3,7 @@ package Solution; # # Package that encapsulates a Visual C++ solution file generation # -# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.48 2009/09/19 05:56:50 adunstan Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.49 2009/12/23 13:27:04 mha Exp $ # use Carp; use strict; @@ -20,6 +20,7 @@ sub new options => $options, numver => '', strver => '', + vcver => undef, }; bless $self; # integer_datetimes is now the default @@ -51,9 +52,30 @@ sub new unless $options->{wal_segsize}; # undef or 0 means default die "Bad wal_segsize $options->{wal_segsize}" unless grep {$_ == $options->{wal_segsize}} (1,2,4,8,16,32,64); + + $self->DetermineToolVersions(); + return $self; } +sub DetermineToolVersions +{ + my $self = shift; + +# Determine version of vcbuild command, to set proper verison of visual studio + open(P,"vcbuild /? |") || die "vcbuild command not found"; + my $line =

; + close(P); + if ($line !~ /^Microsoft \(R\) Visual C\+\+ Project Builder - Command Line Version (\d+)\.00\.\d+/) { + die "Unable to determine vcbuild version from first line of output!"; + } + if ($1 == 8) { $self->{vcver} = '8.00' } + elsif ($1 == 9) { $self->{vcver} = '9.00' } + else { die "Unsupported version of Visual Studio: $1" } + print "Detected Visual Studio version $self->{vcver}\n"; +} + + # Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist. # Special case - if config.pl has changed, always return 1 sub IsNewer