Mercurial > hg > graal-compiler
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 3328:277d0f6ca64d
7005503: Make GuaranteedSafepointInterval a diagnostic flag
Reviewed-by: kamg, ysr
author | kevinw |
---|---|
date | Mon, 18 Apr 2011 08:03:45 -0700 |
parents | 15d6977f04b0 |
children | 2ab52cda08e5 2eeebe4b4213 |
rev | line source |
---|---|
0 | 1 /* |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
2 * Copyright (c) 2005, 2011, 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 | |
25 import java.io.File; | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
26 import java.util.Enumeration; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
27 import java.util.Hashtable; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
28 import java.util.Iterator; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
29 import java.util.Vector; |
0 | 30 |
31 class BuildConfig { | |
32 Hashtable vars; | |
33 Vector basicNames, basicPaths; | |
34 String[] context; | |
35 | |
36 static CompilerInterface ci; | |
37 static CompilerInterface getCI() { | |
38 if (ci == null) { | |
39 String comp = (String)getField(null, "CompilerVersion"); | |
40 try { | |
41 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance(); | |
42 } catch (Exception cnfe) { | |
43 System.err.println("Cannot find support for compiler " + comp); | |
44 throw new RuntimeException(cnfe.toString()); | |
45 } | |
46 } | |
47 return ci; | |
48 } | |
49 | |
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"); | |
66 String outDir = buildBase; | |
67 | |
68 put("Id", flavourBuild); | |
69 put("OutputDir", outDir); | |
70 put("SourceBase", sourceBase); | |
71 put("BuildBase", buildBase); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
72 put("OutputDll", outDir + Util.sep + outDll); |
0 | 73 |
74 context = new String [] {flavourBuild, flavour, build, null}; | |
75 } | |
76 | |
77 protected void init(Vector includes, Vector defines) { | |
78 initDefaultDefines(defines); | |
79 initDefaultCompilerFlags(includes); | |
80 initDefaultLinkerFlags(); | |
1972 | 81 handleDB(); |
0 | 82 } |
83 | |
84 | |
85 protected void initDefaultCompilerFlags(Vector includes) { | |
86 Vector compilerFlags = new Vector(); | |
87 | |
88 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
89 includes, | |
90 get("OutputDir"))); | |
91 | |
92 put("CompilerFlags", compilerFlags); | |
93 } | |
94 | |
95 protected void initDefaultLinkerFlags() { | |
96 Vector linkerFlags = new Vector(); | |
97 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
98 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 99 |
100 put("LinkerFlags", linkerFlags); | |
101 } | |
102 | |
103 DirectoryTree getSourceTree(String sourceBase, String startAt) { | |
104 DirectoryTree tree = new DirectoryTree(); | |
105 | |
106 tree.addSubdirToIgnore("Codemgr_wsdata"); | |
107 tree.addSubdirToIgnore("deleted_files"); | |
108 tree.addSubdirToIgnore("SCCS"); | |
109 tree.setVerbose(true); | |
110 if (startAt != null) { | |
111 tree.readDirectory(sourceBase + File.separator + startAt); | |
112 } else { | |
113 tree.readDirectory(sourceBase); | |
114 } | |
115 | |
116 return tree; | |
117 } | |
118 | |
119 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
120 Vector getPreferredPaths() { |
0 | 121 Vector preferredPaths = new Vector(); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
122 |
0 | 123 // In the case of multiple files with the same name in |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
124 // different subdirectories, prefer these versions |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
125 preferredPaths.add("windows"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
126 preferredPaths.add("x86"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
127 preferredPaths.add("closed"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
128 |
0 | 129 // Also prefer "opto" over "adlc" for adlcVMDeps.hpp |
130 preferredPaths.add("opto"); | |
131 | |
132 return preferredPaths; | |
133 } | |
134 | |
135 | |
1972 | 136 void handleDB() { |
0 | 137 WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); |
138 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
139 putSpecificField("AllFilesHash", computeAllFiles(platform)); |
0 | 140 } |
141 | |
142 | |
1972 | 143 private boolean matchesIgnoredPath(String prefixedName) { |
144 Vector rv = new Vector(); | |
145 collectRelevantVectors(rv, "IgnorePath"); | |
146 for (Iterator i = rv.iterator(); i.hasNext(); ) { | |
147 String pathPart = (String) i.next(); | |
148 if (prefixedName.contains(Util.normalize(pathPart))) { | |
149 return true; | |
150 } | |
151 } | |
152 return false; | |
153 } | |
154 | |
0 | 155 void addAll(Iterator i, Hashtable hash, |
156 WinGammaPlatform platform, DirectoryTree tree, | |
157 Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) { | |
158 for (; i.hasNext(); ) { | |
159 String fileName = (String) i.next(); | |
160 if (lookupHashFieldInContext("IgnoreFile", fileName) == null) { | |
161 String prefixedName = platform.envVarPrefixedFileName(fileName, | |
162 0, /* ignored */ | |
163 tree, | |
164 preferredPaths, | |
165 filesNotFound, | |
166 filesDuplicate); | |
167 if (prefixedName != null) { | |
1972 | 168 prefixedName = Util.normalize(prefixedName); |
169 if (!matchesIgnoredPath(prefixedName)) { | |
170 addTo(hash, prefixedName, fileName); | |
171 } | |
0 | 172 } |
173 } | |
174 } | |
175 } | |
176 | |
177 void addTo(Hashtable ht, String key, String value) { | |
178 ht.put(expandFormat(key), expandFormat(value)); | |
179 } | |
180 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
181 Hashtable computeAllFiles(WinGammaPlatform platform) { |
0 | 182 Hashtable rv = new Hashtable(); |
183 DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
184 Vector preferredPaths = getPreferredPaths(); |
0 | 185 |
186 // Hold errors until end | |
187 Vector filesNotFound = new Vector(); | |
188 Vector filesDuplicate = new Vector(); | |
189 | |
1972 | 190 Vector includedFiles = new Vector(); |
0 | 191 |
192 // find all files | |
1972 | 193 Vector dirs = getSourceIncludes(); |
194 for (Iterator i = dirs.iterator(); i.hasNext(); ) { | |
195 String dir = (String)i.next(); | |
196 DirectoryTree subtree = getSourceTree(dir, null); | |
197 for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) { | |
198 String name = ((File)fi.next()).getName(); | |
199 includedFiles.add(name); | |
200 } | |
0 | 201 } |
1972 | 202 addAll(includedFiles.iterator(), rv, |
0 | 203 platform, tree, |
204 preferredPaths, filesNotFound, filesDuplicate); | |
205 | |
206 Vector addFiles = new Vector(); | |
207 collectRelevantVectors(addFiles, "AdditionalFile"); | |
208 addAll(addFiles.iterator(), rv, | |
209 platform, tree, | |
210 preferredPaths, filesNotFound, filesDuplicate); | |
211 | |
212 collectRelevantHashes(rv, "AdditionalGeneratedFile"); | |
213 | |
214 if ((filesNotFound.size() != 0) || | |
215 (filesDuplicate.size() != 0)) { | |
216 System.err.println("Error: some files were not found or " + | |
217 "appeared in multiple subdirectories of " + | |
218 "directory " + get("SourceBase") + " and could not " + | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
219 "be resolved with os_family and arch."); |
0 | 220 if (filesNotFound.size() != 0) { |
221 System.err.println("Files not found:"); | |
222 for (Iterator iter = filesNotFound.iterator(); | |
223 iter.hasNext(); ) { | |
224 System.err.println(" " + (String) iter.next()); | |
225 } | |
226 } | |
227 if (filesDuplicate.size() != 0) { | |
228 System.err.println("Duplicate files:"); | |
229 for (Iterator iter = filesDuplicate.iterator(); | |
230 iter.hasNext(); ) { | |
231 System.err.println(" " + (String) iter.next()); | |
232 } | |
233 } | |
234 throw new RuntimeException(); | |
235 } | |
236 | |
237 return rv; | |
238 } | |
239 | |
240 void initDefaultDefines(Vector defines) { | |
241 Vector sysDefines = new Vector(); | |
242 sysDefines.add("WIN32"); | |
243 sysDefines.add("_WINDOWS"); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
244 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 245 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
246 sysDefines.add("_JNI_IMPLEMENTATION_"); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
247 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
248 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
249 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
250 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
251 } |
0 | 252 |
253 sysDefines.addAll(defines); | |
254 | |
255 put("Define", sysDefines); | |
256 } | |
257 | |
258 String get(String key) { | |
259 return (String)vars.get(key); | |
260 } | |
261 | |
262 Vector getV(String key) { | |
263 return (Vector)vars.get(key); | |
264 } | |
265 | |
266 Object getO(String key) { | |
267 return vars.get(key); | |
268 } | |
269 | |
270 Hashtable getH(String key) { | |
271 return (Hashtable)vars.get(key); | |
272 } | |
273 | |
274 Object getFieldInContext(String field) { | |
275 for (int i=0; i<context.length; i++) { | |
276 Object rv = getField(context[i], field); | |
277 if (rv != null) { | |
278 return rv; | |
279 } | |
280 } | |
281 return null; | |
282 } | |
283 | |
284 Object lookupHashFieldInContext(String field, String key) { | |
285 for (int i=0; i<context.length; i++) { | |
286 Hashtable ht = (Hashtable)getField(context[i], field); | |
287 if (ht != null) { | |
288 Object rv = ht.get(key); | |
289 if (rv != null) { | |
290 return rv; | |
291 } | |
292 } | |
293 } | |
294 return null; | |
295 } | |
296 | |
297 void put(String key, String value) { | |
298 vars.put(key, value); | |
299 } | |
300 | |
301 void put(String key, Vector vvalue) { | |
302 vars.put(key, vvalue); | |
303 } | |
304 | |
305 void add(String key, Vector vvalue) { | |
306 getV(key).addAll(vvalue); | |
307 } | |
308 | |
309 String flavour() { | |
310 return get("Flavour"); | |
311 } | |
312 | |
313 String build() { | |
314 return get("Build"); | |
315 } | |
316 | |
317 Object getSpecificField(String field) { | |
318 return getField(get("Id"), field); | |
319 } | |
320 | |
321 void putSpecificField(String field, Object value) { | |
322 putField(get("Id"), field, value); | |
323 } | |
324 | |
325 void collectRelevantVectors(Vector rv, String field) { | |
326 for (int i = 0; i < context.length; i++) { | |
327 Vector v = getFieldVector(context[i], field); | |
328 if (v != null) { | |
329 for (Iterator j=v.iterator(); j.hasNext(); ) { | |
330 String val = (String)j.next(); | |
331 rv.add(expandFormat(val)); | |
332 } | |
333 } | |
334 } | |
335 } | |
336 | |
337 void collectRelevantHashes(Hashtable rv, String field) { | |
338 for (int i = 0; i < context.length; i++) { | |
339 Hashtable v = (Hashtable)getField(context[i], field); | |
340 if (v != null) { | |
341 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
342 String key = (String)e.nextElement(); | |
343 String val = (String)v.get(key); | |
344 addTo(rv, key, val); | |
345 } | |
346 } | |
347 } | |
348 } | |
349 | |
350 | |
351 Vector getDefines() { | |
352 Vector rv = new Vector(); | |
353 collectRelevantVectors(rv, "Define"); | |
354 return rv; | |
355 } | |
356 | |
357 Vector getIncludes() { | |
358 Vector rv = new Vector(); | |
359 | |
360 collectRelevantVectors(rv, "AbsoluteInclude"); | |
361 | |
1972 | 362 rv.addAll(getSourceIncludes()); |
363 | |
364 return rv; | |
365 } | |
366 | |
367 private Vector getSourceIncludes() { | |
368 Vector rv = new Vector(); | |
0 | 369 Vector ri = new Vector(); |
370 String sourceBase = getFieldString(null, "SourceBase"); | |
371 collectRelevantVectors(ri, "RelativeInclude"); | |
372 for (Iterator i = ri.iterator(); i.hasNext(); ) { | |
373 String f = (String)i.next(); | |
374 rv.add(sourceBase + Util.sep + f); | |
375 } | |
376 return rv; | |
377 } | |
378 | |
379 static Hashtable cfgData = new Hashtable(); | |
380 static Hashtable globalData = new Hashtable(); | |
381 | |
382 static boolean appliesToTieredBuild(String cfg) { | |
383 return (cfg != null && | |
384 (cfg.startsWith("compiler1") || | |
385 cfg.startsWith("compiler2"))); | |
386 } | |
387 | |
1972 | 388 // Filters out the IgnoreFile and IgnorePaths since they are |
389 // handled specially for tiered builds. | |
0 | 390 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 391 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 392 } |
393 | |
394 static String getTieredBuildCfg(String cfg) { | |
395 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
396 return "tiered" + cfg.substring(9); | |
397 } | |
398 | |
399 static Object getField(String cfg, String field) { | |
400 if (cfg == null) { | |
401 return globalData.get(field); | |
402 } | |
403 | |
404 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
405 return ht == null ? null : ht.get(field); | |
406 } | |
407 | |
408 static String getFieldString(String cfg, String field) { | |
409 return (String)getField(cfg, field); | |
410 } | |
411 | |
412 static Vector getFieldVector(String cfg, String field) { | |
413 return (Vector)getField(cfg, field); | |
414 } | |
415 | |
416 static void putField(String cfg, String field, Object value) { | |
417 putFieldImpl(cfg, field, value); | |
418 if (appliesToTieredBuild(cfg, field)) { | |
419 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
420 } | |
421 } | |
422 | |
423 private static void putFieldImpl(String cfg, String field, Object value) { | |
424 if (cfg == null) { | |
425 globalData.put(field, value); | |
426 return; | |
427 } | |
428 | |
429 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
430 if (ht == null) { | |
431 ht = new Hashtable(); | |
432 cfgData.put(cfg, ht); | |
433 } | |
434 | |
435 ht.put(field, value); | |
436 } | |
437 | |
438 static Object getFieldHash(String cfg, String field, String name) { | |
439 Hashtable ht = (Hashtable)getField(cfg, field); | |
440 | |
441 return ht == null ? null : ht.get(name); | |
442 } | |
443 | |
444 static void putFieldHash(String cfg, String field, String name, Object val) { | |
445 putFieldHashImpl(cfg, field, name, val); | |
1972 | 446 if (appliesToTieredBuild(cfg, field)) { |
0 | 447 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
448 } | |
449 } | |
450 | |
451 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
452 Hashtable ht = (Hashtable)getField(cfg, field); | |
453 | |
454 if (ht == null) { | |
455 ht = new Hashtable(); | |
456 putFieldImpl(cfg, field, ht); | |
457 } | |
458 | |
459 ht.put(name, val); | |
460 } | |
461 | |
462 static void addFieldVector(String cfg, String field, String element) { | |
463 addFieldVectorImpl(cfg, field, element); | |
1972 | 464 if (appliesToTieredBuild(cfg, field)) { |
0 | 465 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
466 } | |
467 } | |
468 | |
469 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
470 Vector v = (Vector)getField(cfg, field); | |
471 | |
472 if (v == null) { | |
473 v = new Vector(); | |
474 putFieldImpl(cfg, field, v); | |
475 } | |
476 | |
477 v.add(element); | |
478 } | |
479 | |
480 String expandFormat(String format) { | |
481 if (format == null) { | |
482 return null; | |
483 } | |
484 | |
485 if (format.indexOf('%') == -1) { | |
486 return format; | |
487 } | |
488 | |
489 StringBuffer sb = new StringBuffer(); | |
490 int len = format.length(); | |
491 for (int i=0; i<len; i++) { | |
492 char ch = format.charAt(i); | |
493 if (ch == '%') { | |
494 char ch1 = format.charAt(i+1); | |
495 switch (ch1) { | |
496 case '%': | |
497 sb.append(ch1); | |
498 break; | |
499 case 'b': | |
500 sb.append(build()); | |
501 break; | |
502 case 'f': | |
503 sb.append(flavour()); | |
504 break; | |
505 default: | |
506 sb.append(ch); | |
507 sb.append(ch1); | |
508 } | |
509 i++; | |
510 } else { | |
511 sb.append(ch); | |
512 } | |
513 } | |
514 | |
515 return sb.toString(); | |
516 } | |
517 } | |
518 | |
519 abstract class GenericDebugConfig extends BuildConfig { | |
520 abstract String getOptFlag(); | |
521 | |
522 protected void init(Vector includes, Vector defines) { | |
523 defines.add("_DEBUG"); | |
524 defines.add("ASSERT"); | |
525 | |
526 super.init(includes, defines); | |
527 | |
528 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
529 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
530 } | |
531 } | |
532 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
533 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
534 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
535 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
536 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
537 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
538 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
539 |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
540 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 541 String getOptFlag() { |
542 return getCI().getNoOptFlag(); | |
543 } | |
544 | |
545 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
546 initNames("compiler1", "debug", "jvm.dll"); |
0 | 547 init(getIncludes(), getDefines()); |
548 } | |
549 } | |
550 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
551 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 552 String getOptFlag() { |
553 return getCI().getOptFlag(); | |
554 } | |
555 | |
556 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
557 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 558 init(getIncludes(), getDefines()); |
559 } | |
560 } | |
561 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
562 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 563 String getOptFlag() { |
564 return getCI().getNoOptFlag(); | |
565 } | |
566 | |
567 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
568 initNames("compiler2", "debug", "jvm.dll"); |
0 | 569 init(getIncludes(), getDefines()); |
570 } | |
571 } | |
572 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
573 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 574 String getOptFlag() { |
575 return getCI().getOptFlag(); | |
576 } | |
577 | |
578 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
579 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 580 init(getIncludes(), getDefines()); |
581 } | |
582 } | |
583 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
584 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 585 String getOptFlag() { |
586 return getCI().getNoOptFlag(); | |
587 } | |
588 | |
589 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
590 initNames("tiered", "debug", "jvm.dll"); |
0 | 591 init(getIncludes(), getDefines()); |
592 } | |
593 } | |
594 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
595 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 596 String getOptFlag() { |
597 return getCI().getOptFlag(); | |
598 } | |
599 | |
600 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
601 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 602 init(getIncludes(), getDefines()); |
603 } | |
604 } | |
605 | |
606 | |
607 abstract class ProductConfig extends BuildConfig { | |
608 protected void init(Vector includes, Vector defines) { | |
609 defines.add("NDEBUG"); | |
610 defines.add("PRODUCT"); | |
611 | |
612 super.init(includes, defines); | |
613 | |
614 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
615 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
616 } | |
617 } | |
618 | |
619 class C1ProductConfig extends ProductConfig { | |
620 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
621 initNames("compiler1", "product", "jvm.dll"); |
0 | 622 init(getIncludes(), getDefines()); |
623 } | |
624 } | |
625 | |
626 class C2ProductConfig extends ProductConfig { | |
627 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
628 initNames("compiler2", "product", "jvm.dll"); |
0 | 629 init(getIncludes(), getDefines()); |
630 } | |
631 } | |
632 | |
633 class TieredProductConfig extends ProductConfig { | |
634 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
635 initNames("tiered", "product", "jvm.dll"); |
0 | 636 init(getIncludes(), getDefines()); |
637 } | |
638 } | |
639 | |
640 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
641 class CoreDebugConfig extends GenericDebugNonKernelConfig { |
0 | 642 String getOptFlag() { |
643 return getCI().getNoOptFlag(); | |
644 } | |
645 | |
646 CoreDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
647 initNames("core", "debug", "jvm.dll"); |
0 | 648 init(getIncludes(), getDefines()); |
649 } | |
650 } | |
651 | |
652 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
653 class CoreFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 654 String getOptFlag() { |
655 return getCI().getOptFlag(); | |
656 } | |
657 | |
658 CoreFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
659 initNames("core", "fastdebug", "jvm.dll"); |
0 | 660 init(getIncludes(), getDefines()); |
661 } | |
662 } | |
663 | |
664 | |
665 class CoreProductConfig extends ProductConfig { | |
666 CoreProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
667 initNames("core", "product", "jvm.dll"); |
0 | 668 init(getIncludes(), getDefines()); |
669 } | |
670 } | |
671 | |
672 class KernelDebugConfig extends GenericDebugConfig { | |
673 String getOptFlag() { | |
674 return getCI().getNoOptFlag(); | |
675 } | |
676 | |
677 KernelDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
678 initNames("kernel", "debug", "jvm.dll"); |
0 | 679 init(getIncludes(), getDefines()); |
680 } | |
681 } | |
682 | |
683 | |
684 class KernelFastDebugConfig extends GenericDebugConfig { | |
685 String getOptFlag() { | |
686 return getCI().getOptFlag(); | |
687 } | |
688 | |
689 KernelFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
690 initNames("kernel", "fastdebug", "jvm.dll"); |
0 | 691 init(getIncludes(), getDefines()); |
692 } | |
693 } | |
694 | |
695 | |
696 class KernelProductConfig extends ProductConfig { | |
697 KernelProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
698 initNames("kernel", "product", "jvm.dll"); |
0 | 699 init(getIncludes(), getDefines()); |
700 } | |
701 } | |
702 abstract class CompilerInterface { | |
703 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
|
704 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 705 abstract Vector getDebugCompilerFlags(String opt); |
706 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
707 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 708 abstract Vector getProductCompilerFlags(); |
709 abstract Vector getProductLinkerFlags(); | |
710 abstract String getOptFlag(); | |
711 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
712 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 713 |
714 void addAttr(Vector receiver, String attr, String value) { | |
715 receiver.add(attr); receiver.add(value); | |
716 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
717 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
718 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
719 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
720 // 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
|
721 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
722 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
723 // 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
|
724 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
|
725 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
726 } |
0 | 727 } |