) { ! if (/^\/favor:) { $self->{platform} = 'x64'; last; --- 63,74 ---- { my $self = shift; ! # Examine CL help output to determine if we are in 32 or 64-bit mode. $self->{platform} = 'Win32'; ! open(P, "cl /? 2>&1 |") || die "cl command not found"; while (
) { ! if (/^\/favor:<.+AMD64/) { $self->{platform} = 'x64'; last; *************** sub new *** 695,700 **** --- 694,723 ---- $self->{visualStudioName} = 'Visual Studio 2010'; return $self; + } + + package VS2012Solution; + + # + # Package that encapsulates a Visual Studio 2012 solution file + # + + use Carp; + use strict; + use warnings; + use base qw(Solution); + + sub new + { + my $classname = shift; + my $self = $classname->SUPER::_new(@_); + bless($self, $classname); + + $self->{solutionFileVersion} = '12.00'; + $self->{vcver} = '11.00'; + $self->{visualStudioName} = 'Visual Studio 2012'; + + return $self; } 1; diff -Napcdr -x .git postgresql/src/tools/msvc/VSObjectFactory.pm postgresql_dev/src/tools/msvc/VSObjectFactory.pm *** postgresql/src/tools/msvc/VSObjectFactory.pm Sun Oct 14 09:48:06 2012 --- postgresql_dev/src/tools/msvc/VSObjectFactory.pm Sun Oct 14 11:35:14 2012 *************** sub CreateSolution *** 41,46 **** --- 41,50 ---- { return new VS2010Solution(@_); } + elsif ($visualStudioVersion eq '11.00') + { + return new VS2012Solution(@_); + } else { croak "The requested Visual Studio version is not supported."; *************** sub CreateProject *** 68,73 **** --- 72,81 ---- { return new VC2010Project(@_); } + elsif ($visualStudioVersion eq '11.00') + { + return new VC2012Project(@_); + } else { croak "The requested Visual Studio version is not supported."; *************** sub DetermineVisualStudioVersion *** 82,88 **** { # Determine version of nmake command, to set proper version of visual studio ! # we use nmake as it has existed for a long time and still exists in visual studio 2010 open(P, "nmake /? 2>&1 |") || croak "Unable to determine Visual Studio version: The nmake command wasn't found."; --- 90,96 ---- { # Determine version of nmake command, to set proper version of visual studio ! # we use nmake as it has existed for a long time and still exists in current visual studio versions open(P, "nmake /? 2>&1 |") || croak "Unable to determine Visual Studio version: The nmake command wasn't found."; *************** sub DetermineVisualStudioVersion *** 107,117 **** sub _GetVisualStudioVersion { my ($major, $minor) = @_; ! if ($major > 10) { carp "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead."; ! return '10.00'; } elsif ($major < 6) { --- 115,125 ---- sub _GetVisualStudioVersion { my ($major, $minor) = @_; ! if ($major > 11) { carp "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead."; ! return '11.00'; } elsif ($major < 6) { diff -Napcdr -x .git postgresql/src/tools/msvc/build.pl postgresql_dev/src/tools/msvc/build.pl *** postgresql/src/tools/msvc/build.pl Sun Oct 14 09:48:06 2012 --- postgresql_dev/src/tools/msvc/build.pl Sun Oct 14 09:54:55 2012 *************** elsif ($ARGV[0] ne "RELEASE") *** 50,56 **** # ... and do it ! if ($buildwhat and $vcver eq '10.00') { system( "msbuild $buildwhat.vcxproj /verbosity:detailed /p:Configuration=$bconf"); --- 50,56 ---- # ... and do it ! if ($buildwhat and $vcver >= 10.00) { system( "msbuild $buildwhat.vcxproj /verbosity:detailed /p:Configuration=$bconf"); diff -Napcdr -x .git postgresql/src/tools/msvc/gendef.pl postgresql_dev/src/tools/msvc/gendef.pl *** postgresql/src/tools/msvc/gendef.pl Sun Oct 14 09:48:06 2012 --- postgresql_dev/src/tools/msvc/gendef.pl Sun Oct 14 15:35:35 2012 *************** while (<$ARGV[0]/*.obj>) *** 40,45 **** --- 40,46 ---- next if $pieces[6] =~ /^\(/; next if $pieces[6] =~ /^__real/; next if $pieces[6] =~ /^__imp/; + next if $pieces[6] =~ /^__xmm/; next if $pieces[6] =~ /NULL_THUNK_DATA$/; next if $pieces[6] =~ /^__IMPORT_DESCRIPTOR/; next if $pieces[6] =~ /^__NULL_IMPORT/;