annotate src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @ 14518:d8041d695d19

Merged with jdk9/dev/hotspot changeset 3812c088b945
author twisti
date Tue, 11 Mar 2014 18:45:59 -0700
parents 3cce976666d9 de6a9e811145
children 4ca6dc0799b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
14223
de6a9e811145 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 12021
diff changeset
2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
25 import java.io.FileWriter;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
26 import java.io.IOException;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
27 import java.io.PrintWriter;
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
28 import java.nio.file.FileSystems;
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
29 import java.util.Vector;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public class WinGammaPlatformVC7 extends WinGammaPlatform {
a61af66fc99e Initial load
duke
parents:
diff changeset
32
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
33 // TODO How about moving all globals configs to its own BuildConfig?
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
34
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
35 String projectVersion() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
36 return "7.10";
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
37 };
0
a61af66fc99e Initial load
duke
parents:
diff changeset
38
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
39 public void writeProjectFile(String projectFileName, String projectName,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
40 Vector<BuildConfig> allConfigs) throws IOException {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
41 System.out.println();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
42 System.out.println(" Writing .vcproj file: " + projectFileName);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
43 // If we got this far without an error, we're safe to actually
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
44 // write the .vcproj file
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
45 printWriter = new PrintWriter(new FileWriter(projectFileName));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
46
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
47 printWriter
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
48 .println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
49 startTag("VisualStudioProject", new String[] { "ProjectType",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
50 "Visual C++", "Version", projectVersion(), "Name", projectName,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
51 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
52 "SccProjectName", "", "SccLocalPath", "" });
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
53 startTag("Platforms");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
54 tag("Platform",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
55 new String[] { "Name",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
56 (String) BuildConfig.getField(null, "PlatformName") });
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
57 endTag();
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
58
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
59 startTag("Configurations");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
60
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
61 for (BuildConfig cfg : allConfigs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
62 writeConfiguration(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
63 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
64
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
65 endTag();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
66
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
67 tag("References");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
68
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
69 writeFiles(allConfigs);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
70
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
71 tag("Globals");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
72
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
73 endTag();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
74 printWriter.close();
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
75
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
76 System.out.println(" Done.");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
77 }
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
78
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
79 void writeCustomToolConfig(Vector<BuildConfig> configs, String[] customToolAttrs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
80 for (BuildConfig cfg : configs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
81 startTag("FileConfiguration",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
82 new String[] { "Name", (String) cfg.get("Name") });
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
83 tag("Tool", customToolAttrs);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
84
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
85 endTag();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
86 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
87 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
89 void writeFiles(Vector<BuildConfig> allConfigs) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
90
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
91 // This code assummes there are no config specific includes.
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
92 startTag("Files");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
93 String sourceBase = BuildConfig.getFieldString(null, "SourceBase");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
94
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
95 // Use first config for all global absolute includes.
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
96 BuildConfig baseConfig = allConfigs.firstElement();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
97 Vector<String> rv = new Vector<String>();
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
98
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
99 // Then use first config for all relative includes
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
100 Vector<String> ri = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
101 baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
102 for (String f : ri) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
103 rv.add(sourceBase + Util.sep + f);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
104 }
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
105
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
106 baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
107
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
108 handleIncludes(rv, allConfigs);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
110 startTag("Filter", new String[] { "Name", "Resource Files", "Filter",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
111 "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" });
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
112 endTag();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
113
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
114 endTag();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
115 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
116
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
117 // Will visit file tree for each include
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
118 private void handleIncludes(Vector<String> includes, Vector<BuildConfig> allConfigs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
119 for (String path : includes) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
120 FileTreeCreatorVC7 ftc = new FileTreeCreatorVC7(FileSystems.getDefault().getPath(path) , allConfigs, this);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
121 try {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
122 ftc.writeFileTree();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
123 } catch (IOException e) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
124 e.printStackTrace();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
125 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
126 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
127 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
128
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
129 void writeConfiguration(BuildConfig cfg) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
130 startTag("Configuration", new String[] { "Name", cfg.get("Name"),
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
131 "OutputDirectory", cfg.get("OutputDir"),
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
132 "IntermediateDirectory", cfg.get("OutputDir"),
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
133 "ConfigurationType", "2", "UseOfMFC", "0",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
134 "ATLMinimizesCRunTimeLibraryUsage", "FALSE" });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
135
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
136 tagV("Tool", cfg.getV("CompilerFlags"));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
137
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
138 tag("Tool", new String[] { "Name", "VCCustomBuildTool" });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
139
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
140 tagV("Tool", cfg.getV("LinkerFlags"));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
141
12021
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
142 String postBuildCmd = BuildConfig.getFieldString(null,
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
143 "PostbuildCommand");
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
144 if (postBuildCmd != null) {
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
145 tag("Tool",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
146 new String[] {
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
147 "Name",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
148 "VCPostBuildEventTool",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
149 "Description",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
150 BuildConfig
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
151 .getFieldString(null, "PostbuildDescription"),
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
152 // Caution: String.replace(String,String) is available
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
153 // from JDK5 onwards only
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
154 "CommandLine",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
155 cfg.expandFormat(postBuildCmd.replace("\t",
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
156 "&#x0D;&#x0A;")) });
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 6842
diff changeset
157 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
158
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
159 tag("Tool", new String[] { "Name", "VCPreBuildEventTool" });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
160
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
161 tag("Tool",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
162 new String[] {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
163 "Name",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
164 "VCPreLinkEventTool",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
165 "Description",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
166 BuildConfig.getFieldString(null, "PrelinkDescription"),
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
167 // Caution: String.replace(String,String) is available
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
168 // from JDK5 onwards only
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
169 "CommandLine",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
170 cfg.expandFormat(BuildConfig.getFieldString(null,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
171 "PrelinkCommand").replace("\t", "&#x0D;&#x0A;")) });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
172
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
173 tag("Tool", new String[] { "Name", "VCResourceCompilerTool",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
174 "PreprocessorDefinitions", "NDEBUG", "Culture", "1033" });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
175
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
176 tag("Tool", new String[] { "Name", "VCMIDLTool",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
177 "PreprocessorDefinitions", "NDEBUG", "MkTypLibCompatible",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
178 "TRUE", "SuppressStartupBanner", "TRUE", "TargetEnvironment",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
179 "1", "TypeLibraryName",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
180 cfg.get("OutputDir") + Util.sep + "vm.tlb", "HeaderFileName",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
181 "" });
0
a61af66fc99e Initial load
duke
parents:
diff changeset
182
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
183 endTag();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
184 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
188 protected String getProjectExt() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
189 return ".vcproj";
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
190 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
191 }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 class CompilerInterfaceVC7 extends CompilerInterface {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
194 void getBaseCompilerFlags_common(Vector defines, Vector includes,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
195 String outDir, Vector rv) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
196
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
197 // advanced M$ IDE (2003) can only recognize name if it's first or
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
198 // second attribute in the tag - go guess
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
199 addAttr(rv, "Name", "VCCLCompilerTool");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
200 addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
201 addAttr(rv, "PreprocessorDefinitions",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
202 Util.join(";", defines).replace("\"", "&quot;"));
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
203 addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
204 addAttr(rv, "PrecompiledHeaderFile", outDir + Util.sep + "vm.pch");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
205 addAttr(rv, "AssemblerListingLocation", outDir);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
206 addAttr(rv, "ObjectFile", outDir + Util.sep);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
207 addAttr(rv, "ProgramDataBaseFileName", outDir + Util.sep + "jvm.pdb");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
208 // Set /nologo optin
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
209 addAttr(rv, "SuppressStartupBanner", "TRUE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
210 // Surpass the default /Tc or /Tp. 0 is compileAsDefault
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
211 addAttr(rv, "CompileAs", "0");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
212 // Set /W3 option. 3 is warningLevel_3
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
213 addAttr(rv, "WarningLevel", "3");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
214 // Set /WX option,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
215 addAttr(rv, "WarnAsError", "TRUE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
216 // Set /GS option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
217 addAttr(rv, "BufferSecurityCheck", "FALSE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
218 // Set /Zi option. 3 is debugEnabled
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
219 addAttr(rv, "DebugInformationFormat", "3");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
220 }
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
221
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
222 Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
223 Vector rv = new Vector();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
224
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
225 getBaseCompilerFlags_common(defines, includes, outDir, rv);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
226 // Set /Yu option. 3 is pchUseUsingSpecific
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
227 // Note: Starting VC8 pchUseUsingSpecific is 2 !!!
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
228 addAttr(rv, "UsePrecompiledHeader", "3");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
229 // Set /EHsc- option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
230 addAttr(rv, "ExceptionHandling", "FALSE");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
231
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
232 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
233 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
234
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
235 Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
236 Vector rv = new Vector();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
237
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
238 addAttr(rv, "Name", "VCLinkerTool");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
239 addAttr(rv, "AdditionalOptions",
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
240 "/export:JNI_GetDefaultJavaVMInitArgs "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
241 + "/export:JNI_CreateJavaVM "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
242 + "/export:JVM_FindClassFromBootLoader "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
243 + "/export:JNI_GetCreatedJavaVMs "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
244 + "/export:jio_snprintf /export:jio_printf "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
245 + "/export:jio_fprintf /export:jio_vfprintf "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
246 + "/export:jio_vsnprintf "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
247 + "/export:JVM_GetVersionInfo "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
248 + "/export:JVM_GetThreadStateNames "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
249 + "/export:JVM_GetThreadStateValues "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
250 + "/export:JVM_InitAgentProperties ");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
251 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
252 addAttr(rv, "OutputFile", outDll);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
253 // Set /INCREMENTAL option. 1 is linkIncrementalNo
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
254 addAttr(rv, "LinkIncremental", "1");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
255 addAttr(rv, "SuppressStartupBanner", "TRUE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
256 addAttr(rv, "ModuleDefinitionFile", outDir + Util.sep + "vm.def");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
257 addAttr(rv, "ProgramDatabaseFile", outDir + Util.sep + "jvm.pdb");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
258 // Set /SUBSYSTEM option. 2 is subSystemWindows
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
259 addAttr(rv, "SubSystem", "2");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
260 addAttr(rv, "BaseAddress", "0x8000000");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
261 addAttr(rv, "ImportLibrary", outDir + Util.sep + "jvm.lib");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
262 if (platformName.equals("Win32")) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
263 // Set /MACHINE option. 1 is X86
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
264 addAttr(rv, "TargetMachine", "1");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
265 } else {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
266 // Set /MACHINE option. 17 is X64
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
267 addAttr(rv, "TargetMachine", "17");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
268 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
269
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
270 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
271 }
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
272
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
273 void getDebugCompilerFlags_common(String opt, Vector rv) {
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
274
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
275 // Set /On option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
276 addAttr(rv, "Optimization", opt);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
277 // Set /FR option. 1 is brAllInfo
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
278 addAttr(rv, "BrowseInformation", "1");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
279 addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
280 // Set /MD option. 2 is rtMultiThreadedDLL
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
281 addAttr(rv, "RuntimeLibrary", "2");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
282 // Set /Oy- option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
283 addAttr(rv, "OmitFramePointers", "FALSE");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
284
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
285 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
286
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
287 Vector getDebugCompilerFlags(String opt) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
288 Vector rv = new Vector();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
290 getDebugCompilerFlags_common(opt, rv);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
291
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
292 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
293 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
294
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
295 Vector getDebugLinkerFlags() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
296 Vector rv = new Vector();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
297
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
298 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option
0
a61af66fc99e Initial load
duke
parents:
diff changeset
299
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
300 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
301 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
302
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
303 void getAdditionalNonKernelLinkerFlags(Vector rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
304 extAttr(rv, "AdditionalOptions", "/export:AsyncGetCallTrace ");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
305 }
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
306
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
307 void getProductCompilerFlags_common(Vector rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
308 // Set /O2 option. 2 is optimizeMaxSpeed
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
309 addAttr(rv, "Optimization", "2");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
310 // Set /Oy- option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
311 addAttr(rv, "OmitFramePointers", "FALSE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
312 // Set /Ob option. 1 is expandOnlyInline
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
313 addAttr(rv, "InlineFunctionExpansion", "1");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
314 // Set /GF option.
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
315 addAttr(rv, "StringPooling", "TRUE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
316 // Set /MD option. 2 is rtMultiThreadedDLL
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
317 addAttr(rv, "RuntimeLibrary", "2");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
318 // Set /Gy option
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
319 addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
320 }
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
321
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
322 Vector getProductCompilerFlags() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
323 Vector rv = new Vector();
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
324
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
325 getProductCompilerFlags_common(rv);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
326
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
327 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
328 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
329
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
330 Vector getProductLinkerFlags() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
331 Vector rv = new Vector();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
332
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
333 // Set /OPT:REF option. 2 is optReferences
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
334 addAttr(rv, "OptimizeReferences", "2");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
335 // Set /OPT:optFolding option. 2 is optFolding
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
336 addAttr(rv, "EnableCOMDATFolding", "2");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
337
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
338 return rv;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
339 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
340
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
341 String getOptFlag() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
342 return "2";
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
343 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
344
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
345 String getNoOptFlag() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
346 return "0";
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
347 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
348
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
349 String makeCfgName(String flavourBuild, String platform) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
350 return flavourBuild + "|" + platform;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
351 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 2393
diff changeset
352
0
a61af66fc99e Initial load
duke
parents:
diff changeset
353 }