annotate src/share/tools/ProjectCreator/BuildConfig.java @ 10405:f2110083203d

8005849: JEP 167: Event-Based JVM Tracing Reviewed-by: acorn, coleenp, sla Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author sla
date Mon, 10 Jun 2013 11:30:51 +0200
parents aabf54ccedb1
children 836a62f43af9 31f3b1e1c5e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
10405
f2110083203d 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 10277
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.util.Enumeration;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
26 import java.util.Hashtable;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
27 import java.util.Vector;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 class BuildConfig {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
30 @SuppressWarnings("rawtypes")
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 Hashtable vars;
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
32 Vector<String> basicNames, basicPaths;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33 String[] context;
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 static CompilerInterface ci;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 static CompilerInterface getCI() {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 if (ci == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 String comp = (String)getField(null, "CompilerVersion");
a61af66fc99e Initial load
duke
parents:
diff changeset
39 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
a61af66fc99e Initial load
duke
parents:
diff changeset
41 } catch (Exception cnfe) {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 System.err.println("Cannot find support for compiler " + comp);
a61af66fc99e Initial load
duke
parents:
diff changeset
43 throw new RuntimeException(cnfe.toString());
a61af66fc99e Initial load
duke
parents:
diff changeset
44 }
a61af66fc99e Initial load
duke
parents:
diff changeset
45 }
a61af66fc99e Initial load
duke
parents:
diff changeset
46 return ci;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 }
a61af66fc99e Initial load
duke
parents:
diff changeset
48
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
49 @SuppressWarnings("rawtypes")
0
a61af66fc99e Initial load
duke
parents:
diff changeset
50 protected void initNames(String flavour, String build, String outDll) {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 if (vars == null) vars = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 String flavourBuild = flavour + "_" + build;
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
54 String platformName = getFieldString(null, "PlatformName");
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
55 System.out.println();
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
56 System.out.println(flavourBuild);
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
57
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
58 put("Name", getCI().makeCfgName(flavourBuild, platformName));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
59 put("Flavour", flavour);
a61af66fc99e Initial load
duke
parents:
diff changeset
60 put("Build", build);
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
61 put("PlatformName", platformName);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // ones mentioned above were needed to expand format
a61af66fc99e Initial load
duke
parents:
diff changeset
64 String buildBase = expandFormat(getFieldString(null, "BuildBase"));
a61af66fc99e Initial load
duke
parents:
diff changeset
65 String sourceBase = getFieldString(null, "SourceBase");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
66 String buildSpace = getFieldString(null, "BuildSpace");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
67 String outDir = buildBase;
10277
aabf54ccedb1 8008772: remove gamma launcher
twisti
parents: 8821
diff changeset
68 String jdkTargetRoot = getFieldString(null, "JdkTargetRoot");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 put("Id", flavourBuild);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 put("OutputDir", outDir);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 put("SourceBase", sourceBase);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 put("BuildBase", buildBase);
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
74 put("BuildSpace", buildSpace);
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
75 put("OutputDll", outDir + Util.sep + outDll);
10277
aabf54ccedb1 8008772: remove gamma launcher
twisti
parents: 8821
diff changeset
76 put("JdkTargetRoot", jdkTargetRoot);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 context = new String [] {flavourBuild, flavour, build, null};
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
a61af66fc99e Initial load
duke
parents:
diff changeset
80
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
81 protected void init(Vector<String> includes, Vector<String> defines) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
82 initDefaultDefines(defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 initDefaultCompilerFlags(includes);
a61af66fc99e Initial load
duke
parents:
diff changeset
84 initDefaultLinkerFlags();
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
85 //handleDB();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
86 }
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
89 protected void initDefaultCompilerFlags(Vector<String> includes) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
90 Vector compilerFlags = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
a61af66fc99e Initial load
duke
parents:
diff changeset
93 includes,
a61af66fc99e Initial load
duke
parents:
diff changeset
94 get("OutputDir")));
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 put("CompilerFlags", compilerFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 protected void initDefaultLinkerFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 Vector linkerFlags = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
101
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
102 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 put("LinkerFlags", linkerFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 }
a61af66fc99e Initial load
duke
parents:
diff changeset
106
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
107 public boolean matchesIgnoredPath(String path) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
108 Vector<String> rv = new Vector<String>();
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
109 collectRelevantVectors(rv, "IgnorePath");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
110 for (String pathPart : rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
111 if (path.contains(pathPart)) {
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
112 return true;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
113 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
114 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
115 return false;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
116 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
117
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
118 public boolean matchesHidePath(String path) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
119 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
120 collectRelevantVectors(rv, "HidePath");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
121 for (String pathPart : rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
122 if (path.contains(Util.normalize(pathPart))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
123 return true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
124 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
125 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
126 return false;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
127 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
128
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
129 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
130 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
131 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
132 if (v != null) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
133 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
134 String key = e.nextElement();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
135 String val = v.get(key);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
136
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
137 if (fullPath.endsWith(expandFormat(key))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
138 rv.add(expandFormat(val));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
142 return rv;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void addTo(Hashtable ht, String key, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 ht.put(expandFormat(key), expandFormat(value));
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 void initDefaultDefines(Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 Vector sysDefines = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
151 sysDefines.add("WIN32");
a61af66fc99e Initial load
duke
parents:
diff changeset
152 sysDefines.add("_WINDOWS");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
153 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
154 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
10405
f2110083203d 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 10277
diff changeset
155 sysDefines.add("INCLUDE_TRACE=1");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
156 sysDefines.add("_JNI_IMPLEMENTATION_");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
157 if (vars.get("PlatformName").equals("Win32")) {
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
158 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
159 } else {
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
160 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
161 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 sysDefines.addAll(defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 put("Define", sysDefines);
a61af66fc99e Initial load
duke
parents:
diff changeset
166 }
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 String get(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 return (String)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 Vector getV(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
173 return (Vector)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 Object getO(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
177 return vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 Hashtable getH(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return (Hashtable)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 Object getFieldInContext(String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 for (int i=0; i<context.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 Object rv = getField(context[i], field);
a61af66fc99e Initial load
duke
parents:
diff changeset
187 if (rv != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
188 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
189 }
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
192 }
a61af66fc99e Initial load
duke
parents:
diff changeset
193
a61af66fc99e Initial load
duke
parents:
diff changeset
194 Object lookupHashFieldInContext(String field, String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
195 for (int i=0; i<context.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 Hashtable ht = (Hashtable)getField(context[i], field);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 if (ht != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 Object rv = ht.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
199 if (rv != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 }
a61af66fc99e Initial load
duke
parents:
diff changeset
202 }
a61af66fc99e Initial load
duke
parents:
diff changeset
203 }
a61af66fc99e Initial load
duke
parents:
diff changeset
204 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 void put(String key, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 vars.put(key, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 }
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 void put(String key, Vector vvalue) {
a61af66fc99e Initial load
duke
parents:
diff changeset
212 vars.put(key, vvalue);
a61af66fc99e Initial load
duke
parents:
diff changeset
213 }
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 void add(String key, Vector vvalue) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 getV(key).addAll(vvalue);
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 String flavour() {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 return get("Flavour");
a61af66fc99e Initial load
duke
parents:
diff changeset
221 }
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223 String build() {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 return get("Build");
a61af66fc99e Initial load
duke
parents:
diff changeset
225 }
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 Object getSpecificField(String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 return getField(get("Id"), field);
a61af66fc99e Initial load
duke
parents:
diff changeset
229 }
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 void putSpecificField(String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 putField(get("Id"), field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 void collectRelevantVectors(Vector rv, String field) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
236 for (String ctx : context) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
237 Vector<String> v = getFieldVector(ctx, field);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
238 if (v != null) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
239 for (String val : v) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
240 rv.add(expandFormat(val).replace('/', '\\'));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243 }
a61af66fc99e Initial load
duke
parents:
diff changeset
244 }
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 void collectRelevantHashes(Hashtable rv, String field) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
247 for (String ctx : context) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
248 Hashtable v = (Hashtable)getField(ctx, field);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
249 if (v != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
250 for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
251 String key = (String)e.nextElement();
a61af66fc99e Initial load
duke
parents:
diff changeset
252 String val = (String)v.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 addTo(rv, key, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257 }
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259
a61af66fc99e Initial load
duke
parents:
diff changeset
260 Vector getDefines() {
a61af66fc99e Initial load
duke
parents:
diff changeset
261 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
262 collectRelevantVectors(rv, "Define");
a61af66fc99e Initial load
duke
parents:
diff changeset
263 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 Vector getIncludes() {
a61af66fc99e Initial load
duke
parents:
diff changeset
267 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
268 collectRelevantVectors(rv, "AbsoluteInclude");
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
269 rv.addAll(getSourceIncludes());
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
270 return rv;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
271 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
272
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
273 private Vector getSourceIncludes() {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
274 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
275 Vector<String> ri = new Vector<String>();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
276 String sourceBase = getFieldString(null, "SourceBase");
a61af66fc99e Initial load
duke
parents:
diff changeset
277 collectRelevantVectors(ri, "RelativeInclude");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
278 for (String f : ri) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
279 rv.add(sourceBase + Util.sep + f);
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }
a61af66fc99e Initial load
duke
parents:
diff changeset
281 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
282 }
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284 static Hashtable cfgData = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
285 static Hashtable globalData = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 static boolean appliesToTieredBuild(String cfg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
288 return (cfg != null &&
a61af66fc99e Initial load
duke
parents:
diff changeset
289 (cfg.startsWith("compiler1") ||
a61af66fc99e Initial load
duke
parents:
diff changeset
290 cfg.startsWith("compiler2")));
a61af66fc99e Initial load
duke
parents:
diff changeset
291 }
a61af66fc99e Initial load
duke
parents:
diff changeset
292
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
293 // Filters out the IgnoreFile and IgnorePaths since they are
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
294 // handled specially for tiered builds.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
295 static boolean appliesToTieredBuild(String cfg, String key) {
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
296 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
297 }
a61af66fc99e Initial load
duke
parents:
diff changeset
298
a61af66fc99e Initial load
duke
parents:
diff changeset
299 static String getTieredBuildCfg(String cfg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
300 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
a61af66fc99e Initial load
duke
parents:
diff changeset
301 return "tiered" + cfg.substring(9);
a61af66fc99e Initial load
duke
parents:
diff changeset
302 }
a61af66fc99e Initial load
duke
parents:
diff changeset
303
a61af66fc99e Initial load
duke
parents:
diff changeset
304 static Object getField(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
305 if (cfg == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
306 return globalData.get(field);
a61af66fc99e Initial load
duke
parents:
diff changeset
307 }
a61af66fc99e Initial load
duke
parents:
diff changeset
308
a61af66fc99e Initial load
duke
parents:
diff changeset
309 Hashtable ht = (Hashtable)cfgData.get(cfg);
a61af66fc99e Initial load
duke
parents:
diff changeset
310 return ht == null ? null : ht.get(field);
a61af66fc99e Initial load
duke
parents:
diff changeset
311 }
a61af66fc99e Initial load
duke
parents:
diff changeset
312
a61af66fc99e Initial load
duke
parents:
diff changeset
313 static String getFieldString(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
314 return (String)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
315 }
a61af66fc99e Initial load
duke
parents:
diff changeset
316
a61af66fc99e Initial load
duke
parents:
diff changeset
317 static Vector getFieldVector(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
318 return (Vector)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
319 }
a61af66fc99e Initial load
duke
parents:
diff changeset
320
a61af66fc99e Initial load
duke
parents:
diff changeset
321 static void putField(String cfg, String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
322 putFieldImpl(cfg, field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
323 if (appliesToTieredBuild(cfg, field)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
324 putFieldImpl(getTieredBuildCfg(cfg), field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
325 }
a61af66fc99e Initial load
duke
parents:
diff changeset
326 }
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 private static void putFieldImpl(String cfg, String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
329 if (cfg == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
330 globalData.put(field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
331 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
332 }
a61af66fc99e Initial load
duke
parents:
diff changeset
333
a61af66fc99e Initial load
duke
parents:
diff changeset
334 Hashtable ht = (Hashtable)cfgData.get(cfg);
a61af66fc99e Initial load
duke
parents:
diff changeset
335 if (ht == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
336 ht = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
337 cfgData.put(cfg, ht);
a61af66fc99e Initial load
duke
parents:
diff changeset
338 }
a61af66fc99e Initial load
duke
parents:
diff changeset
339
a61af66fc99e Initial load
duke
parents:
diff changeset
340 ht.put(field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
341 }
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 static Object getFieldHash(String cfg, String field, String name) {
a61af66fc99e Initial load
duke
parents:
diff changeset
344 Hashtable ht = (Hashtable)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
345
a61af66fc99e Initial load
duke
parents:
diff changeset
346 return ht == null ? null : ht.get(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
347 }
a61af66fc99e Initial load
duke
parents:
diff changeset
348
a61af66fc99e Initial load
duke
parents:
diff changeset
349 static void putFieldHash(String cfg, String field, String name, Object val) {
a61af66fc99e Initial load
duke
parents:
diff changeset
350 putFieldHashImpl(cfg, field, name, val);
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
351 if (appliesToTieredBuild(cfg, field)) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
352 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
353 }
a61af66fc99e Initial load
duke
parents:
diff changeset
354 }
a61af66fc99e Initial load
duke
parents:
diff changeset
355
a61af66fc99e Initial load
duke
parents:
diff changeset
356 private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
a61af66fc99e Initial load
duke
parents:
diff changeset
357 Hashtable ht = (Hashtable)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
358
a61af66fc99e Initial load
duke
parents:
diff changeset
359 if (ht == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
360 ht = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
361 putFieldImpl(cfg, field, ht);
a61af66fc99e Initial load
duke
parents:
diff changeset
362 }
a61af66fc99e Initial load
duke
parents:
diff changeset
363
a61af66fc99e Initial load
duke
parents:
diff changeset
364 ht.put(name, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
365 }
a61af66fc99e Initial load
duke
parents:
diff changeset
366
a61af66fc99e Initial load
duke
parents:
diff changeset
367 static void addFieldVector(String cfg, String field, String element) {
a61af66fc99e Initial load
duke
parents:
diff changeset
368 addFieldVectorImpl(cfg, field, element);
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
369 if (appliesToTieredBuild(cfg, field)) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
370 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
a61af66fc99e Initial load
duke
parents:
diff changeset
371 }
a61af66fc99e Initial load
duke
parents:
diff changeset
372 }
a61af66fc99e Initial load
duke
parents:
diff changeset
373
a61af66fc99e Initial load
duke
parents:
diff changeset
374 private static void addFieldVectorImpl(String cfg, String field, String element) {
a61af66fc99e Initial load
duke
parents:
diff changeset
375 Vector v = (Vector)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
376
a61af66fc99e Initial load
duke
parents:
diff changeset
377 if (v == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
378 v = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
379 putFieldImpl(cfg, field, v);
a61af66fc99e Initial load
duke
parents:
diff changeset
380 }
a61af66fc99e Initial load
duke
parents:
diff changeset
381
a61af66fc99e Initial load
duke
parents:
diff changeset
382 v.add(element);
a61af66fc99e Initial load
duke
parents:
diff changeset
383 }
a61af66fc99e Initial load
duke
parents:
diff changeset
384
a61af66fc99e Initial load
duke
parents:
diff changeset
385 String expandFormat(String format) {
a61af66fc99e Initial load
duke
parents:
diff changeset
386 if (format == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
387 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
388 }
a61af66fc99e Initial load
duke
parents:
diff changeset
389
a61af66fc99e Initial load
duke
parents:
diff changeset
390 if (format.indexOf('%') == -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
391 return format;
a61af66fc99e Initial load
duke
parents:
diff changeset
392 }
a61af66fc99e Initial load
duke
parents:
diff changeset
393
a61af66fc99e Initial load
duke
parents:
diff changeset
394 StringBuffer sb = new StringBuffer();
a61af66fc99e Initial load
duke
parents:
diff changeset
395 int len = format.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
396 for (int i=0; i<len; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
397 char ch = format.charAt(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
398 if (ch == '%') {
a61af66fc99e Initial load
duke
parents:
diff changeset
399 char ch1 = format.charAt(i+1);
a61af66fc99e Initial load
duke
parents:
diff changeset
400 switch (ch1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
401 case '%':
a61af66fc99e Initial load
duke
parents:
diff changeset
402 sb.append(ch1);
a61af66fc99e Initial load
duke
parents:
diff changeset
403 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
404 case 'b':
a61af66fc99e Initial load
duke
parents:
diff changeset
405 sb.append(build());
a61af66fc99e Initial load
duke
parents:
diff changeset
406 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
407 case 'f':
a61af66fc99e Initial load
duke
parents:
diff changeset
408 sb.append(flavour());
a61af66fc99e Initial load
duke
parents:
diff changeset
409 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
410 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
411 sb.append(ch);
a61af66fc99e Initial load
duke
parents:
diff changeset
412 sb.append(ch1);
a61af66fc99e Initial load
duke
parents:
diff changeset
413 }
a61af66fc99e Initial load
duke
parents:
diff changeset
414 i++;
a61af66fc99e Initial load
duke
parents:
diff changeset
415 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
416 sb.append(ch);
a61af66fc99e Initial load
duke
parents:
diff changeset
417 }
a61af66fc99e Initial load
duke
parents:
diff changeset
418 }
a61af66fc99e Initial load
duke
parents:
diff changeset
419
a61af66fc99e Initial load
duke
parents:
diff changeset
420 return sb.toString();
a61af66fc99e Initial load
duke
parents:
diff changeset
421 }
a61af66fc99e Initial load
duke
parents:
diff changeset
422 }
a61af66fc99e Initial load
duke
parents:
diff changeset
423
a61af66fc99e Initial load
duke
parents:
diff changeset
424 abstract class GenericDebugConfig extends BuildConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
425 abstract String getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
426
a61af66fc99e Initial load
duke
parents:
diff changeset
427 protected void init(Vector includes, Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
428 defines.add("_DEBUG");
a61af66fc99e Initial load
duke
parents:
diff changeset
429 defines.add("ASSERT");
a61af66fc99e Initial load
duke
parents:
diff changeset
430
a61af66fc99e Initial load
duke
parents:
diff changeset
431 super.init(includes, defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
432
a61af66fc99e Initial load
duke
parents:
diff changeset
433 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag()));
a61af66fc99e Initial load
duke
parents:
diff changeset
434 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
435 }
a61af66fc99e Initial load
duke
parents:
diff changeset
436 }
a61af66fc99e Initial load
duke
parents:
diff changeset
437
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
438 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
439 protected void init(Vector includes, Vector defines) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
440 super.init(includes, defines);
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
441 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
442 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
443 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
444
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
445 class C1DebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
446 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
447 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
448 }
a61af66fc99e Initial load
duke
parents:
diff changeset
449
a61af66fc99e Initial load
duke
parents:
diff changeset
450 C1DebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
451 initNames("compiler1", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
452 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
453 }
a61af66fc99e Initial load
duke
parents:
diff changeset
454 }
a61af66fc99e Initial load
duke
parents:
diff changeset
455
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
456 class C1FastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
457 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
458 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
459 }
a61af66fc99e Initial load
duke
parents:
diff changeset
460
a61af66fc99e Initial load
duke
parents:
diff changeset
461 C1FastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
462 initNames("compiler1", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
463 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
464 }
a61af66fc99e Initial load
duke
parents:
diff changeset
465 }
a61af66fc99e Initial load
duke
parents:
diff changeset
466
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
467 class C2DebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
468 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
469 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
470 }
a61af66fc99e Initial load
duke
parents:
diff changeset
471
a61af66fc99e Initial load
duke
parents:
diff changeset
472 C2DebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
473 initNames("compiler2", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
474 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
475 }
a61af66fc99e Initial load
duke
parents:
diff changeset
476 }
a61af66fc99e Initial load
duke
parents:
diff changeset
477
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
478 class C2FastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
479 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
480 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
481 }
a61af66fc99e Initial load
duke
parents:
diff changeset
482
a61af66fc99e Initial load
duke
parents:
diff changeset
483 C2FastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
484 initNames("compiler2", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
485 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
486 }
a61af66fc99e Initial load
duke
parents:
diff changeset
487 }
a61af66fc99e Initial load
duke
parents:
diff changeset
488
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
489 class TieredDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
490 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
491 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
492 }
a61af66fc99e Initial load
duke
parents:
diff changeset
493
a61af66fc99e Initial load
duke
parents:
diff changeset
494 TieredDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
495 initNames("tiered", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
496 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
497 }
a61af66fc99e Initial load
duke
parents:
diff changeset
498 }
a61af66fc99e Initial load
duke
parents:
diff changeset
499
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
500 class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
501 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
502 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
503 }
a61af66fc99e Initial load
duke
parents:
diff changeset
504
a61af66fc99e Initial load
duke
parents:
diff changeset
505 TieredFastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
506 initNames("tiered", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
507 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
508 }
a61af66fc99e Initial load
duke
parents:
diff changeset
509 }
a61af66fc99e Initial load
duke
parents:
diff changeset
510
a61af66fc99e Initial load
duke
parents:
diff changeset
511 abstract class ProductConfig extends BuildConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
512 protected void init(Vector includes, Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
513 defines.add("NDEBUG");
a61af66fc99e Initial load
duke
parents:
diff changeset
514 defines.add("PRODUCT");
a61af66fc99e Initial load
duke
parents:
diff changeset
515
a61af66fc99e Initial load
duke
parents:
diff changeset
516 super.init(includes, defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
517
a61af66fc99e Initial load
duke
parents:
diff changeset
518 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
519 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
520 }
a61af66fc99e Initial load
duke
parents:
diff changeset
521 }
a61af66fc99e Initial load
duke
parents:
diff changeset
522
a61af66fc99e Initial load
duke
parents:
diff changeset
523 class C1ProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
524 C1ProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
525 initNames("compiler1", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
526 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
527 }
a61af66fc99e Initial load
duke
parents:
diff changeset
528 }
a61af66fc99e Initial load
duke
parents:
diff changeset
529
a61af66fc99e Initial load
duke
parents:
diff changeset
530 class C2ProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
531 C2ProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
532 initNames("compiler2", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
533 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
534 }
a61af66fc99e Initial load
duke
parents:
diff changeset
535 }
a61af66fc99e Initial load
duke
parents:
diff changeset
536
a61af66fc99e Initial load
duke
parents:
diff changeset
537 class TieredProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
538 TieredProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
539 initNames("tiered", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
540 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
541 }
a61af66fc99e Initial load
duke
parents:
diff changeset
542 }
a61af66fc99e Initial load
duke
parents:
diff changeset
543
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
544 class CoreDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
545 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
546 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
547 }
a61af66fc99e Initial load
duke
parents:
diff changeset
548
a61af66fc99e Initial load
duke
parents:
diff changeset
549 CoreDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
550 initNames("core", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
551 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
552 }
a61af66fc99e Initial load
duke
parents:
diff changeset
553 }
a61af66fc99e Initial load
duke
parents:
diff changeset
554
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
555 class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
556 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
557 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
558 }
a61af66fc99e Initial load
duke
parents:
diff changeset
559
a61af66fc99e Initial load
duke
parents:
diff changeset
560 CoreFastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
561 initNames("core", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
562 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
563 }
a61af66fc99e Initial load
duke
parents:
diff changeset
564 }
a61af66fc99e Initial load
duke
parents:
diff changeset
565
a61af66fc99e Initial load
duke
parents:
diff changeset
566 class CoreProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
567 CoreProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
568 initNames("core", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
569 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
570 }
a61af66fc99e Initial load
duke
parents:
diff changeset
571 }
a61af66fc99e Initial load
duke
parents:
diff changeset
572
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
573
0
a61af66fc99e Initial load
duke
parents:
diff changeset
574 abstract class CompilerInterface {
a61af66fc99e Initial load
duke
parents:
diff changeset
575 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
576 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
577 abstract Vector getDebugCompilerFlags(String opt);
a61af66fc99e Initial load
duke
parents:
diff changeset
578 abstract Vector getDebugLinkerFlags();
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
579 abstract void getAdditionalNonKernelLinkerFlags(Vector rv);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
580 abstract Vector getProductCompilerFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
581 abstract Vector getProductLinkerFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
582 abstract String getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
583 abstract String getNoOptFlag();
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
584 abstract String makeCfgName(String flavourBuild, String platformName);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
585
a61af66fc99e Initial load
duke
parents:
diff changeset
586 void addAttr(Vector receiver, String attr, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
587 receiver.add(attr); receiver.add(value);
a61af66fc99e Initial load
duke
parents:
diff changeset
588 }
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
589 void extAttr(Vector receiver, String attr, String value) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
590 int attr_pos=receiver.indexOf(attr) ;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
591 if ( attr_pos == -1) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
592 // If attr IS NOT present in the Vector - add it
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
593 receiver.add(attr); receiver.add(value);
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
594 } else {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
595 // If attr IS present in the Vector - append value to it
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
596 receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
597 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
598 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
599 }