vs2008编译Postgresql-9.3.5

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>
openssl => 'C:\toolchain\win64\openssl-0.9.8i-1-vc90sp1',    # --with-ssl=<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 &lt; ../../../../config_default.patch</execute>
            <execute>patch -R -p0 &lt; ../../../../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下看到编译的结果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值