Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8a32ae47
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8a32ae47
编写于
3月 28, 2011
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7031571: Generate native VS2010 project files
Reviewed-by: hosterda, stefank, brutisso
上级
ec6f65d3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
597 addition
and
69 deletion
+597
-69
make/windows/create.bat
make/windows/create.bat
+3
-4
make/windows/makefiles/projectcreator.make
make/windows/makefiles/projectcreator.make
+1
-4
make/windows/makefiles/rules.make
make/windows/makefiles/rules.make
+2
-2
src/share/tools/ProjectCreator/Util.java
src/share/tools/ProjectCreator/Util.java
+0
-12
src/share/tools/ProjectCreator/WinGammaPlatform.java
src/share/tools/ProjectCreator/WinGammaPlatform.java
+5
-2
src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
+545
-0
src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
+41
-45
未找到文件。
make/windows/create.bat
浏览文件 @
8a32ae47
...
...
@@ -93,16 +93,15 @@ if "%MSC_VER%" == "1500" (
echo
Will
generate
VC9
{
Visual
Studio
2008
}
)
else
(
if
"
%MSC_VER%
"
==
"1600"
(
echo
Detected
Visual
Studio
2010
,
but
echo
will
generate
VC9
{
Visual
Studio
2008
}
echo
Use
conversion
wizard
in
VS
2010
.
echo
Will
generate
VC10
{
Visual
Studio
2010
}
set
ProjectFile
=
%HotSpotBuildSpace%
\jvm.vcxproj
)
else
(
echo
Will
generate
VC7
project
{
Visual
Studio
2003
.NET
}
)
)
)
)
echo
%ProjectFile%
echo
%ProjectFile%
echo
**************************************************************
REM Test all variables to see whether the directories they
...
...
make/windows/makefiles/projectcreator.make
浏览文件 @
8a32ae47
...
...
@@ -27,10 +27,6 @@
# This is used externally by both batch and IDE builds, so can't
# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
#
# NOTE: unfortunately the ProjectCreatorSources list must be kept
# synchronized between this and the Solaris version
# (make/solaris/makefiles/projectcreator.make).
ProjectCreatorSources
=
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\D
irectoryTree.java
\
...
...
@@ -42,6 +38,7 @@ ProjectCreatorSources=\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\W
inGammaPlatformVC7.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\W
inGammaPlatformVC8.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\W
inGammaPlatformVC9.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\W
inGammaPlatformVC10.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\U
til.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\B
uildConfig.java
\
$(WorkSpace)
\s
rc
\s
hare
\t
ools
\P
rojectCreator
\A
rgsParser.java
...
...
make/windows/makefiles/rules.make
浏览文件 @
8a32ae47
...
...
@@ -65,8 +65,8 @@ VcVersion=VC9
!elseif
"$(MSC_VER)"
==
"1600"
# for compatibility - we don't yet have a ProjectCreator for
VC10
VcVersion
=
VC9
VcVersion
=
VC10
ProjectFile
=
jvm.vcxproj
!
else
...
...
src/share/tools/ProjectCreator/Util.java
浏览文件 @
8a32ae47
...
...
@@ -47,18 +47,6 @@ public class Util {
return
sb
.
toString
();
}
static
String
join
(
String
padder
,
String
v
[])
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
v
.
length
;
i
++)
{
sb
.
append
(
v
[
i
]);
if
(
i
<
(
v
.
length
-
1
))
sb
.
append
(
padder
);
}
return
sb
.
toString
();
}
static
String
prefixed_join
(
String
padder
,
Vector
v
,
boolean
quoted
)
{
StringBuffer
sb
=
new
StringBuffer
();
...
...
src/share/tools/ProjectCreator/WinGammaPlatform.java
浏览文件 @
8a32ae47
...
...
@@ -587,7 +587,6 @@ public abstract class WinGammaPlatform {
Vector
allConfigs
=
new
Vector
();
allConfigs
.
add
(
new
C1DebugConfig
());
allConfigs
.
add
(
new
C1FastDebugConfig
());
allConfigs
.
add
(
new
C1ProductConfig
());
...
...
@@ -655,6 +654,10 @@ public abstract class WinGammaPlatform {
boolean
isHeader
()
{
return
attr
.
shortName
.
endsWith
(
".h"
)
||
attr
.
shortName
.
endsWith
(
".hpp"
);
}
boolean
isCpp
()
{
return
attr
.
shortName
.
endsWith
(
".cpp"
);
}
}
...
...
@@ -708,7 +711,7 @@ public abstract class WinGammaPlatform {
PrintWriter
printWriter
;
public
void
writeProjectFile
(
String
projectFileName
,
String
projectName
,
Vector
allConfigs
)
throws
IOException
{
Vector
<
BuildConfig
>
allConfigs
)
throws
IOException
{
throw
new
RuntimeException
(
"use compiler version specific version"
);
}
}
src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
0 → 100644
浏览文件 @
8a32ae47
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Hashtable
;
import
java.util.Iterator
;
import
java.util.TreeSet
;
import
java.util.UUID
;
import
java.util.Vector
;
public
class
WinGammaPlatformVC10
extends
WinGammaPlatformVC7
{
@Override
protected
String
getProjectExt
()
{
return
".vcxproj"
;
}
@Override
public
void
writeProjectFile
(
String
projectFileName
,
String
projectName
,
Vector
<
BuildConfig
>
allConfigs
)
throws
IOException
{
System
.
out
.
println
();
System
.
out
.
print
(
" Writing .vcxproj file: "
+
projectFileName
);
String
projDir
=
Util
.
normalize
(
new
File
(
projectFileName
).
getParent
());
printWriter
=
new
PrintWriter
(
projectFileName
,
"UTF-8"
);
printWriter
.
println
(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
);
startTag
(
"Project"
,
"DefaultTargets"
,
"Build"
,
"ToolsVersion"
,
"4.0"
,
"xmlns"
,
"http://schemas.microsoft.com/developer/msbuild/2003"
);
startTag
(
"ItemGroup"
,
"Label"
,
"ProjectConfigurations"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
startTag
(
"ProjectConfiguration"
,
"Include"
,
cfg
.
get
(
"Name"
));
tagData
(
"Configuration"
,
cfg
.
get
(
"Id"
));
tagData
(
"Platform"
,
cfg
.
get
(
"PlatformName"
));
endTag
(
"ProjectConfiguration"
);
}
endTag
(
"ItemGroup"
);
startTag
(
"PropertyGroup"
,
"Label"
,
"Globals"
);
tagData
(
"ProjectGuid"
,
"{8822CB5C-1C41-41C2-8493-9F6E1994338B}"
);
tag
(
"SccProjectName"
);
tag
(
"SccLocalPath"
);
endTag
(
"PropertyGroup"
);
tag
(
"Import"
,
"Project"
,
"$(VCTargetsPath)\\Microsoft.Cpp.Default.props"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
startTag
(
cfg
,
"PropertyGroup"
,
"Label"
,
"Configuration"
);
tagData
(
"ConfigurationType"
,
"DynamicLibrary"
);
tagData
(
"UseOfMfc"
,
"false"
);
endTag
(
"PropertyGroup"
);
}
tag
(
"Import"
,
"Project"
,
"$(VCTargetsPath)\\Microsoft.Cpp.props"
);
startTag
(
"ImportGroup"
,
"Label"
,
"ExtensionSettings"
);
endTag
(
"ImportGroup"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
startTag
(
cfg
,
"ImportGroup"
,
"Label"
,
"PropertySheets"
);
tag
(
"Import"
,
"Project"
,
"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props"
,
"Condition"
,
"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')"
,
"Label"
,
"LocalAppDataPlatform"
);
endTag
(
"ImportGroup"
);
}
tag
(
"PropertyGroup"
,
"Label"
,
"UserMacros"
);
startTag
(
"PropertyGroup"
);
tagData
(
"_ProjectFileVersion"
,
"10.0.30319.1"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
tagData
(
cfg
,
"OutDir"
,
cfg
.
get
(
"OutputDir"
)
+
Util
.
sep
);
tagData
(
cfg
,
"IntDir"
,
cfg
.
get
(
"OutputDir"
)
+
Util
.
sep
);
tagData
(
cfg
,
"LinkIncremental"
,
"false"
);
}
for
(
BuildConfig
cfg
:
allConfigs
)
{
tagData
(
cfg
,
"CodeAnalysisRuleSet"
,
"AllRules.ruleset"
);
tag
(
cfg
,
"CodeAnalysisRules"
);
tag
(
cfg
,
"CodeAnalysisRuleAssemblies"
);
}
endTag
(
"PropertyGroup"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
startTag
(
cfg
,
"ItemDefinitionGroup"
);
startTag
(
"ClCompile"
);
tagV
(
cfg
.
getV
(
"CompilerFlags"
));
endTag
(
"ClCompile"
);
startTag
(
"Link"
);
tagV
(
cfg
.
getV
(
"LinkerFlags"
));
endTag
(
"Link"
);
startTag
(
"PostBuildEvent"
);
tagData
(
"Message"
,
BuildConfig
.
getFieldString
(
null
,
"PostbuildDescription"
));
tagData
(
"Command"
,
cfg
.
expandFormat
(
BuildConfig
.
getFieldString
(
null
,
"PostbuildCommand"
).
replace
(
"\t"
,
"\r\n"
)));
endTag
(
"PostBuildEvent"
);
startTag
(
"PreLinkEvent"
);
tagData
(
"Message"
,
BuildConfig
.
getFieldString
(
null
,
"PrelinkDescription"
));
tagData
(
"Command"
,
cfg
.
expandFormat
(
BuildConfig
.
getFieldString
(
null
,
"PrelinkCommand"
).
replace
(
"\t"
,
"\r\n"
)));
endTag
(
"PreLinkEvent"
);
endTag
(
"ItemDefinitionGroup"
);
}
writeFiles
(
allConfigs
,
projDir
);
tag
(
"Import"
,
"Project"
,
"$(VCTargetsPath)\\Microsoft.Cpp.targets"
);
startTag
(
"ImportGroup"
,
"Label"
,
"ExtensionTargets"
);
endTag
(
"ImportGroup"
);
endTag
(
"Project"
);
printWriter
.
close
();
System
.
out
.
println
(
" Done."
);
writeFilterFile
(
projectFileName
,
projectName
,
allConfigs
,
projDir
);
writeUserFile
(
projectFileName
,
allConfigs
);
}
private
void
writeUserFile
(
String
projectFileName
,
Vector
<
BuildConfig
>
allConfigs
)
throws
FileNotFoundException
,
UnsupportedEncodingException
{
String
userFileName
=
projectFileName
+
".user"
;
if
(
new
File
(
userFileName
).
exists
())
{
return
;
}
System
.
out
.
print
(
" Writing .vcxproj.user file: "
+
userFileName
);
printWriter
=
new
PrintWriter
(
userFileName
,
"UTF-8"
);
printWriter
.
println
(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
);
startTag
(
"Project"
,
"ToolsVersion"
,
"4.0"
,
"xmlns"
,
"http://schemas.microsoft.com/developer/msbuild/2003"
);
for
(
BuildConfig
cfg
:
allConfigs
)
{
startTag
(
cfg
,
"PropertyGroup"
);
tagData
(
"LocalDebuggerCommand"
,
"$(TargetDir)/hotspot.exe"
);
endTag
(
"PropertyGroup"
);
}
endTag
(
"Project"
);
printWriter
.
close
();
System
.
out
.
println
(
" Done."
);
}
private
void
writeFilterFile
(
String
projectFileName
,
String
projectName
,
Vector
<
BuildConfig
>
allConfigs
,
String
base
)
throws
FileNotFoundException
,
UnsupportedEncodingException
{
String
filterFileName
=
projectFileName
+
".filters"
;
System
.
out
.
print
(
" Writing .vcxproj.filters file: "
+
filterFileName
);
printWriter
=
new
PrintWriter
(
filterFileName
,
"UTF-8"
);
printWriter
.
println
(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
);
startTag
(
"Project"
,
"ToolsVersion"
,
"4.0"
,
"xmlns"
,
"http://schemas.microsoft.com/developer/msbuild/2003"
);
Hashtable
<
String
,
FileAttribute
>
allFiles
=
computeAttributedFiles
(
allConfigs
);
TreeSet
<
FileInfo
>
sortedFiles
=
sortFiles
(
allFiles
);
Vector
<
NameFilter
>
filters
=
makeFilters
(
sortedFiles
);
// first all filters
startTag
(
"ItemGroup"
);
for
(
NameFilter
filter
:
filters
)
{
doWriteFilter
(
filter
,
""
);
}
startTag
(
"Filter"
,
"Include"
,
"Resource Files"
);
UUID
uuid
=
UUID
.
randomUUID
();
tagData
(
"UniqueIdentifier"
,
"{"
+
uuid
.
toString
()
+
"}"
);
tagData
(
"Extensions"
,
"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
);
endTag
(
"Filter"
);
endTag
(
"ItemGroup"
);
// then all cpp files
startTag
(
"ItemGroup"
);
for
(
NameFilter
filter
:
filters
)
{
doWriteFiles
(
sortedFiles
,
filter
,
""
,
"ClCompile"
,
new
Evaluator
()
{
public
boolean
pick
(
FileInfo
fi
)
{
return
fi
.
isCpp
();
}
},
base
);
}
endTag
(
"ItemGroup"
);
// then all header files
startTag
(
"ItemGroup"
);
for
(
NameFilter
filter
:
filters
)
{
doWriteFiles
(
sortedFiles
,
filter
,
""
,
"ClInclude"
,
new
Evaluator
()
{
public
boolean
pick
(
FileInfo
fi
)
{
return
fi
.
isHeader
();
}
},
base
);
}
endTag
(
"ItemGroup"
);
// then all other files
startTag
(
"ItemGroup"
);
for
(
NameFilter
filter
:
filters
)
{
doWriteFiles
(
sortedFiles
,
filter
,
""
,
"None"
,
new
Evaluator
()
{
public
boolean
pick
(
FileInfo
fi
)
{
return
true
;
}
},
base
);
}
endTag
(
"ItemGroup"
);
endTag
(
"Project"
);
printWriter
.
close
();
System
.
out
.
println
(
" Done."
);
}
private
void
doWriteFilter
(
NameFilter
filter
,
String
start
)
{
startTag
(
"Filter"
,
"Include"
,
start
+
filter
.
fname
);
UUID
uuid
=
UUID
.
randomUUID
();
tagData
(
"UniqueIdentifier"
,
"{"
+
uuid
.
toString
()
+
"}"
);
endTag
(
"Filter"
);
if
(
filter
instanceof
ContainerFilter
)
{
Iterator
i
=
((
ContainerFilter
)
filter
).
babies
();
while
(
i
.
hasNext
())
{
doWriteFilter
((
NameFilter
)
i
.
next
(),
start
+
filter
.
fname
+
"\\"
);
}
}
}
interface
Evaluator
{
boolean
pick
(
FileInfo
fi
);
}
private
void
doWriteFiles
(
TreeSet
<
FileInfo
>
allFiles
,
NameFilter
filter
,
String
start
,
String
tool
,
Evaluator
eval
,
String
base
)
{
if
(
filter
instanceof
ContainerFilter
)
{
Iterator
i
=
((
ContainerFilter
)
filter
).
babies
();
while
(
i
.
hasNext
())
{
doWriteFiles
(
allFiles
,
(
NameFilter
)
i
.
next
(),
start
+
filter
.
fname
+
"\\"
,
tool
,
eval
,
base
);
}
}
else
{
Iterator
i
=
allFiles
.
iterator
();
while
(
i
.
hasNext
())
{
FileInfo
fi
=
(
FileInfo
)
i
.
next
();
if
(!
filter
.
match
(
fi
))
{
continue
;
}
if
(
eval
.
pick
(
fi
))
{
startTag
(
tool
,
"Include"
,
rel
(
fi
.
full
,
base
));
tagData
(
"Filter"
,
start
+
filter
.
fname
);
endTag
(
tool
);
// we not gonna look at this file anymore (sic!)
i
.
remove
();
}
}
}
}
void
writeFiles
(
Vector
<
BuildConfig
>
allConfigs
,
String
projDir
)
{
Hashtable
<
String
,
FileAttribute
>
allFiles
=
computeAttributedFiles
(
allConfigs
);
TreeSet
<
FileInfo
>
sortedFiles
=
sortFiles
(
allFiles
);
// first cpp-files
startTag
(
"ItemGroup"
);
for
(
FileInfo
fi
:
sortedFiles
)
{
if
(!
fi
.
isCpp
())
{
continue
;
}
writeFile
(
"ClCompile"
,
allConfigs
,
fi
,
projDir
);
}
endTag
(
"ItemGroup"
);
// then header-files
startTag
(
"ItemGroup"
);
for
(
FileInfo
fi
:
sortedFiles
)
{
if
(!
fi
.
isHeader
())
{
continue
;
}
writeFile
(
"ClInclude"
,
allConfigs
,
fi
,
projDir
);
}
endTag
(
"ItemGroup"
);
// then others
startTag
(
"ItemGroup"
);
for
(
FileInfo
fi
:
sortedFiles
)
{
if
(
fi
.
isHeader
()
||
fi
.
isCpp
())
{
continue
;
}
writeFile
(
"None"
,
allConfigs
,
fi
,
projDir
);
}
endTag
(
"ItemGroup"
);
}
/**
* Make "path" into a relative path using "base" as the base.
*
* path and base are assumed to be normalized with / as the file separator.
* returned path uses "\\" as file separator
*/
private
String
rel
(
String
path
,
String
base
)
{
if
(!
base
.
endsWith
(
"/"
))
{
base
+=
"/"
;
}
String
[]
pathTok
=
path
.
split
(
"/"
);
String
[]
baseTok
=
base
.
split
(
"/"
);
int
pi
=
0
;
int
bi
=
0
;
StringBuilder
newPath
=
new
StringBuilder
();
// first step past all path components that are the same
while
(
pi
<
pathTok
.
length
&&
bi
<
baseTok
.
length
&&
pathTok
[
pi
].
equals
(
baseTok
[
bi
]))
{
pi
++;
bi
++;
}
// for each path component left in base, add "../"
while
(
bi
<
baseTok
.
length
)
{
bi
++;
newPath
.
append
(
"..\\"
);
}
// now add everything left in path
while
(
pi
<
pathTok
.
length
)
{
newPath
.
append
(
pathTok
[
pi
]);
pi
++;
if
(
pi
!=
pathTok
.
length
)
{
newPath
.
append
(
"\\"
);
}
}
return
newPath
.
toString
();
}
private
void
writeFile
(
String
tool
,
Vector
<
BuildConfig
>
allConfigs
,
FileInfo
fi
,
String
base
)
{
if
(
fi
.
attr
.
configs
==
null
&&
fi
.
attr
.
pchRoot
==
false
&&
fi
.
attr
.
noPch
==
false
)
{
tag
(
tool
,
"Include"
,
rel
(
fi
.
full
,
base
));
}
else
{
startTag
(
tool
,
"Include"
,
rel
(
fi
.
full
,
base
));
for
(
BuildConfig
cfg
:
allConfigs
)
{
if
(
fi
.
attr
.
configs
!=
null
&&
!
fi
.
attr
.
configs
.
contains
(
cfg
.
get
(
"Name"
)))
{
tagData
(
cfg
,
"ExcludedFromBuild"
,
"true"
);
}
if
(
fi
.
attr
.
pchRoot
)
{
tagData
(
cfg
,
"PrecompiledHeader"
,
"Create"
);
}
if
(
fi
.
attr
.
noPch
)
{
startTag
(
cfg
,
"PrecompiledHeader"
);
endTag
(
"PrecompiledHeader"
);
}
}
endTag
(
tool
);
}
}
String
buildCond
(
BuildConfig
cfg
)
{
return
"'$(Configuration)|$(Platform)'=='"
+
cfg
.
get
(
"Name"
)+
"'"
;
}
void
tagV
(
Vector
<
String
>
v
)
{
Iterator
<
String
>
i
=
v
.
iterator
();
while
(
i
.
hasNext
())
{
String
name
=
i
.
next
();
String
data
=
i
.
next
();
tagData
(
name
,
data
);
}
}
void
tagData
(
BuildConfig
cfg
,
String
name
,
String
data
)
{
tagData
(
name
,
data
,
"Condition"
,
buildCond
(
cfg
));
}
void
tag
(
BuildConfig
cfg
,
String
name
,
String
...
attrs
)
{
String
[]
ss
=
new
String
[
attrs
.
length
+
2
];
ss
[
0
]
=
"Condition"
;
ss
[
1
]
=
buildCond
(
cfg
);
System
.
arraycopy
(
attrs
,
0
,
ss
,
2
,
attrs
.
length
);
tag
(
name
,
ss
);
}
void
startTag
(
BuildConfig
cfg
,
String
name
,
String
...
attrs
)
{
String
[]
ss
=
new
String
[
attrs
.
length
+
2
];
ss
[
0
]
=
"Condition"
;
ss
[
1
]
=
buildCond
(
cfg
);
System
.
arraycopy
(
attrs
,
0
,
ss
,
2
,
attrs
.
length
);
startTag
(
name
,
ss
);
}
}
class
CompilerInterfaceVC10
extends
CompilerInterface
{
@Override
Vector
getBaseCompilerFlags
(
Vector
defines
,
Vector
includes
,
String
outDir
)
{
Vector
rv
=
new
Vector
();
addAttr
(
rv
,
"AdditionalIncludeDirectories"
,
Util
.
join
(
";"
,
includes
));
addAttr
(
rv
,
"PreprocessorDefinitions"
,
Util
.
join
(
";"
,
defines
).
replace
(
"\\\""
,
"\""
));
addAttr
(
rv
,
"PrecompiledHeaderFile"
,
"precompiled.hpp"
);
addAttr
(
rv
,
"PrecompiledHeaderOutputFile"
,
outDir
+
Util
.
sep
+
"vm.pch"
);
addAttr
(
rv
,
"AssemblerListingLocation"
,
outDir
);
addAttr
(
rv
,
"ObjectFileName"
,
outDir
+
Util
.
sep
);
addAttr
(
rv
,
"ProgramDataBaseFileName"
,
outDir
+
Util
.
sep
+
"jvm.pdb"
);
// Set /nologo option
addAttr
(
rv
,
"SuppressStartupBanner"
,
"true"
);
// Surpass the default /Tc or /Tp.
addAttr
(
rv
,
"CompileAs"
,
"Default"
);
// Set /W3 option.
addAttr
(
rv
,
"WarningLevel"
,
"Level3"
);
// Set /WX option,
addAttr
(
rv
,
"TreatWarningAsError"
,
"true"
);
// Set /GS option
addAttr
(
rv
,
"BufferSecurityCheck"
,
"false"
);
// Set /Zi option.
addAttr
(
rv
,
"DebugInformationFormat"
,
"ProgramDatabase"
);
// Set /Yu option.
addAttr
(
rv
,
"PrecompiledHeader"
,
"Use"
);
// Set /EHsc- option
addAttr
(
rv
,
"ExceptionHandling"
,
""
);
addAttr
(
rv
,
"MultiProcessorCompilation"
,
"true"
);
return
rv
;
}
@Override
Vector
getDebugCompilerFlags
(
String
opt
)
{
Vector
rv
=
new
Vector
();
// Set /On option
addAttr
(
rv
,
"Optimization"
,
opt
);
// Set /FR option.
addAttr
(
rv
,
"BrowseInformation"
,
"true"
);
addAttr
(
rv
,
"BrowseInformationFile"
,
"$(IntDir)"
);
// Set /MD option.
addAttr
(
rv
,
"RuntimeLibrary"
,
"MultiThreadedDLL"
);
// Set /Oy- option
addAttr
(
rv
,
"OmitFramePointers"
,
"false"
);
return
rv
;
}
@Override
Vector
getProductCompilerFlags
()
{
Vector
rv
=
new
Vector
();
// Set /O2 option.
addAttr
(
rv
,
"Optimization"
,
"MaxSpeed"
);
// Set /Oy- option
addAttr
(
rv
,
"OmitFramePointers"
,
"false"
);
// Set /Ob option. 1 is expandOnlyInline
addAttr
(
rv
,
"InlineFunctionExpansion"
,
"OnlyExplicitInline"
);
// Set /GF option.
addAttr
(
rv
,
"StringPooling"
,
"true"
);
// Set /MD option. 2 is rtMultiThreadedDLL
addAttr
(
rv
,
"RuntimeLibrary"
,
"MultiThreadedDLL"
);
// Set /Gy option
addAttr
(
rv
,
"FunctionLevelLinking"
,
"true"
);
return
rv
;
}
@Override
Vector
getBaseLinkerFlags
(
String
outDir
,
String
outDll
,
String
platformName
)
{
Vector
rv
=
new
Vector
();
addAttr
(
rv
,
"AdditionalOptions"
,
"/export:JNI_GetDefaultJavaVMInitArgs "
+
"/export:JNI_CreateJavaVM "
+
"/export:JVM_FindClassFromBootLoader "
+
"/export:JNI_GetCreatedJavaVMs "
+
"/export:jio_snprintf /export:jio_printf "
+
"/export:jio_fprintf /export:jio_vfprintf "
+
"/export:jio_vsnprintf "
+
"/export:JVM_GetVersionInfo "
+
"/export:JVM_GetThreadStateNames "
+
"/export:JVM_GetThreadStateValues "
+
"/export:JVM_InitAgentProperties"
);
addAttr
(
rv
,
"AdditionalDependencies"
,
"kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib"
);
addAttr
(
rv
,
"OutputFile"
,
outDll
);
addAttr
(
rv
,
"SuppressStartupBanner"
,
"true"
);
addAttr
(
rv
,
"ModuleDefinitionFile"
,
outDir
+
Util
.
sep
+
"vm.def"
);
addAttr
(
rv
,
"ProgramDatabaseFile"
,
outDir
+
Util
.
sep
+
"jvm.pdb"
);
addAttr
(
rv
,
"SubSystem"
,
"Windows"
);
addAttr
(
rv
,
"BaseAddress"
,
"0x8000000"
);
addAttr
(
rv
,
"ImportLibrary"
,
outDir
+
Util
.
sep
+
"jvm.lib"
);
if
(
platformName
.
equals
(
"Win32"
))
{
addAttr
(
rv
,
"TargetMachine"
,
"MachineX86"
);
}
else
{
addAttr
(
rv
,
"TargetMachine"
,
"MachineX64"
);
}
return
rv
;
}
@Override
Vector
getDebugLinkerFlags
()
{
Vector
rv
=
new
Vector
();
// /DEBUG option
addAttr
(
rv
,
"GenerateDebugInformation"
,
"true"
);
return
rv
;
}
@Override
Vector
getProductLinkerFlags
()
{
Vector
rv
=
new
Vector
();
// Set /OPT:REF option.
addAttr
(
rv
,
"OptimizeReferences"
,
"true"
);
// Set /OPT:ICF option.
addAttr
(
rv
,
"EnableCOMDATFolding"
,
"true"
);
return
rv
;
}
@Override
void
getAdditionalNonKernelLinkerFlags
(
Vector
rv
)
{
extAttr
(
rv
,
"AdditionalOptions"
,
" /export:AsyncGetCallTrace"
);
}
@Override
String
getOptFlag
()
{
return
"MaxSpeed"
;
}
@Override
String
getNoOptFlag
()
{
return
"Disabled"
;
}
@Override
String
makeCfgName
(
String
flavourBuild
,
String
platform
)
{
return
flavourBuild
+
"|"
+
platform
;
}
}
src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
浏览文件 @
8a32ae47
...
...
@@ -35,7 +35,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
String
projectVersion
()
{
return
"7.10"
;};
public
void
writeProjectFile
(
String
projectFileName
,
String
projectName
,
Vector
allConfigs
)
throws
IOException
{
Vector
<
BuildConfig
>
allConfigs
)
throws
IOException
{
System
.
out
.
println
();
System
.
out
.
println
(
" Writing .vcproj file: "
+
projectFileName
);
// If we got this far without an error, we're safe to actually
...
...
@@ -54,11 +54,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
"SccLocalPath"
,
""
}
);
startTag
(
"Platforms"
,
null
);
startTag
(
"Platforms"
);
tag
(
"Platform"
,
new
String
[]
{
"Name"
,
(
String
)
BuildConfig
.
getField
(
null
,
"PlatformName"
)});
endTag
(
"Platforms"
);
startTag
(
"Configurations"
,
null
);
startTag
(
"Configurations"
);
for
(
Iterator
i
=
allConfigs
.
iterator
();
i
.
hasNext
();
)
{
writeConfiguration
((
BuildConfig
)
i
.
next
());
...
...
@@ -66,11 +66,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
endTag
(
"Configurations"
);
tag
(
"References"
,
null
);
tag
(
"References"
);
writeFiles
(
allConfigs
);
tag
(
"Globals"
,
null
);
tag
(
"Globals"
);
endTag
(
"VisualStudioProject"
);
printWriter
.
close
();
...
...
@@ -190,28 +190,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
}
}
class
TypeFilter
extends
NameFilter
{
String
[]
exts
;
TypeFilter
(
String
fname
,
String
[]
exts
)
{
this
.
fname
=
fname
;
this
.
exts
=
exts
;
}
boolean
match
(
FileInfo
fi
)
{
for
(
int
i
=
0
;
i
<
exts
.
length
;
i
++)
{
if
(
fi
.
full
.
endsWith
(
exts
[
i
]))
{
return
true
;
}
}
return
false
;
}
String
filterString
()
{
return
Util
.
join
(
";"
,
exts
);
}
}
class
TerminatorFilter
extends
NameFilter
{
TerminatorFilter
(
String
fname
)
{
this
.
fname
=
fname
;
...
...
@@ -299,8 +277,8 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
// - container filter just provides a container to group together real filters
// - real filter can select elements from the set according to some rule, put it into XML
// and remove from the list
Vector
makeFilters
(
TreeSet
<
FileInfo
>
files
)
{
Vector
rv
=
new
Vector
();
Vector
<
NameFilter
>
makeFilters
(
TreeSet
<
FileInfo
>
files
)
{
Vector
<
NameFilter
>
rv
=
new
Vector
<
NameFilter
>
();
String
sbase
=
Util
.
normalize
(
BuildConfig
.
getFieldString
(
null
,
"SourceBase"
)+
"/src/"
);
String
currentDir
=
""
;
...
...
@@ -370,13 +348,12 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
rv
.
add
(
new
SpecificNameFilter
(
"Precompiled Header"
,
new
String
[]
{
"precompiled.hpp"
}));
// this one is to catch files not caught by other filters
//rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
rv
.
add
(
new
TerminatorFilter
(
"Source Files"
));
return
rv
;
}
void
writeFiles
(
Vector
allConfigs
)
{
void
writeFiles
(
Vector
<
BuildConfig
>
allConfigs
)
{
Hashtable
allFiles
=
computeAttributedFiles
(
allConfigs
);
...
...
@@ -387,7 +364,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
TreeSet
sortedFiles
=
sortFiles
(
allFiles
);
startTag
(
"Files"
,
null
);
startTag
(
"Files"
);
for
(
Iterator
i
=
makeFilters
(
sortedFiles
).
iterator
();
i
.
hasNext
();
)
{
doWriteFiles
(
sortedFiles
,
allConfigNames
,
(
NameFilter
)
i
.
next
());
...
...
@@ -555,35 +532,40 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
int
indent
;
private
void
startTagPrim
(
String
name
,
String
[]
attrs
,
boolean
close
)
{
startTagPrim
(
name
,
attrs
,
close
,
true
);
}
private
void
startTagPrim
(
String
name
,
String
[]
attrs
,
boolean
close
)
{
boolean
close
,
boolean
newline
)
{
doIndent
();
printWriter
.
print
(
"<"
+
name
);
indent
++;
if
(
attrs
!=
null
)
{
printWriter
.
println
();
if
(
attrs
!=
null
&&
attrs
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
attrs
.
length
;
i
+=
2
)
{
doIndent
();
printWriter
.
print
(
" "
+
attrs
[
i
]+
"=\""
+
attrs
[
i
+
1
]+
"\""
);
if
(
i
<
attrs
.
length
-
2
)
{
printWriter
.
println
();
}
}
}
if
(
close
)
{
indent
--;
//doIndent();
printWriter
.
println
(
"/>"
);
printWriter
.
print
(
" />"
);
}
else
{
//doIndent();
printWriter
.
println
(
">"
);
printWriter
.
print
(
">"
);
}
if
(
newline
)
{
printWriter
.
println
();
}
}
void
startTag
(
String
name
,
String
[]
attrs
)
{
void
startTag
(
String
name
,
String
...
attrs
)
{
startTagPrim
(
name
,
attrs
,
false
);
}
...
...
@@ -601,11 +583,25 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
printWriter
.
println
(
"</"
+
name
+
">"
);
}
void
tag
(
String
name
,
String
[]
attrs
)
{
void
tag
(
String
name
,
String
...
attrs
)
{
startTagPrim
(
name
,
attrs
,
true
);
}
void
tagV
(
String
name
,
Vector
attrs
)
{
void
tagData
(
String
name
,
String
data
)
{
doIndent
();
printWriter
.
print
(
"<"
+
name
+
">"
);
printWriter
.
print
(
data
);
printWriter
.
println
(
"</"
+
name
+
">"
);
}
void
tagData
(
String
name
,
String
data
,
String
...
attrs
)
{
startTagPrim
(
name
,
attrs
,
false
,
false
);
printWriter
.
print
(
data
);
printWriter
.
println
(
"</"
+
name
+
">"
);
indent
--;
}
void
tagV
(
String
name
,
Vector
attrs
)
{
String
s
[]
=
new
String
[
attrs
.
size
()];
for
(
int
i
=
0
;
i
<
attrs
.
size
();
i
++)
{
s
[
i
]
=
(
String
)
attrs
.
elementAt
(
i
);
...
...
@@ -616,7 +612,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
void
doIndent
()
{
for
(
int
i
=
0
;
i
<
indent
;
i
++)
{
printWriter
.
print
(
"
"
);
printWriter
.
print
(
" "
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录