Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
83078e99
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83078e99
编写于
9月 15, 2006
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Several fixes for MSVC build scripts, from Magnus.
上级
aab964b3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
87 addition
and
46 deletion
+87
-46
src/tools/msvc/Project.pm
src/tools/msvc/Project.pm
+50
-24
src/tools/msvc/Solution.pm
src/tools/msvc/Solution.pm
+14
-2
src/tools/msvc/build.bat
src/tools/msvc/build.bat
+18
-12
src/tools/msvc/mkvcbuild.pl
src/tools/msvc/mkvcbuild.pl
+5
-8
未找到文件。
src/tools/msvc/Project.pm
浏览文件 @
83078e99
...
...
@@ -81,7 +81,7 @@ sub AddReference {
while
(
my
$ref
=
shift
)
{
push
@
{
$self
->
{
references
}},
$ref
;
$self
->
AddLibrary
("
debug
\\
"
.
$ref
->
{
name
}
.
"
\\
"
.
$ref
->
{
name
}
.
"
.lib
")
if
(
$ref
->
{
type
}
eq
"
exe
");
$self
->
AddLibrary
("
__CFGNAME__
\\
"
.
$ref
->
{
name
}
.
"
\\
"
.
$ref
->
{
name
}
.
"
.lib
");
}
}
...
...
@@ -113,8 +113,8 @@ sub FullExportDLL {
my
(
$self
,
$libname
)
=
@_
;
$self
->
{
builddef
}
=
1
;
$self
->
{
def
}
=
"
.
\\
debug
\\
$self
->{name}
\\
$self
->{name}.def
";
$self
->
{
implib
}
=
"
debug
\\
$self
->{name}
\\
$libname
";
$self
->
{
def
}
=
"
.
\\
__CFGNAME__
\\
$self
->{name}
\\
$self
->{name}.def
";
$self
->
{
implib
}
=
"
__CFGNAME__
\\
$self
->{name}
\\
$libname
";
}
sub
UseDef
{
...
...
@@ -286,19 +286,19 @@ EOF
my
$of
=
$f
;
$of
=~
s/\.y$/.c/
;
$of
=~
s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c}
;
print
F
'
>
<FileConfiguration Name="Debug|Win32"><Tool Name="VCCustomBuildTool" Description="Running bison on
'
.
$f
.
'
" CommandLine="vcbuild\pgbison.bat
'
.
$f
.
'
" AdditionalDependencies="" Outputs="
'
.
$of
.
'
" /></FileConfiguration>
</File>
'
.
"
\n
";
print
F
'
>
'
.
GenerateCustomTool
('
Running bison on
'
.
$f
,
'
src\tools\msvc\pgbison.bat
'
.
$f
,
$of
)
.
'
</File>
'
.
"
\n
";
}
elsif
(
$f
=~
/\.l$/
)
{
my
$of
=
$f
;
$of
=~
s/\.l$/.c/
;
$of
=~
s{^src\\pl\\plpgsql\\src\\scan.c$}{src\\pl\\plpgsql\\src\\pl_scan.c}
;
print
F
"
><FileConfiguration Name=
\"
Debug|Win32
\"
><Tool Name=
\"
VCCustomBuildTool
\"
Description=
\"
Running flex on
$f
\"
CommandLine=
\"
vcbuild
\\
pgflex.bat
$f
\"
AdditionalDependencies=
\"\"
Outputs=
\"
$of
\"
/></FileConfiguration></File>
\n
";
print
F
'
>
'
.
GenerateCustomTool
('
Running flex on
'
.
$f
,
'
src\tools\msvc\pgflex.bat
'
.
$f
,
$of
)
.
'
</File>
'
.
"
\n
";
}
elsif
(
defined
(
$uniquefiles
{
$file
}))
{
# File already exists, so fake a new name
my
$obj
=
$dir
;
$obj
=~
s/\\/_/g
;
print
F
"
><FileConfiguration Name=
\"
Debug|Win32
\"
><Tool Name=
\"
VCCLCompilerTool
\"
ObjectFile=
\"
.
\\
debug
\\
$self
->{name}
\\
$obj
"
.
"
_
$file
.obj
\"
/></FileConfiguration></File>
\n
";
print
F
"
><FileConfiguration Name=
\"
Debug|Win32
\"
><Tool Name=
\"
VCCLCompilerTool
\"
ObjectFile=
\"
.
\\
debug
\\
$self
->{name}
\\
$obj
"
.
"
_
$file
.obj
\"
/></FileConfiguration><
FileConfiguration Name=
\"
Release|Win32
\"
><Tool Name=
\"
VCCLCompilerTool
\"
ObjectFile=
\"
.
\\
release
\\
$self
->{name}
\\
$obj
"
.
"
_
$file
.obj
\"
/></FileConfiguration><
/File>
\n
";
}
else
{
$uniquefiles
{
$file
}
=
1
;
...
...
@@ -313,6 +313,15 @@ EOF
close
(
F
);
}
sub
GenerateCustomTool
{
my
(
$desc
,
$tool
,
$output
,
$cfg
)
=
@_
;
if
(
!
defined
(
$cfg
))
{
return
GenerateCustomTool
(
$desc
,
$tool
,
$output
,
'
Debug
')
.
GenerateCustomTool
(
$desc
,
$tool
,
$output
,
'
Release
');
}
return
"
<FileConfiguration Name=
\"
$cfg
|Win32
\"
><Tool Name=
\"
VCCustomBuildTool
\"
Description=
\"
$desc
\"
CommandLine=
\"
$tool
\"
AdditionalDependencies=
\"\"
Outputs=
\"
$output
\"
/></FileConfiguration>
";
}
sub
WriteReferences
{
my
(
$self
,
$f
)
=
@_
;
print
$f
"
<References>
\n
";
...
...
@@ -325,48 +334,65 @@ sub WriteReferences {
sub
WriteHeader
{
my
(
$self
,
$f
)
=
@_
;
my
$cfgtype
=
(
$self
->
{
type
}
eq
"
exe
")?
1
:(
$self
->
{
type
}
eq
"
dll
"?
2
:
4
);
print
$f
<<EOF;
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="$self->{name}" ProjectGUID="$self->{guid}">
<Platforms><Platform Name="Win32"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory=".\\Debug\\$self->{name}" IntermediateDirectory=".\\Debug\\$self->{name}"
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2">
<Tool Name="VCCLCompilerTool" Optimization="0"
EOF
$self
->
WriteConfiguration
(
$f
,
'
Debug
',
{
defs
=>
'
_DEBUG;DEBUG=1;
',
wholeopt
=>
0
,
opt
=>
0
,
strpool
=>
'
false
',
runtime
=>
3
});
$self
->
WriteConfiguration
(
$f
,
'
Release
',
{
defs
=>
'',
wholeopt
=>
0
,
opt
=>
3
,
strpool
=>
'
true
',
runtime
=>
2
});
print
$f
<<EOF;
</Configurations>
EOF
}
sub
WriteConfiguration
{
my
(
$self
,
$f
,
$cfgname
,
$p
)
=
@_
;
my
$cfgtype
=
(
$self
->
{
type
}
eq
"
exe
")?
1
:(
$self
->
{
type
}
eq
"
dll
"?
2
:
4
);
my
$libs
=
$self
->
{
libraries
};
$libs
=~
s/__CFGNAME__/$cfgname/g
;
print
$f
<<EOF;
<Configuration Name="$cfgname|Win32" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}"
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}">
<Tool Name="VCCLCompilerTool" Optimization="$p->{opt}"
AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{solution}->{options}->{pthread};$self->{includes}"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;__WINDOWS__;DEBUG=1;__WIN32__;EXEC_BACKEND;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}"
RuntimeLibrary="3" DisableSpecificWarnings="$self->{disablewarnings}"
PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}"
StringPooling="$p->{strpool}"
RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}"
EOF
print
$f
<<EOF;
AssemblerOutput="0" AssemblerListingLocation=".\\
debug\\$self->{name}\\" ObjectFile=".\\debug
\\$self->{name}\\"
ProgramDataBaseFileName=".\\
debug
\\$self->{name}\\" BrowseInformation="0"
AssemblerOutput="0" AssemblerListingLocation=".\\
$cfgname\\$self->{name}\\" ObjectFile=".\\$cfgname
\\$self->{name}\\"
ProgramDataBaseFileName=".\\
$cfgname
\\$self->{name}\\" BrowseInformation="0"
WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/>
<Tool Name="VCLinkerTool" OutputFile=".\\
debug
\\$self->{name}\\$self->{name}.$self->{type}"
AdditionalDependencies="$
self->{libraries}
"
<Tool Name="VCLinkerTool" OutputFile=".\\
$cfgname
\\$self->{name}\\$self->{name}.$self->{type}"
AdditionalDependencies="$
libs
"
LinkIncremental="0" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libc"
StackReserveSize="4194304" DisableSpecificWarnings="$self->{disablewarnings}"
GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\
debug
\\$self->{name}\\$self->{name}.pdb"
GenerateMapFile="FALSE" MapFileName=".\\
debug
\\$self->{name}\\$self->{name}.map"
GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\
$cfgname
\\$self->{name}\\$self->{name}.pdb"
GenerateMapFile="FALSE" MapFileName=".\\
$cfgname
\\$self->{name}\\$self->{name}.map"
SubSystem="1" TargetMachine="1"
EOF
if
(
$self
->
{
implib
})
{
print
$f
"
\t\t
ImportLibrary=
\"
$self
->{implib}
\"\n
";
my
$l
=
$self
->
{
implib
};
$l
=~
s/__CFGNAME__/$cfgname/g
;
print
$f
"
\t\t
ImportLibrary=
\"
$l
\"\n
";
}
if
(
$self
->
{
def
})
{
print
$f
"
\t\t
ModuleDefinitionFile=
\"
$self
->{def}
\"\n
";
my
$d
=
$self
->
{
def
};
$d
=~
s/__CFGNAME__/$cfgname/g
;
print
$f
"
\t\t
ModuleDefinitionFile=
\"
$d
\"\n
";
}
print
$f
"
\t
/>
\n
";
print
$f
"
\t
<Tool Name=
\"
VCLibrarianTool
\"
OutputFile=
\"
.
\\
Debug
\\
$self
->{name}
\\
$self
->{name}.lib
\"
IgnoreDefaultLibraryNames=
\"
libc
\"
/>
\n
";
print
$f
"
\t
<Tool Name=
\"
VCLibrarianTool
\"
OutputFile=
\"
.
\\
$cfgname
\\
$self
->{name}
\\
$self
->{name}.lib
\"
IgnoreDefaultLibraryNames=
\"
libc
\"
/>
\n
";
print
$f
"
\t
<Tool Name=
\"
VCResourceCompilerTool
\"
AdditionalIncludeDirectories=
\"
src
\\
include
\"
/>
\n
";
if
(
$self
->
{
builddef
})
{
print
$f
"
\t
<Tool Name=
\"
VCPreLinkEventTool
\"
Description=
\"
Generate DEF file
\"
CommandLine=
\"
perl
vcbuild
\\
gendef.pl debug
\\
$self
->{name}
\"
/>
\n
";
print
$f
"
\t
<Tool Name=
\"
VCPreLinkEventTool
\"
Description=
\"
Generate DEF file
\"
CommandLine=
\"
perl
src
\\
tools
\\
msvc
\\
gendef.pl
$cfgname
\\
$self
->{name}
\"
/>
\n
";
}
print
$f
<<EOF;
</Configuration>
</Configurations>
EOF
}
...
...
src/tools/msvc/Solution.pm
浏览文件 @
83078e99
...
...
@@ -21,8 +21,8 @@ sub new {
# Special case - if config.pl has changed, always return 1
sub
IsNewer
{
my
(
$newfile
,
$oldfile
)
=
@_
;
if
(
$oldfile
ne
'
vcbuild
\config.pl
')
{
return
1
if
IsNewer
(
$newfile
,
'
vcbuild
\config.pl
');
if
(
$oldfile
ne
'
src\tools\msvc
\config.pl
')
{
return
1
if
IsNewer
(
$newfile
,
'
src\tools\msvc
\config.pl
');
}
return
1
if
(
!
(
-
e
$newfile
));
my
@nstat
=
stat
(
$newfile
);
...
...
@@ -177,6 +177,17 @@ sub GenerateFiles {
chdir
('
..\..\..
');
}
if
(
IsNewer
('
src\interfaces\ecpg\include\ecpg_config.h
',
'
src\interfaces\ecpg\include\ecpg_config.h.in
'))
{
print
"
Generating ecpg_config.h...
\n
";
open
(
O
,'
>
','
src\interfaces\ecpg\include\ecpg_config.h
')
||
confess
"
Could not open ecpg_config.h
";
print
O
<<EOF;
#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT_64
#endif
EOF
close
(
O
);
}
unless
(
-
f
"
src
\\
port
\\
pg_config_paths.h
")
{
print
"
Generating pg_config_paths.h...
\n
";
open
(
O
,'
>
',
'
src\port\pg_config_paths.h
')
||
confess
"
Could not open pg_config_paths.h
";
...
...
@@ -271,6 +282,7 @@ EOF
print
SLN
<<EOF;
$proj->{guid}.Debug|Win32.ActiveCfg = Debug|Win32
$proj->{guid}.Debug|Win32.Build.0 = Debug|Win32
$proj->{guid}.Release|Win32.ActiveCfg = Release|Win32
$proj->{guid}.Release|Win32.Build.0 = Release|Win32
EOF
}
...
...
src/tools/msvc/build.bat
浏览文件 @
83078e99
@echo
off
SET
STARTDIR
=
%CD%
perl
mkvcbuild
.pl
if
errorlevel
1
goto
:eof
if
exist
..\vcbuild
if
exist
..\src
cd
..
if
"
%
1"
==
""
msbuild
pgsql
.sln
if
not
"
%
1"
==
""
vcbuild
%
1
.vcproj
cd
%STARTDIR%
@echo
off
SET
STARTDIR
=
%CD%
perl
mkvcbuild
.pl
if
errorlevel
1
goto
:eof
if
exist
..\msvc
if
exist
..\..\..\src
cd
..\..\..
SET
CONFIG
=
if
"
%
1"
==
""
set
CONFIG
=
Debug
if
"
%CONFIG%
"
==
""
if
"
%
1"
==
"DEBUG"
set
CONFIG
=
Debug
if
"
%CONFIG%
"
==
""
if
"
%
1"
==
"RELEASE"
set
CONFIG
=
Release
if
not
"
%CONFIG%
"
==
""
shift
if
"
%CONFIG%
"
==
""
set
CONFIG
=
Debug
if
"
%
1"
==
""
msbuild
pgsql
.sln
/p
:Configuration
=
%CONFIG%
if
not
"
%
1"
==
""
vcbuild
%
1
.vcproj
%CONFIG%
cd
%STARTDIR%
src/tools/msvc/mkvcbuild.pl
浏览文件 @
83078e99
...
...
@@ -5,12 +5,12 @@ use warnings;
use
Project
;
use
Solution
;
chdir
('
..
')
if
(
-
d
'
..\vcbuild
'
&&
-
d
'
..\src
');
die
'
Must run from root
directory or vcbuild directory
'
unless
(
-
d
'
vcbuild
'
&&
-
d
'
src
');
die
'
Could not find config.pl
'
unless
(
-
f
'
vcbuild
/config.pl
');
chdir
('
..
\..\..
')
if
(
-
d
'
..\msvc
'
&&
-
d
'
..\..\
..\src
');
die
'
Must run from root
or msvc directory
'
unless
(
-
d
'
src\tools\msvc
'
&&
-
d
'
src
');
die
'
Could not find config.pl
'
unless
(
-
f
'
src/tools/msvc
/config.pl
');
our
$config
;
require
'
vcbuild
/config.pl
';
require
'
src/tools/msvc
/config.pl
';
my
$solution
=
new
Solution
(
$config
);
...
...
@@ -79,6 +79,7 @@ my $libpq = $solution->AddProject('libpq','dll','interfaces','src\interfaces\lib
$libpq
->
AddDefine
('
FRONTEND
');
$libpq
->
AddIncludeDir
('
src\port
');
$libpq
->
AddLibrary
('
wsock32.lib
');
$libpq
->
AddLibrary
('
wldap32.lib
')
if
(
$solution
->
{
options
}
->
{
ldap
});
$libpq
->
UseDef
('
src\interfaces\libpq\libpqdll.def
');
$libpq
->
ReplaceFile
('
src\interfaces\libpq\libpqrc.c
','
src\interfaces\libpq\libpq.rc
');
...
...
@@ -188,8 +189,6 @@ foreach my $prg (split /\s+/,$1) {
$proj
->
AddIncludeDir
('
src\bin\psql
');
$proj
->
AddReference
(
$libpq
,
$libpgport
);
$proj
->
AddResourceFile
('
src\bin\scripts
','
PostgreSQL Utility
');
$proj
->
AddLibrary
('
debug\libpgport\libpgport.lib
');
$proj
->
AddLibrary
('
debug\libpq\libpq.lib
');
}
$/
=
$t
;
...
...
@@ -224,11 +223,9 @@ sub AddSimpleFrontend {
$p
->
AddDir
('
src\bin
\\
'
.
$n
);
$p
->
AddDefine
('
FRONTEND
');
$p
->
AddReference
(
$libpgport
);
$p
->
AddLibrary
('
debug\libpgport\libpgport.lib
');
if
(
$uselibpq
)
{
$p
->
AddIncludeDir
('
src\interfaces\libpq
');
$p
->
AddReference
(
$libpq
);
$p
->
AddLibrary
('
debug\libpq\libpq.lib
');
}
return
$p
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录