- publishing free software manuals
The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide
by The PostgreSQL Global Development Group
Paperback (6"x9"), 274 pages
ISBN 9781906966072
RRP £9.95 ($14.95)

Sales of this book support the PostgreSQL project! Get a printed copy>>>

2.1 Building with Visual C++ or the Platform SDK

PostgreSQL can be built using the Visual C++ compiler suite from Microsoft. These compilers can be either from Visual Studio, Visual Studio Express or recent versions of the Platform SDK. If you do not already have a Visual Studio environment set up, the easiest way us to use the compilers in the Platform SDK, which is a free download from Microsoft.

PostgreSQL supports the compilers from Visual Studio 2005 and Visual Studio 2008. When using the Platform SDK only, or when building for 64-bit Windows, only Visual Studio 2008 is supported.

The tools for building using Visual C++, are in the ‘src/tools/msvc’ directory. When building, make sure there are no tools from MinGW or Cygwin present in your system PATH. Also, make sure you have all the required Visual C++ tools available in the PATH. In Visual Studio, start the Visual Studio Command Prompt. In the Platform SDK, start the CMD shell listed under the SDK on the Start Menu. If you wish to build a 64-bit version, you must use the 64-bit version of the command, and vice versa. All commands should be run from the ‘src\tools\msvc’ directory.

Before you build, you may need to edit the file ‘config.pl’ to reflect any configuration options you want to change, or the paths to any third party libraries to use. The complete configuration is determined by first reading and parsing the file ‘config_default.pl’, and then apply any changes from ‘config.pl’. For example, to specify the location of your Python installation, put the following in ‘config.pl’:

$config->{python} = 'c:\python26';

You only need to specify those parameters that are different from what's in ‘config_default.pl’.

If you need to set any other environment variables, create a file called ‘buildenv.pl’ and put the required commands there. For example, to add the path for bison when it's not in the PATH, create a file containing:

$ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin';
ISBN 9781906966072The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration GuideSee the print edition