postgresql/src/tools/msvc
2013-01-09 17:31:04 +01:00
..
build.bat Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
build.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
builddoc.bat Convert builddoc.bat into a perl script that actually works. 2011-05-25 00:21:07 -04:00
builddoc.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
clean.bat Support for building with MS Visual Studio 2010. 2012-01-03 08:44:26 -05:00
config_default.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
ecpg_regression.proj Adding special command line option that is now needed for the one ecpg regression test that was changed. 2010-03-21 14:26:58 +00:00
gendef.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
install.bat Remove whitespace from end of lines 2012-05-15 22:19:41 +03:00
install.pl Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
Install.pm Properly install ecpg_compat and pgtypes libraries on msvc 2013-01-09 17:31:04 +01:00
mkvcbuild.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
Mkvcbuild.pm Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
MSBuildProject.pm Restore setting of _USE_32BIT_TIME_T to 32 bit MSVC builds. 2012-08-31 20:50:31 -04:00
pgbison.bat Fix comments over eagerly c&p'd. 2011-07-07 03:53:49 -04:00
pgbison.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
pgflex.bat Fix comments over eagerly c&p'd. 2011-07-07 03:53:49 -04:00
pgflex.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
Project.pm Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
README Remove whitespace from end of lines 2012-05-15 22:19:41 +03:00
Solution.pm Properly copy fmgroids.h after clean on Win32 2012-12-16 14:58:10 +01:00
VCBuildProject.pm Restore setting of _USE_32BIT_TIME_T to 32 bit MSVC builds. 2012-08-31 20:50:31 -04:00
vcregress.bat Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
vcregress.pl Allow a few seconds for Windows to catch up with a directory rename when checking pg_upgrade. 2012-10-02 10:42:42 -04:00
VSObjectFactory.pm Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00

src/tools/msvc/README

MSVC build
==========

This directory contains the tools required to build PostgreSQL using
Microsoft Visual Studio 2005 - 2011. This builds the whole backend, not just
the libpq frontend library. For more information, see the documentation
chapter "Installation on Windows" and the description below.


Notes about Visual Studio Express
---------------------------------
To build PostgreSQL using Visual Studio Express, the Microsoft Windows SDK
has to be installed. Since this is not included in the product
originally, extra steps are needed to make it work.

First, download and install a supported version of the Microsoft Windows SDK
from www.microsoft.com (v6.0 or greater).

Locate the files vcprojectengine.dll.express.config and
vcprojectengine.dll.config in the vc\vcpackages directory of
the Visual C++ Express installation. In these files, add the paths
to the Platform SDK to the Include, Library and Path tags. Be sure
to add them to the beginning of the list.

This should work for both GUI and commandline builds, but a restart
may be necessary.

If you are using a recent version of the Microsoft Windows SDK that includes
the compilers and build tools you probably don't even need Visual Studio
Express to build PostgreSQL.


Structure of the build tools
----------------------------
The tools for building PostgreSQL using Microsoft Visual Studio currently
consist of the following files:

- Configuration files -
config_default.pl      default configuration arguments

A typical build environment has two more files, buildenv.pl and config.pl
that contain the user's build environment settings and configuration
arguments.


- User tools -
build.pl               tool to build the binaries
builddoc.pl            tool to build the docs
clean.bat              batch file for cleaning up generated files
install.pl             tool to install the generated files
mkvcbuild.pl           tool to generate the Visual Studio build files
vcregress.pl           tool to run the regression tests


- Internal tools -
gendef.pl              internal tool to generate .DEF files
pgbison.pl             internal tool to process .y files using bison
pgflex.pl              internal tool to process .l files using flex

Many of those .pl files also have a corresponding .bat-wrapper that doesn't
contain any additional logic.


- Internal modules -
Install.pm             module containing the install logic
Mkvcbuild.pm           module containing the code to generate the Visual
                       Studio build (project/solution) files
MSBuildProject.pm      module containing the code to generate MSBuild based
                       project files (Visual Studio 2010 or greater)
Project.pm             module containing the common code to generate the
                       Visual Studio project files. Also provides the
                       common interface of all project file generators
Solution.pm            module containing the code to generate the Visual
                       Studio solution files.
VCBuildProject.pm      module containing the code to generate VCBuild based
                       project files (Visual Studio 2005/2008)
VSObjectFactory.pm     factory module providing the code to create the
                       appropriate project/solution files for the current
                       environment


Description of the internals of the Visual Studio build process
---------------------------------------------------------------
By typing 'build' the user starts the build.bat wrapper which simply passes
it's arguments to build.pl.
In build.pl the user's buildenv.pl is used to set up the build environment
(i. e. path to bison and flex). In addition his config.pl file is merged into
config_default.pl to create the configuration arguments.
These configuration arguments are passed over to Mkvcbuild::mkvcbuild
(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)
is performed in build.pl again.