postgresql/src/tools/msvc
Tom Lane 41eeeb3482 Sync our copy of the timezone library with IANA release tzcode2020c.
This changes zic's default output format from "-b fat" to "-b slim".
We were already using "slim" in v13/HEAD, so those branches drop
the explicit -b switch in the Makefiles.  Instead, add an explicit
"-b fat" in v12 and before, so that we don't change the output file
format in those branches.  (This is perhaps excessively conservative,
but we decided not to do so in a12079109, and I'll stick with that.)

Other non-cosmetic changes are to drop support for zic's long-obsolete
"-y" switch, and to ensure that strftime() does not change errno
unless it fails.

As usual with tzcode changes, back-patch to all supported branches.
2020-10-16 21:40:16 -04:00
..
.gitignore Ignore config.pl and buildenv.pl in src/tools/msvc. 2014-05-12 14:24:18 -04:00
build.bat Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
build.pl Unify searchpath and do file logic in MSVC build scripts. 2019-02-06 07:49:27 -05:00
builddoc.bat Convert builddoc.bat into a perl script that actually works. 2011-05-25 00:21:07 -04:00
builddoc.pl Clean up Perl code according to perlcritic 2017-03-27 08:18:22 -04:00
clean.bat MSVC: Finish clean.bat build artifact coverage. 2017-07-24 00:13:23 -07:00
config_default.pl Fix typo in comment 2017-11-27 09:28:40 +01:00
ecpg_regression.proj Remove bogus redefinition of _MSC_VER. 2017-04-11 15:32:33 -04:00
gendef.pl Improve gendef.pl diagnostic on failure to open sym file 2017-10-26 10:04:45 -04:00
install.bat Turn install.bat into a pure one line wrapper fort he perl script. 2015-07-06 22:18:26 +03:00
install.pl Fix included file path for modern perl 2019-02-05 19:34:00 -05:00
Install.pm Sync our copy of the timezone library with IANA release tzcode2020c. 2020-10-16 21:40:16 -04:00
mkvcbuild.pl Fix included file path for modern perl 2019-02-05 19:34:00 -05:00
Mkvcbuild.pm Handle spaces for Python install location in MSVC scripts 2020-05-06 21:08:31 +09:00
MSBuildProject.pm Fix syntax error in commit 20e99cddd. 2019-07-25 14:42:16 -04:00
pgbison.bat Fix comments over eagerly c&p'd. 2011-07-07 03:53:49 -04:00
pgbison.pl Turn off deprecated bison warnings under MSVC 2020-03-20 14:02:43 -04:00
pgflex.bat Fix comments over eagerly c&p'd. 2011-07-07 03:53:49 -04:00
pgflex.pl Fix included file path for modern perl 2019-02-05 19:34:00 -05:00
Project.pm Handle spaces in OpenSSL install location for MSVC 2019-10-04 15:39:12 -04:00
README Add support for Visual Studio 2019 in build scripts 2019-07-03 08:58:04 +09:00
Solution.pm Handle spaces in OpenSSL install location for MSVC 2019-10-04 15:39:12 -04:00
VCBuildProject.pm Absorb -D_USE_32BIT_TIME_T switch from Perl, if relevant. 2017-08-14 11:48:59 -04:00
vcregress.bat Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
vcregress.pl MSVC: Avoid warning when testing a TAP suite without PROVE_FLAGS. 2020-06-07 16:27:18 -07:00
VSObjectFactory.pm Use a slightly more liberal regex to detect Visual Studio version 2020-04-17 14:55:55 -04:00

src/tools/msvc/README

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

This directory contains the tools required to build PostgreSQL using
Microsoft Visual Studio 2005 - 2019. 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, a VS2010Solution or a VS2012Solution or a VS2013Solution,
or a VS2015Solution or a VS2017Solution or a VS2019Solution, 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 or
VC2013Project or VC2015Project or VC2017Project or VC2019Project 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.