VisualStudio2012_v03.patch
text/plain
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
Series: patch v3
| File | + | − |
|---|---|---|
| doc/src/sgml/install-windows.sgml | 17 | 13 |
| src/tools/msvc/build.pl | 1 | 1 |
| src/tools/msvc/gendef.pl | 1 | 0 |
| src/tools/msvc/MSBuildProject.pm | 43 | 1 |
| src/tools/msvc/README | 5 | 4 |
| src/tools/msvc/Solution.pm | 27 | 4 |
| src/tools/msvc/VSObjectFactory.pm | 11 | 3 |
diff -Napcdr -x .git postgresql/doc/src/sgml/install-windows.sgml postgresql_dev/doc/src/sgml/install-windows.sgml
*** postgresql/doc/src/sgml/install-windows.sgml Sun Oct 14 09:47:50 2012
--- postgresql_dev/doc/src/sgml/install-windows.sgml Sun Oct 14 17:52:14 2012
***************
*** 19,26 ****
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
! Microsoft tools is to install a supported version of the
! <productname>Microsoft Windows SDK</productname> and use the included
compiler. It is also possible to build with the full
<productname>Microsoft Visual C++ 2005, 2008 or 2010</productname>. In some cases
that requires the installation of the <productname>Windows SDK</productname>
--- 19,26 ----
<para>
There are several different ways of building PostgreSQL on
<productname>Windows</productname>. The simplest way to build with
! Microsoft tools is to install <productname>Visual Studio Express 2012
! for Windows Desktop</productname> and use the included
compiler. It is also possible to build with the full
<productname>Microsoft Visual C++ 2005, 2008 or 2010</productname>. In some cases
that requires the installation of the <productname>Windows SDK</productname>
***************
*** 77,93 ****
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
! way is to use the compilers in the <productname>Windows SDK</productname>,
! which is a free download from Microsoft.
</para>
<para>
PostgreSQL is known to support compilation using the compilers shipped with
<productname>Visual Studio 2005</productname> to
! <productname>Visual Studio 2010</productname> (including Express editions),
as well as standalone Windows SDK releases 6.0 to 7.1.
64-bit PostgreSQL builds are only supported with
! <productname>Microsoft Windows SDK</productname> version 6.0a and above or
<productname>Visual Studio 2008</productname> and above.
</para>
--- 77,94 ----
<productname>Visual Studio Express</productname> or some versions of the
<productname>Microsoft Windows SDK</productname>. If you do not already have a
<productname>Visual Studio</productname> environment set up, the easiest
! ways are to use the compilers in the <productname>Windows SDK 7.1</productname>
! or those from <productname>Visual Studio Express 2012 for Windows
! Desktop</productname>, which are both free downloads from Microsoft.
</para>
<para>
PostgreSQL is known to support compilation using the compilers shipped with
<productname>Visual Studio 2005</productname> to
! <productname>Visual Studio 2012</productname> (including Express editions),
as well as standalone Windows SDK releases 6.0 to 7.1.
64-bit PostgreSQL builds are only supported with
! <productname>Microsoft Windows SDK</productname> version 6.0a to 7.1 or
<productname>Visual Studio 2008</productname> and above.
</para>
*************** $ENV{PATH}=$ENV{PATH} . ';c:\some\where\
*** 146,162 ****
<varlistentry>
<term><productname>Microsoft Windows SDK</productname></term>
<listitem><para>
! It is recommended that you upgrade to the latest supported version
! of the <productname>Microsoft Windows SDK</productname> (currently
version 7.1), available for download from
<ulink url="http://www.microsoft.com/downloads/"></>.
</para>
<para>
You must always include the
<application>Windows Headers and Libraries</application> part of the SDK.
! If you install the <productname>Windows SDK</productname>
including the <application>Visual C++ Compilers</application>,
you don't need <productname>Visual Studio</productname> to build.
</para></listitem>
</varlistentry>
--- 147,166 ----
<varlistentry>
<term><productname>Microsoft Windows SDK</productname></term>
<listitem><para>
! If your build environment doesn't ship with a supported version of the
! <productname>Microsoft Windows SDK</productname> it
! is recommended that you upgrade to the latest version (currently
version 7.1), available for download from
<ulink url="http://www.microsoft.com/downloads/"></>.
</para>
<para>
You must always include the
<application>Windows Headers and Libraries</application> part of the SDK.
! If you install a <productname>Windows SDK</productname>
including the <application>Visual C++ Compilers</application>,
you don't need <productname>Visual Studio</productname> to build.
+ Note that as of Version 8.0a the Windows SDK no longer ships with a
+ complete command-line build environment.
</para></listitem>
</varlistentry>
*************** $ENV{PATH}=$ENV{PATH} . ';c:\some\where\
*** 198,207 ****
Bison can be downloaded from <ulink url="http://gnuwin32.sourceforge.net"></>.
Flex can be downloaded from
<ulink url="http://www.postgresql.org/ftp/misc/winflex/"></>.
! If you are using <productname>msysGit</productname> for accessing the
! PostgreSQL <productname>Git</productname> repository you probably already
! have recent versions of bison and flex in your <productname>Git</productname>
! binary directory.
</para>
<note>
--- 202,211 ----
Bison can be downloaded from <ulink url="http://gnuwin32.sourceforge.net"></>.
Flex can be downloaded from
<ulink url="http://www.postgresql.org/ftp/misc/winflex/"></>.
! If you are using <productname>msysGit</productname> or <productname>GitHub for
! Windows</productname> for accessing the PostgreSQL <productname>Git</productname>
! repository you probably already have recent versions of bison and flex in your
! <productname>Git</productname> binary directory.
</para>
<note>
diff -Napcdr -x .git postgresql/src/tools/msvc/MSBuildProject.pm postgresql_dev/src/tools/msvc/MSBuildProject.pm
*** postgresql/src/tools/msvc/MSBuildProject.pm Sun Oct 14 09:48:06 2012
--- postgresql_dev/src/tools/msvc/MSBuildProject.pm Sun Oct 14 12:07:35 2012
***************
*** 1,7 ****
package MSBuildProject;
#
! # Package that encapsulates a MSBuild (Visual C++ 2010) project file
#
# src/tools/msvc/MSBuildProject.pm
#
--- 1,7 ----
package MSBuildProject;
#
! # Package that encapsulates a MSBuild project file (Visual C++ 2010 or greater)
#
# src/tools/msvc/MSBuildProject.pm
#
*************** sub new
*** 395,400 ****
--- 395,442 ----
$self->{vcver} = '10.00';
return $self;
+ }
+
+ package VC2012Project;
+
+ #
+ # Package that encapsulates a Visual C++ 2012 project file
+ #
+
+ use strict;
+ use warnings;
+ use base qw(MSBuildProject);
+
+ sub new
+ {
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '11.00';
+
+ return $self;
+ }
+
+ # This override adds the <PlatformToolset> element
+ # to the PropertyGroup labeled "Configuration"
+ sub WriteConfigurationPropertyGroup
+ {
+ my ($self, $f, $cfgname, $p) = @_;
+ my $cfgtype =
+ ($self->{type} eq "exe")
+ ?'Application'
+ :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary');
+
+ print $f <<EOF;
+ <PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'" Label="Configuration">
+ <ConfigurationType>$cfgtype</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ EOF
}
1;
diff -Napcdr -x .git postgresql/src/tools/msvc/README postgresql_dev/src/tools/msvc/README
*** postgresql/src/tools/msvc/README Sun Oct 14 09:48:06 2012
--- postgresql_dev/src/tools/msvc/README Sun Oct 14 11:38:00 2012
*************** These configuration arguments are passed
*** 92,101 ****
(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
It does this by using VSObjectFactory::CreateSolution to create an object
implementing the Solution interface (this could be either a VS2005Solution,
! a VS2008Solution or a VS2010Solution, all in Solution.pm, depending on the
! user's build environment) and adding objects implementing the corresponding
! Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or
! VC2010Project from MSBuildProject.pm) to it.
When Solution::Save is called, the implementations of Solution and Project
save their content in the appropriate format.
The final step of starting the appropriate build program (msbuild or vcbuild)
--- 92,102 ----
(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
It does this by using VSObjectFactory::CreateSolution to create an object
implementing the Solution interface (this could be either a VS2005Solution,
! a VS2008Solution, a VS2010Solution or a VS2012Solution, all in Solution.pm,
! depending on the user's build environment) and adding objects implementing
! the corresponding Project interface (VC2005Project or VC2008Project from
! VCBuildProject.pm or VC2010Project or VC2012Project from MSBuildProject.pm)
! to it.
When Solution::Save is called, the implementations of Solution and Project
save their content in the appropriate format.
The final step of starting the appropriate build program (msbuild or vcbuild)
diff -Napcdr -x .git postgresql/src/tools/msvc/Solution.pm postgresql_dev/src/tools/msvc/Solution.pm
*** postgresql/src/tools/msvc/Solution.pm Sun Oct 14 09:48:06 2012
--- postgresql_dev/src/tools/msvc/Solution.pm Sun Oct 14 11:27:32 2012
*************** sub DeterminePlatform
*** 63,75 ****
{
my $self = shift;
! # Determine if we are in 32 or 64-bit mode. Do this by seeing if CL has
! # 64-bit only parameters.
$self->{platform} = 'Win32';
! open(P, "cl /? 2>NUL|") || die "cl command not found";
while (<P>)
{
! 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 (<P>)
{
! 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/;