加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

利用postgresql(PG9.1.1)源码搭建win32调试环境

发布时间:2020-12-13 17:38:13 所属栏目:百科 来源:www.Postgresql.org 文件夹:E:
导读:把以前写的东西,在这里整理一下,顺便根据新代码做些调整。 PG 源码 网站: www.Postgresql.org 文件夹: E:PG1- 源码 postgresql-9.1.1.tar.bz2 解压到: E:PGPostgreSQL 解压后的文件夹: E:PGPostgreSQLpostgresql-9.1.1 vs2005 自备 添加 C:W

把以前写的东西,在这里整理一下,顺便根据新代码做些调整。

PG源码

网站:www.Postgresql.org

文件夹:E:PG1-源码postgresql-9.1.1.tar.bz2

解压到:E:PGPostgreSQL

解压后的文件夹:E:PGPostgreSQLpostgresql-9.1.1

vs2005

自备

添加C:WINDOWSMicrosoft.NETFrameworkv2.0.50727到环境变量PATH

set path=%path%;C:WINDOWSMicrosoft.NETFrameworkv2.0.50727

命令行中,不区分大小写,但仅限于会话级别有效。

开源工具

可以去下载,下载地址以后补充。

文件夹位置:E:PGpgdebug

工具:opensslPerlprogPython24Tcl

配置

文件位置:E:PGPostgreSQLpostgresql-9.1.1srctoolsmsvcconfig_default.pl

使用UE打开

# Configuration arguments for vcbuild.

use strict;

use warnings;

our $config = {

asserts=>0,# --enable-cassert

# integer_datetimes=>1,# --enable-integer-datetimes - on is now default

# float4byval=>1,# --disable-float4-byval,on by default

# float8byval=>0,# --disable-float8-byval,off by default

# blocksize => 8,# --with-blocksize,8kB by default

# wal_blocksize => 8,# --with-wal-blocksize,8kB by default

# wal_segsize => 16,# --with-wal-segsize,16MB by default

ldap=>1,# --with-ldap

nls=>undef,# --enable-nls=<path>

tcl=>'E:PGpgdebugtcl',# --with-tls=<path>

perl=>'E:PGpgdebugperl',# --with-perl

python=>'E:PGpgdebugPython24',# --with-python=<path>

krb5=>'E:PGpgdebugprogpgsqldependkrb5',# --with-krb5=<path>

openssl=>'E:PGpgdebugopenssl',# --with-ssl=<path>

#uuid=>undef,# --with-ossp-uuid

xml=>'E:PGpgdebugprogpgsqldependlibxml2',# --with-libxml=<path>

xslt=>'E:PGpgdebugprogpgsqldependlibxslt',# --with-libxslt=<path>

iconv=>'E:PGpgdebugprogpgsqldependiconv',# (not in configure,path to iconv)

zlib=>'E:PGpgdebugprogpgsqldependzlib'# --with-zlib=<path>

};

1;

配置perl环境变量

set path=E:PGpgdebugPerlbin;%path%

生成

cd /d E:PGPostgreSQLpostgresql-9.1.1srctoolsmsvc

perl build.pl DEBUG

cd /d E:PGPostgreSQLpostgresql-9.1.1

mkdirmain

perl install.pl E:PGPostgreSQLpostgresql-9.1.1main

cd /d E:PGpgdebugprogpgsqldependkrb5bin

copy *.dll E:PGPostgreSQLpostgresql-9.1.1mainbin

cd /d E:PGPostgreSQLpostgresql-9.1.1mainbin

initdb.exe --no-localepgdb

词法文件

修正9个词法文件,取消其属性中的执行指令和输出文件。

srcbackendparserscan.l

contribcubecubescan.l

srcbinpsqlpsqlscan.l

srcinterfacesecpgpreprocpgc.l

srcbackendbootstrapbootscanner.l

srcbackendreplicationrepl_scanner.l

contribsegsegscan.l

srcbackendutilsmiscguc-file.l

srctestisolationspecscanner.l

8个语法文件,做如上处理

srcbackendparsergram.y
srcbackendbootstrapbootparse.y
srcbackendreplicationrepl_gram.y
srcplplpgsqlsrcgram.y
srctestisolationspecparse.y
srcinterfacesecpgpreprocpreproc.y
contribcubecubeparse.y
contribsegsegparse.y

修正文件

修改下面文件中的代码,注释掉该行。

srcbackendmainmain.c

//check_root(progname);


修改文件属性

调试-->命令参数和工作目录

-D pgdb

E:PGPostgreSQLpostgresql-9.1.1mainbin

链接器-->常规-->输出文件

E:PGPostgreSQLpostgresql-9.1.1mainbinpostgres.exe

调试

经过注释所有词法和语法文件,可随意重新生成exe文件。

......

114>stem_ISO_8859_1_danish.c
114>api.c
114>dict_snowball.c
114>Generate DEF file
114>Not re-generating DICT_SNOWBALL.DEF,file already exists.
114>正在链接...
114> 正在创建库 Debugdict_snowballdict_snowball.lib 和对象 Debugdict_snowballdict_snowball.exp
114>正在嵌入清单...
114>生成日志保存在“file://e:PGPostgreSQLpostgresql-9.1.1Debugdict_snowballBuildLog.htm”
114>dict_snowball - 0 个错误,0 个警告
========== 全部重新生成: 114 已成功,0 已失败,0 已跳过 ==========

出现调试后台,即完成目的。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读