|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.54 2009/07/23 17:06:48 adunstan Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.55 2010/01/12 20:13:32 mha Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="install-win32">
|
4 | 4 | <title>Installation from Source Code on <productname>Windows</productname></title>
|
|
10 | 10 |
|
11 | 11 | <para>
|
12 | 12 | It is recommended that most users download the binary distribution for
|
13 |
| - Windows, available as a <productname>Windows Installer</productname> package |
| 13 | + Windows, available as a one-click installer package |
14 | 14 | from the <productname>PostgreSQL</productname> website. Building from source
|
15 | 15 | is only intended for people developing <productname>PostgreSQL</productname>
|
16 | 16 | or extensions.
|
17 | 17 | </para>
|
18 | 18 |
|
19 | 19 | <para>
|
20 | 20 | There are several different ways of building PostgreSQL on
|
21 |
| - <productname>Windows</productname>. The complete system can |
22 |
| - be built using <productname>MinGW</productname> or |
23 |
| - <productname>Visual C++ 2005</productname>. It can also be |
24 |
| - built for older versions of <productname>Windows</productname> using |
25 |
| - <productname>Cygwin</productname>. Finally, the client access library |
| 21 | + <productname>Windows</productname>. The simplest way to build with |
| 22 | + Microsoft tools is to intall a modern version of the |
| 23 | + <productname>Microsoft Platform SDK</productname> and use use the included |
| 24 | + compiler. It is also possible to build with the full |
| 25 | + <productname>Microsoft Visual C++ 2005 or 2008</productname>. In some cases |
| 26 | + that requires the installation of the <productname>Platform SDK</productname> |
| 27 | + in addition to the compiler. |
| 28 | + </para> |
| 29 | + |
| 30 | + <para> |
| 31 | + It is also possible to build PostgreSQL using the GNU compiler tools |
| 32 | + provided by <productname>MinGW</productname>, or using |
| 33 | + <productname>Cygwin</productname> for older versions of |
| 34 | + <productname>Windows</productname>. |
| 35 | + </para> |
| 36 | + |
| 37 | + <para> |
| 38 | + Finally, the client access library |
26 | 39 | (<application>libpq</application>) can be built using
|
27 | 40 | <productname>Visual C++ 7.1</productname> or
|
28 | 41 | <productname>Borland C++</productname> for compatibility with statically
|
|
34 | 47 | <productname>Cygwin</productname> uses the normal build system, see
|
35 | 48 | <xref linkend="installation"> and the specific notes in
|
36 | 49 | <xref linkend="installation-notes-mingw"> and <xref linkend="installation-notes-cygwin">.
|
| 50 | + These builds cannot generate 64-bit binaries. |
37 | 51 | <productname>Cygwin</productname> is not recommended and should
|
38 | 52 | only be used for older versions of <productname>Windows</productname> where
|
39 | 53 | the native build does not work, such as
|
40 |
| - <productname>Windows 98</productname>. |
| 54 | + <productname>Windows 98</productname>. <productname>MinGW</productname> is |
| 55 | + only recommended if you are building other modules using it. The official |
| 56 | + binaries are built using <productname>Visual Studio</productname>. |
41 | 57 | </para>
|
42 | 58 |
|
43 | 59 | <sect1 id="install-win32-full">
|
44 |
| - <title>Building with <productname>Visual C++ 2005</productname></title> |
| 60 | + <title>Building with <productname>Visual C++</productname> or the |
| 61 | + <productname>Platform SDK</productname></title> |
| 62 | + |
| 63 | + <para> |
| 64 | + PostgreSQL can be built using the Visual C++ compiler suite from Microsoft. |
| 65 | + These compilers can be either from <productname>Visual Studio</productname>, |
| 66 | + <productname>Visual Studio Express</productname> or recent versions of the |
| 67 | + <productname>Platform SDK</productname>. If you do not already have a |
| 68 | + <productname>Visual Studio</productname> environment set up, the easiest |
| 69 | + way us to use the compilers in the <productname>Platform SDK</productname>, |
| 70 | + which is a free download from Microsoft. |
| 71 | + </para> |
45 | 72 |
|
46 | 73 | <para>
|
47 |
| - The tools for building using <productname>Visual C++ 2005</productname>, |
| 74 | + PostgreSQL supports the compilers from |
| 75 | + <productname>Visual Studio 2005</productname> and |
| 76 | + <productname>Visual Studio 2008</productname>. When using the Platform SDK |
| 77 | + only, or when building for 64-bit Windows, only |
| 78 | + <productname>Visual Studio 2008</productname> is supported. |
| 79 | + </para> |
| 80 | + |
| 81 | + <para> |
| 82 | + The tools for building using <productname>Visual C++</productname>, |
48 | 83 | are in the <filename>src/tools/msvc</filename> directory. When building,
|
49 | 84 | make sure there are no tools from <productname>MinGW</productname> or
|
50 | 85 | <productname>Cygwin</productname> present in your system PATH. Also, make
|
51 |
| - sure you have all the required Visual C++ tools available in the PATH, |
52 |
| - usually by starting a <application>Visual Studio Command Prompt</application> |
53 |
| - and running the commands from there. All commands should be run from the |
54 |
| - <filename>src\tools\msvc</filename> directory. |
| 86 | + sure you have all the required Visual C++ tools available in the PATH. In |
| 87 | + <productname>Visual Studio</productname>, start the |
| 88 | + <application>Visual Studio Command Prompt</application>. In the |
| 89 | + <productname>Platform SDK</productname>, start the |
| 90 | + <application>CMD shell</application> listed under the SDK on the Start Menu. |
| 91 | + If you wish to build a 64-bit version, you must use the 64-bit version of |
| 92 | + the command, and vice versa. |
| 93 | + All commands should be run from the <filename>src\tools\msvc</filename> |
| 94 | + directory. |
| 95 | + </para> |
| 96 | + |
| 97 | + <para> |
| 98 | + Before you build, you may need to edit the file <filename>config.pl</filename> |
| 99 | + to reflect any configuration options you want to change, or the paths to |
| 100 | + any third party libraries to use. The complete configuration is determined |
| 101 | + by first reading and parsing the file <filename>config_default.pl</filename>, |
| 102 | + and then apply any changes from <filename>config.pl</filename>. For example, |
| 103 | + to specify the location of your <productname>Python</productname> installation, |
| 104 | + put the following in <filename>config.pl</filename>: |
| 105 | + <screen> |
| 106 | + $config->{python} = 'c:\python26'; |
| 107 | + </screen> |
| 108 | + You only need to specify those parameters that are different from what's in |
| 109 | + <filename>config_default.pl</filename>. |
55 | 110 | </para>
|
56 | 111 |
|
57 | 112 | <para>
|
58 |
| - Before you build, edit the file <filename>config.pl</filename> to reflect the |
59 |
| - configuration options you want set, including the paths to libraries used. |
60 | 113 | If you need to set any other environment variables, create a file called
|
61 | 114 | <filename>buildenv.pl</filename> and put the required commands there. For
|
62 | 115 | example, to add the path for bison when it's not in the PATH, create a file
|
|
69 | 122 | <sect2>
|
70 | 123 | <title>Requirements</title>
|
71 | 124 | <para>
|
72 |
| - PostgreSQL will build using either the professional versions (any edition) |
73 |
| - or the free Express edition of |
74 |
| - <productname>Visual Studio 2005</productname>. The following additional products |
75 |
| - are required to build the complete package. Use the |
| 125 | + The following additional products are required to build |
| 126 | + <productname>PostgreSQL</productname>. Use the |
76 | 127 | <filename>config.pl</filename> file to specify which directories the libraries
|
77 | 128 | are available in.
|
78 | 129 |
|
79 | 130 | <variablelist>
|
| 131 | + <varlistentry> |
| 132 | + <term><productname>Microsoft Platform SDK</productname></term> |
| 133 | + <listitem><para> |
| 134 | + It is recommended that you upgrade to the latest available version |
| 135 | + of the <productname>Microsoft Platform SDK</productname>, available |
| 136 | + for download from <ulink url="http://www.microsoft.com/downloads/"></>. |
| 137 | + </para> |
| 138 | + <para> |
| 139 | + You must always include the |
| 140 | + <application>Windows Headers and Libraries</application> part of the SDK. |
| 141 | + If you install the <productname>Platform SDK</productname> |
| 142 | + including the <application>Visual C++ Compilers</application>, |
| 143 | + you don't need <productname>Visual Studio</productname> to build. |
| 144 | + </para></listitem> |
| 145 | + </varlistentry> |
| 146 | + |
80 | 147 | <varlistentry>
|
81 | 148 | <term><productname>ActiveState Perl</productname></term>
|
82 | 149 | <listitem><para>
|
|
88 | 155 | </para></listitem>
|
89 | 156 | </varlistentry>
|
90 | 157 |
|
| 158 | + </variablelist> |
| 159 | + </para> |
| 160 | + <para> |
| 161 | + The following additional products are not required to get started, |
| 162 | + but are required to build the complete package. Use the |
| 163 | + <filename>config.pl</filename> file to specify which directories the libraries |
| 164 | + are available in. |
| 165 | + |
| 166 | + <variablelist> |
91 | 167 | <varlistentry>
|
92 | 168 | <term><productname>ActiveState TCL</productname></term>
|
93 | 169 | <listitem><para>
|
|
126 | 202 | </para></listitem>
|
127 | 203 | </varlistentry>
|
128 | 204 |
|
129 |
| - <varlistentry> |
130 |
| - <term><productname>Microsoft Platform SDK</productname></term> |
131 |
| - <listitem><para> |
132 |
| - It is recommended that you upgrade to the latest available version |
133 |
| - of the <productname>Microsoft Platform SDK</productname>, available |
134 |
| - for download from <ulink url="http://www.microsoft.com/downloads/"></>. |
135 |
| - </para></listitem> |
136 |
| - </varlistentry> |
137 |
| - |
138 | 205 | <varlistentry>
|
139 | 206 | <term><productname>MIT Kerberos</productname></term>
|
140 | 207 | <listitem><para>
|
|
194 | 261 | </para>
|
195 | 262 | </sect2>
|
196 | 263 |
|
| 264 | + <sect2> |
| 265 | + <title>Special considerations for 64-bit Windows</title> |
| 266 | + |
| 267 | + <para> |
| 268 | + PostgreSQL will only build for the x64 architecture on 64-bit Windows, there |
| 269 | + is no support for Itanium processors. |
| 270 | + </para> |
| 271 | + |
| 272 | + <para> |
| 273 | + Mixing 32- and 64-bit versions in the same build tree is not supported. |
| 274 | + The build system will automatically detect if it's running in a 32- or |
| 275 | + 64-bit environment, and build PostgreSQL accordingly. For this reason, it |
| 276 | + is important to start the correct command prompt before building. |
| 277 | + </para> |
| 278 | + |
| 279 | + <para> |
| 280 | + To use a server-side third party library such as <productname>python</> or |
| 281 | + <productname>openssl</>, this library <emphasis>must</emphasis> also be |
| 282 | + 64-bit. There is no support for loading a 32-bit library in a 64-bit |
| 283 | + server. Several of the third party libraries that PostgreSQL supports may |
| 284 | + only be available in 32-bit versions, in which case they cannot be used with |
| 285 | + 64-bit PostgreSQL. |
| 286 | + </para> |
| 287 | + </sect2> |
| 288 | + |
197 | 289 | <sect2>
|
198 | 290 | <title>Building</title>
|
199 | 291 |
|
|
264 | 356 | required to initialize and use the database, run the command:
|
265 | 357 | <screen>
|
266 | 358 | <userinput>
|
267 |
| - perl install.pl c:\destination\directory |
| 359 | + install c:\destination\directory |
268 | 360 | </userinput>
|
269 | 361 | </screen>
|
270 | 362 | </para>
|
|
374 | 466 | <productname>Borland C++</productname></title>
|
375 | 467 |
|
376 | 468 | <para>
|
377 |
| - Using <productname>Visual C++ 7.1-8.0</productname> or |
| 469 | + Using <productname>Visual C++ 7.1-9.0</productname> or |
378 | 470 | <productname>Borland C++</productname> to build libpq is only recommended
|
379 | 471 | if you need a version with different debug/release flags, or if you need a
|
380 | 472 | static library to link into an application. For normal use the
|
381 | 473 | <productname>MinGW</productname> or
|
382 |
| - <productname>Visual Studio 2005</productname> version is recommended. |
| 474 | + <productname>Visual Studio</productname> or |
| 475 | + <productname>Platform SDK</productname> method is recommended. |
383 | 476 | </para>
|
384 | 477 |
|
385 | 478 | <para>
|
|
0 commit comments