1.config_default.pl按如下修改:
perl => 'C:\toolchain\win64\perl-5.14.4', # --with-perl
python => 'C:\toolchain\win64\python-2.7.8', # --with-python=<path>zlib => 'C:\toolchain\win64\zlib-1.2.3-5-vc90sp1' # --with-zlib=<path>
注意,编译windows 64位的Posgresql-9.3.5,使用的依赖库都是windows 64位的.
2.新建config.pl文件如下
$config->{python} = 'C:\toolchain\win64\python-2.7.8';
$config->{perl} = 'C:\perl64';
$config->{openssl} = 'C:\toolchain\win64\openssl-0.9.8i-1-vc90sp1';
$config->{zlib} = 'C:\toolchain\win64\zlib-1.2.3-5-vc90sp1';
3.Solution.pm修改如下
if ($self->{options}->{zlib})
{
$proj->AddIncludeDir($self->{options}->{zlib} . '\include');
- $proj->AddLibrary($self->{options}->{zlib} . '\bin\zdll.lib');
+ $proj->AddLibrary($self->{options}->{zlib} . '\lib\zdll.lib');
}
if ($self->{options}->{openssl})
{
$proj->AddIncludeDir($self->{options}->{openssl} . '\include');
$proj->AddLibrary(
- $self->{options}->{openssl} . '\bin\ssleay32.lib', 1);
+ $self->{options}->{openssl} . '\lib\VC\ssleay32.lib', 1);
$proj->AddLibrary(
- $self->{options}->{openssl} . '\bin\libeay32.lib', 1);
+ $self->{options}->{openssl} . '\lib\VC\libeay32.lib', 1);
}
4.执行构建步骤如下:
<execute>unzip -o postgresql-9.3.5.zip</execute>
<execute>mkdir pg_win64</execute>
<execute>mv config.pl postgresql-9.3.5/src/tools/msvc</execute>
<execute>todos -u config_default.patch</execute>
<execute>todos -u Solution.patch</execute>
<execute>cd postgresql-9.3.5/src/tools/msvc/</execute>
<execute>patch -R -p0 < ../../../../config_default.patch</execute>
<execute>patch -R -p0 < ../../../../Solution.patch</execute>
<execute>call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64</execute>
<execute>build.bat</execute>
<execute>install.bat "c:\pg_win64"</execute>
5.最终会在pg_win64下看到编译的结果