Mercurial > hg > truffle
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 6831:d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
Summary: Capitalize these metadata types (and objArrayKlass)
Reviewed-by: stefank, twisti, kvn
author | coleenp |
---|---|
date | Sat, 29 Sep 2012 06:40:00 -0400 |
parents | 1a9b9cfcef41 |
children | e522a00b91aa 6b748c9e1845 |
rev | line source |
---|---|
0 | 1 /* |
4878
2eeebe4b4213
7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents:
2233
diff
changeset
|
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
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 | 22 * |
23 */ | |
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 | 28 |
29 class BuildConfig { | |
6801 | 30 @SuppressWarnings("rawtypes") |
0 | 31 Hashtable vars; |
6801 | 32 Vector<String> basicNames, basicPaths; |
0 | 33 String[] context; |
34 | |
35 static CompilerInterface ci; | |
36 static CompilerInterface getCI() { | |
37 if (ci == null) { | |
38 String comp = (String)getField(null, "CompilerVersion"); | |
39 try { | |
40 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance(); | |
41 } catch (Exception cnfe) { | |
42 System.err.println("Cannot find support for compiler " + comp); | |
43 throw new RuntimeException(cnfe.toString()); | |
44 } | |
45 } | |
46 return ci; | |
47 } | |
48 | |
6801 | 49 @SuppressWarnings("rawtypes") |
0 | 50 protected void initNames(String flavour, String build, String outDll) { |
51 if (vars == null) vars = new Hashtable(); | |
52 | |
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 | 55 System.out.println(); |
56 System.out.println(flavourBuild); | |
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 | 59 put("Flavour", flavour); |
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 | 62 |
63 // ones mentioned above were needed to expand format | |
64 String buildBase = expandFormat(getFieldString(null, "BuildBase")); | |
65 String sourceBase = getFieldString(null, "SourceBase"); | |
6801 | 66 String buildSpace = getFieldString(null, "BuildSpace"); |
0 | 67 String outDir = buildBase; |
68 | |
69 put("Id", flavourBuild); | |
70 put("OutputDir", outDir); | |
71 put("SourceBase", sourceBase); | |
72 put("BuildBase", buildBase); | |
6801 | 73 put("BuildSpace", buildSpace); |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
74 put("OutputDll", outDir + Util.sep + outDll); |
0 | 75 |
76 context = new String [] {flavourBuild, flavour, build, null}; | |
77 } | |
78 | |
6801 | 79 protected void init(Vector<String> includes, Vector<String> defines) { |
0 | 80 initDefaultDefines(defines); |
81 initDefaultCompilerFlags(includes); | |
82 initDefaultLinkerFlags(); | |
6801 | 83 //handleDB(); |
0 | 84 } |
85 | |
86 | |
6801 | 87 protected void initDefaultCompilerFlags(Vector<String> includes) { |
0 | 88 Vector compilerFlags = new Vector(); |
89 | |
90 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
91 includes, | |
92 get("OutputDir"))); | |
93 | |
94 put("CompilerFlags", compilerFlags); | |
95 } | |
96 | |
97 protected void initDefaultLinkerFlags() { | |
98 Vector linkerFlags = new Vector(); | |
99 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
100 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 101 |
102 put("LinkerFlags", linkerFlags); | |
103 } | |
104 | |
6801 | 105 public boolean matchesIgnoredPath(String path) { |
106 Vector<String> rv = new Vector<String>(); | |
1972 | 107 collectRelevantVectors(rv, "IgnorePath"); |
6801 | 108 for (String pathPart : rv) { |
109 if (path.contains(pathPart)) { | |
1972 | 110 return true; |
111 } | |
112 } | |
113 return false; | |
114 } | |
115 | |
6801 | 116 public boolean matchesHidePath(String path) { |
117 Vector<String> rv = new Vector<String>(); | |
118 collectRelevantVectors(rv, "HidePath"); | |
119 for (String pathPart : rv) { | |
120 if (path.contains(Util.normalize(pathPart))) { | |
121 return true; | |
122 } | |
123 } | |
124 return false; | |
125 } | |
126 | |
127 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) { | |
128 Vector<String> rv = new Vector<String>(); | |
129 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile"); | |
130 if (v != null) { | |
131 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) { | |
132 String key = e.nextElement(); | |
133 String val = v.get(key); | |
134 | |
135 if (fullPath.endsWith(expandFormat(key))) { | |
136 rv.add(expandFormat(val)); | |
0 | 137 } |
138 } | |
139 } | |
6801 | 140 return rv; |
0 | 141 } |
142 | |
143 void addTo(Hashtable ht, String key, String value) { | |
144 ht.put(expandFormat(key), expandFormat(value)); | |
145 } | |
146 | |
147 void initDefaultDefines(Vector defines) { | |
148 Vector sysDefines = new Vector(); | |
149 sysDefines.add("WIN32"); | |
150 sysDefines.add("_WINDOWS"); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
151 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 152 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
4878
2eeebe4b4213
7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents:
2233
diff
changeset
|
153 sysDefines.add("INCLUDE_TRACE"); |
0 | 154 sysDefines.add("_JNI_IMPLEMENTATION_"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
155 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
156 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
157 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
158 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
159 } |
0 | 160 |
161 sysDefines.addAll(defines); | |
162 | |
163 put("Define", sysDefines); | |
164 } | |
165 | |
166 String get(String key) { | |
167 return (String)vars.get(key); | |
168 } | |
169 | |
170 Vector getV(String key) { | |
171 return (Vector)vars.get(key); | |
172 } | |
173 | |
174 Object getO(String key) { | |
175 return vars.get(key); | |
176 } | |
177 | |
178 Hashtable getH(String key) { | |
179 return (Hashtable)vars.get(key); | |
180 } | |
181 | |
182 Object getFieldInContext(String field) { | |
183 for (int i=0; i<context.length; i++) { | |
184 Object rv = getField(context[i], field); | |
185 if (rv != null) { | |
186 return rv; | |
187 } | |
188 } | |
189 return null; | |
190 } | |
191 | |
192 Object lookupHashFieldInContext(String field, String key) { | |
193 for (int i=0; i<context.length; i++) { | |
194 Hashtable ht = (Hashtable)getField(context[i], field); | |
195 if (ht != null) { | |
196 Object rv = ht.get(key); | |
197 if (rv != null) { | |
198 return rv; | |
199 } | |
200 } | |
201 } | |
202 return null; | |
203 } | |
204 | |
205 void put(String key, String value) { | |
206 vars.put(key, value); | |
207 } | |
208 | |
209 void put(String key, Vector vvalue) { | |
210 vars.put(key, vvalue); | |
211 } | |
212 | |
213 void add(String key, Vector vvalue) { | |
214 getV(key).addAll(vvalue); | |
215 } | |
216 | |
217 String flavour() { | |
218 return get("Flavour"); | |
219 } | |
220 | |
221 String build() { | |
222 return get("Build"); | |
223 } | |
224 | |
225 Object getSpecificField(String field) { | |
226 return getField(get("Id"), field); | |
227 } | |
228 | |
229 void putSpecificField(String field, Object value) { | |
230 putField(get("Id"), field, value); | |
231 } | |
232 | |
233 void collectRelevantVectors(Vector rv, String field) { | |
6801 | 234 for (String ctx : context) { |
235 Vector<String> v = getFieldVector(ctx, field); | |
0 | 236 if (v != null) { |
6801 | 237 for (String val : v) { |
238 rv.add(expandFormat(val).replace('/', '\\')); | |
0 | 239 } |
240 } | |
241 } | |
242 } | |
243 | |
244 void collectRelevantHashes(Hashtable rv, String field) { | |
6801 | 245 for (String ctx : context) { |
246 Hashtable v = (Hashtable)getField(ctx, field); | |
0 | 247 if (v != null) { |
248 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
249 String key = (String)e.nextElement(); | |
250 String val = (String)v.get(key); | |
251 addTo(rv, key, val); | |
252 } | |
253 } | |
254 } | |
255 } | |
256 | |
257 | |
258 Vector getDefines() { | |
259 Vector rv = new Vector(); | |
260 collectRelevantVectors(rv, "Define"); | |
261 return rv; | |
262 } | |
263 | |
264 Vector getIncludes() { | |
265 Vector rv = new Vector(); | |
266 collectRelevantVectors(rv, "AbsoluteInclude"); | |
1972 | 267 rv.addAll(getSourceIncludes()); |
268 return rv; | |
269 } | |
270 | |
271 private Vector getSourceIncludes() { | |
6801 | 272 Vector<String> rv = new Vector<String>(); |
273 Vector<String> ri = new Vector<String>(); | |
0 | 274 String sourceBase = getFieldString(null, "SourceBase"); |
275 collectRelevantVectors(ri, "RelativeInclude"); | |
6801 | 276 for (String f : ri) { |
0 | 277 rv.add(sourceBase + Util.sep + f); |
278 } | |
279 return rv; | |
280 } | |
281 | |
282 static Hashtable cfgData = new Hashtable(); | |
283 static Hashtable globalData = new Hashtable(); | |
284 | |
285 static boolean appliesToTieredBuild(String cfg) { | |
286 return (cfg != null && | |
287 (cfg.startsWith("compiler1") || | |
288 cfg.startsWith("compiler2"))); | |
289 } | |
290 | |
1972 | 291 // Filters out the IgnoreFile and IgnorePaths since they are |
292 // handled specially for tiered builds. | |
0 | 293 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 294 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 295 } |
296 | |
297 static String getTieredBuildCfg(String cfg) { | |
298 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
299 return "tiered" + cfg.substring(9); | |
300 } | |
301 | |
302 static Object getField(String cfg, String field) { | |
303 if (cfg == null) { | |
304 return globalData.get(field); | |
305 } | |
306 | |
307 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
308 return ht == null ? null : ht.get(field); | |
309 } | |
310 | |
311 static String getFieldString(String cfg, String field) { | |
312 return (String)getField(cfg, field); | |
313 } | |
314 | |
315 static Vector getFieldVector(String cfg, String field) { | |
316 return (Vector)getField(cfg, field); | |
317 } | |
318 | |
319 static void putField(String cfg, String field, Object value) { | |
320 putFieldImpl(cfg, field, value); | |
321 if (appliesToTieredBuild(cfg, field)) { | |
322 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
323 } | |
324 } | |
325 | |
326 private static void putFieldImpl(String cfg, String field, Object value) { | |
327 if (cfg == null) { | |
328 globalData.put(field, value); | |
329 return; | |
330 } | |
331 | |
332 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
333 if (ht == null) { | |
334 ht = new Hashtable(); | |
335 cfgData.put(cfg, ht); | |
336 } | |
337 | |
338 ht.put(field, value); | |
339 } | |
340 | |
341 static Object getFieldHash(String cfg, String field, String name) { | |
342 Hashtable ht = (Hashtable)getField(cfg, field); | |
343 | |
344 return ht == null ? null : ht.get(name); | |
345 } | |
346 | |
347 static void putFieldHash(String cfg, String field, String name, Object val) { | |
348 putFieldHashImpl(cfg, field, name, val); | |
1972 | 349 if (appliesToTieredBuild(cfg, field)) { |
0 | 350 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
351 } | |
352 } | |
353 | |
354 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
355 Hashtable ht = (Hashtable)getField(cfg, field); | |
356 | |
357 if (ht == null) { | |
358 ht = new Hashtable(); | |
359 putFieldImpl(cfg, field, ht); | |
360 } | |
361 | |
362 ht.put(name, val); | |
363 } | |
364 | |
365 static void addFieldVector(String cfg, String field, String element) { | |
366 addFieldVectorImpl(cfg, field, element); | |
1972 | 367 if (appliesToTieredBuild(cfg, field)) { |
0 | 368 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
369 } | |
370 } | |
371 | |
372 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
373 Vector v = (Vector)getField(cfg, field); | |
374 | |
375 if (v == null) { | |
376 v = new Vector(); | |
377 putFieldImpl(cfg, field, v); | |
378 } | |
379 | |
380 v.add(element); | |
381 } | |
382 | |
383 String expandFormat(String format) { | |
384 if (format == null) { | |
385 return null; | |
386 } | |
387 | |
388 if (format.indexOf('%') == -1) { | |
389 return format; | |
390 } | |
391 | |
392 StringBuffer sb = new StringBuffer(); | |
393 int len = format.length(); | |
394 for (int i=0; i<len; i++) { | |
395 char ch = format.charAt(i); | |
396 if (ch == '%') { | |
397 char ch1 = format.charAt(i+1); | |
398 switch (ch1) { | |
399 case '%': | |
400 sb.append(ch1); | |
401 break; | |
402 case 'b': | |
403 sb.append(build()); | |
404 break; | |
405 case 'f': | |
406 sb.append(flavour()); | |
407 break; | |
408 default: | |
409 sb.append(ch); | |
410 sb.append(ch1); | |
411 } | |
412 i++; | |
413 } else { | |
414 sb.append(ch); | |
415 } | |
416 } | |
417 | |
418 return sb.toString(); | |
419 } | |
420 } | |
421 | |
422 abstract class GenericDebugConfig extends BuildConfig { | |
423 abstract String getOptFlag(); | |
424 | |
425 protected void init(Vector includes, Vector defines) { | |
426 defines.add("_DEBUG"); | |
427 defines.add("ASSERT"); | |
428 | |
429 super.init(includes, defines); | |
430 | |
431 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
432 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
433 } | |
434 } | |
435 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
436 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
437 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
438 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
439 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
440 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
441 } |
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 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 444 String getOptFlag() { |
445 return getCI().getNoOptFlag(); | |
446 } | |
447 | |
448 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
449 initNames("compiler1", "debug", "jvm.dll"); |
0 | 450 init(getIncludes(), getDefines()); |
451 } | |
452 } | |
453 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
454 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 455 String getOptFlag() { |
456 return getCI().getOptFlag(); | |
457 } | |
458 | |
459 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
460 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 461 init(getIncludes(), getDefines()); |
462 } | |
463 } | |
464 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
465 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 466 String getOptFlag() { |
467 return getCI().getNoOptFlag(); | |
468 } | |
469 | |
470 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
471 initNames("compiler2", "debug", "jvm.dll"); |
0 | 472 init(getIncludes(), getDefines()); |
473 } | |
474 } | |
475 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
476 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 477 String getOptFlag() { |
478 return getCI().getOptFlag(); | |
479 } | |
480 | |
481 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
482 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 483 init(getIncludes(), getDefines()); |
484 } | |
485 } | |
486 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
487 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 488 String getOptFlag() { |
489 return getCI().getNoOptFlag(); | |
490 } | |
491 | |
492 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
493 initNames("tiered", "debug", "jvm.dll"); |
0 | 494 init(getIncludes(), getDefines()); |
495 } | |
496 } | |
497 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
498 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 499 String getOptFlag() { |
500 return getCI().getOptFlag(); | |
501 } | |
502 | |
503 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
504 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 505 init(getIncludes(), getDefines()); |
506 } | |
507 } | |
508 | |
509 abstract class ProductConfig extends BuildConfig { | |
510 protected void init(Vector includes, Vector defines) { | |
511 defines.add("NDEBUG"); | |
512 defines.add("PRODUCT"); | |
513 | |
514 super.init(includes, defines); | |
515 | |
516 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
517 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
518 } | |
519 } | |
520 | |
521 class C1ProductConfig extends ProductConfig { | |
522 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
523 initNames("compiler1", "product", "jvm.dll"); |
0 | 524 init(getIncludes(), getDefines()); |
525 } | |
526 } | |
527 | |
528 class C2ProductConfig extends ProductConfig { | |
529 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
530 initNames("compiler2", "product", "jvm.dll"); |
0 | 531 init(getIncludes(), getDefines()); |
532 } | |
533 } | |
534 | |
535 class TieredProductConfig extends ProductConfig { | |
536 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
537 initNames("tiered", "product", "jvm.dll"); |
0 | 538 init(getIncludes(), getDefines()); |
539 } | |
540 } | |
541 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
542 class CoreDebugConfig extends GenericDebugNonKernelConfig { |
0 | 543 String getOptFlag() { |
544 return getCI().getNoOptFlag(); | |
545 } | |
546 | |
547 CoreDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
548 initNames("core", "debug", "jvm.dll"); |
0 | 549 init(getIncludes(), getDefines()); |
550 } | |
551 } | |
552 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
553 class CoreFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 554 String getOptFlag() { |
555 return getCI().getOptFlag(); | |
556 } | |
557 | |
558 CoreFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
559 initNames("core", "fastdebug", "jvm.dll"); |
0 | 560 init(getIncludes(), getDefines()); |
561 } | |
562 } | |
563 | |
564 class CoreProductConfig extends ProductConfig { | |
565 CoreProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
566 initNames("core", "product", "jvm.dll"); |
0 | 567 init(getIncludes(), getDefines()); |
568 } | |
569 } | |
570 | |
571 class KernelDebugConfig extends GenericDebugConfig { | |
572 String getOptFlag() { | |
573 return getCI().getNoOptFlag(); | |
574 } | |
575 | |
576 KernelDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
577 initNames("kernel", "debug", "jvm.dll"); |
0 | 578 init(getIncludes(), getDefines()); |
579 } | |
580 } | |
581 | |
582 | |
583 class KernelFastDebugConfig extends GenericDebugConfig { | |
584 String getOptFlag() { | |
585 return getCI().getOptFlag(); | |
586 } | |
587 | |
588 KernelFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
589 initNames("kernel", "fastdebug", "jvm.dll"); |
0 | 590 init(getIncludes(), getDefines()); |
591 } | |
592 } | |
593 | |
594 | |
595 class KernelProductConfig extends ProductConfig { | |
596 KernelProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
597 initNames("kernel", "product", "jvm.dll"); |
0 | 598 init(getIncludes(), getDefines()); |
599 } | |
600 } | |
6801 | 601 |
0 | 602 abstract class CompilerInterface { |
603 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
|
604 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 605 abstract Vector getDebugCompilerFlags(String opt); |
606 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
607 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 608 abstract Vector getProductCompilerFlags(); |
609 abstract Vector getProductLinkerFlags(); | |
610 abstract String getOptFlag(); | |
611 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
612 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 613 |
614 void addAttr(Vector receiver, String attr, String value) { | |
615 receiver.add(attr); receiver.add(value); | |
616 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
617 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
618 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
619 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
620 // 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
|
621 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
622 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
623 // 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
|
624 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
|
625 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
626 } |
0 | 627 } |