• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..08-Nov-2021-

dummylib/H08-Nov-2021-4832

.gitignoreH A D08-Nov-202168 43

Install.pmH A D08-Nov-202118.5 KiB785663

MSBuildProject.pmH A D08-Nov-202114.5 KiB509430

Mkvcbuild.pmH A D08-Nov-202133.7 KiB1,112923

Project.pmH A D08-Nov-20218.5 KiB445374

READMEH A D08-Nov-20214.3 KiB10078

Solution.pmH A D08-Nov-202128 KiB1,031881

VSObjectFactory.pmH A D08-Nov-20213.5 KiB153108

build.batH A D08-Nov-2021233 76

build.plH A D08-Nov-20211.4 KiB7346

clean.batH A D08-Nov-20219.2 KiB143124

config_default.plH A D08-Nov-20211.1 KiB3221

ecpg_regression.projH A D08-Nov-20213.1 KiB6551

gendef.plH A D08-Nov-20215.2 KiB17984

install.batH A D08-Nov-2021241 76

install.plH A D08-Nov-2021721 3823

mkvcbuild.plH A D08-Nov-2021771 3017

pgbison.batH A D08-Nov-2021272 86

pgbison.plH A D08-Nov-20211.2 KiB5235

pgflex.batH A D08-Nov-2021268 86

pgflex.plH A D08-Nov-20212.5 KiB10577

vcregress.batH A D08-Nov-2021249 76

vcregress.plH A D08-Nov-202118 KiB766617

README

1src/tools/msvc/README
2
3MSVC build
4==========
5
6This directory contains the tools required to build PostgreSQL using
7Microsoft Visual Studio 2013 - 2019. This builds the whole backend, not just
8the libpq frontend library. For more information, see the documentation
9chapter "Installation on Windows" and the description below.
10
11
12Notes about Visual Studio Express
13---------------------------------
14To build PostgreSQL using Visual Studio Express, the Microsoft Windows SDK
15has to be installed. Since this is not included in the product
16originally, extra steps are needed to make it work.
17
18First, download and install a supported version of the Microsoft Windows SDK
19from www.microsoft.com (v8.1a or greater).
20
21Locate the files vcprojectengine.dll.express.config and
22vcprojectengine.dll.config in the vc\vcpackages directory of
23the Visual C++ Express installation. In these files, add the paths
24to the Platform SDK to the Include, Library and Path tags. Be sure
25to add them to the beginning of the list.
26
27This should work for both GUI and commandline builds, but a restart
28may be necessary.
29
30If you are using a recent version of the Microsoft Windows SDK that includes
31the compilers and build tools you probably don't even need Visual Studio
32Express to build PostgreSQL.
33
34
35Structure of the build tools
36----------------------------
37The tools for building PostgreSQL using Microsoft Visual Studio currently
38consist of the following files:
39
40- Configuration files -
41config_default.pl      default configuration arguments
42
43A typical build environment has two more files, buildenv.pl and config.pl
44that contain the user's build environment settings and configuration
45arguments.
46
47
48- User tools -
49build.pl               tool to build the binaries
50clean.bat              batch file for cleaning up generated files
51install.pl             tool to install the generated files
52mkvcbuild.pl           tool to generate the Visual Studio build files
53vcregress.pl           tool to run the regression tests
54
55
56- Internal tools -
57gendef.pl              internal tool to generate .DEF files
58pgbison.pl             internal tool to process .y files using bison
59pgflex.pl              internal tool to process .l files using flex
60
61Many of those .pl files also have a corresponding .bat-wrapper that doesn't
62contain any additional logic.
63
64
65- Internal modules -
66Install.pm             module containing the install logic
67Mkvcbuild.pm           module containing the code to generate the Visual
68                       Studio build (project/solution) files
69MSBuildProject.pm      module containing the code to generate MSBuild based
70                       project files (Visual Studio 2013 or greater)
71Project.pm             module containing the common code to generate the
72                       Visual Studio project files. Also provides the
73                       common interface of all project file generators
74Solution.pm            module containing the code to generate the Visual
75                       Studio solution files.
76VSObjectFactory.pm     factory module providing the code to create the
77                       appropriate project/solution files for the current
78                       environment
79
80
81Description of the internals of the Visual Studio build process
82---------------------------------------------------------------
83By typing 'build' the user starts the build.bat wrapper which simply passes
84it's arguments to build.pl.
85In build.pl the user's buildenv.pl is used to set up the build environment
86(i. e. path to bison and flex). In addition his config.pl file is merged into
87config_default.pl to create the configuration arguments.
88These configuration arguments are passed over to Mkvcbuild::mkvcbuild
89(Mkvcbuild.pm) which creates the Visual Studio project and solution files.
90It does this by using VSObjectFactory::CreateSolution to create an object
91implementing the Solution interface (this could be either VS2013Solution,
92VS2015Solution, VS2017Solution or VS2019Solution, all in Solution.pm,
93depending on the user's build environment) and adding objects implementing
94the corresponding Project interface (VC2013Project, VC2015Project,
95VC2017Project or VC2019Project from MSBuildProject.pm) to it.
96When Solution::Save is called, the implementations of Solution and Project
97save their content in the appropriate format.
98The final step of starting the appropriate build program (msbuild) is
99performed in build.pl again.
100