Mercurial > hg > truffle
comparison src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @ 2027:aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
Summary: Updates to Visual Studio project creation and development launcher
Reviewed-by: stefank, coleenp
author | sla |
---|---|
date | Wed, 15 Dec 2010 07:11:31 -0800 |
parents | f95d63e2154a |
children | 06f017f7daa7 15d6977f04b0 |
comparison
equal
deleted
inserted
replaced
2025:b03e6b4c7c75 | 2027:aa6e219afbf1 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 import java.io.*; | 25 import java.io.FileWriter; |
26 import java.util.*; | 26 import java.io.IOException; |
27 import java.io.PrintWriter; | |
28 import java.util.Hashtable; | |
29 import java.util.Iterator; | |
30 import java.util.TreeSet; | |
31 import java.util.Vector; | |
27 | 32 |
28 public class WinGammaPlatformVC7 extends WinGammaPlatform { | 33 public class WinGammaPlatformVC7 extends WinGammaPlatform { |
29 | 34 |
30 String projectVersion() {return "7.10";}; | 35 String projectVersion() {return "7.10";}; |
31 | 36 |
102 this.fname = fname; | 107 this.fname = fname; |
103 } | 108 } |
104 | 109 |
105 | 110 |
106 boolean match(FileInfo fi) { | 111 boolean match(FileInfo fi) { |
107 return fi.full.regionMatches(true, baseLen, dir, 0, dirLen); | 112 int lastSlashIndex = fi.full.lastIndexOf('/'); |
113 String fullDir = fi.full.substring(0, lastSlashIndex); | |
114 return fullDir.endsWith(dir); | |
108 } | 115 } |
109 } | 116 } |
110 | 117 |
111 class TypeFilter extends NameFilter { | 118 class TypeFilter extends NameFilter { |
112 String[] exts; | 119 String[] exts; |
215 // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC | 222 // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC |
216 // Basically there are two types of entities - container filters and real filters | 223 // Basically there are two types of entities - container filters and real filters |
217 // - container filter just provides a container to group together real filters | 224 // - container filter just provides a container to group together real filters |
218 // - real filter can select elements from the set according to some rule, put it into XML | 225 // - real filter can select elements from the set according to some rule, put it into XML |
219 // and remove from the list | 226 // and remove from the list |
220 Vector makeFilters(TreeSet files) { | 227 Vector makeFilters(TreeSet<FileInfo> files) { |
221 Vector rv = new Vector(); | 228 Vector rv = new Vector(); |
222 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); | 229 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); |
223 | 230 |
224 ContainerFilter rt = new ContainerFilter("Runtime"); | 231 String currentDir = ""; |
225 rt.add(new DirectoryFilter("share/vm/prims", sbase)); | 232 DirectoryFilter container = null; |
226 rt.add(new DirectoryFilter("share/vm/runtime", sbase)); | 233 for(FileInfo fileInfo : files) { |
227 rt.add(new DirectoryFilter("share/vm/oops", sbase)); | 234 |
228 rv.add(rt); | 235 if (!fileInfo.full.startsWith(sbase)) { |
229 | 236 continue; |
230 ContainerFilter gc = new ContainerFilter("GC"); | 237 } |
231 gc.add(new DirectoryFilter("share/vm/memory", sbase)); | 238 |
232 gc.add(new DirectoryFilter("share/vm/gc_interface", sbase)); | 239 int lastSlash = fileInfo.full.lastIndexOf('/'); |
233 | 240 String dir = fileInfo.full.substring(sbase.length(), lastSlash); |
234 ContainerFilter gc_impl = new ContainerFilter("Implementations"); | 241 if(dir.equals("share/vm")) { |
235 gc_impl.add(new DirectoryFilter("CMS", | 242 // skip files directly in share/vm - should only be precompiled.hpp which is handled below |
236 "share/vm/gc_implementation/concurrentMarkSweep", | 243 continue; |
237 sbase)); | 244 } |
238 gc_impl.add(new DirectoryFilter("Parallel Scavenge", | 245 if (!dir.equals(currentDir)) { |
239 "share/vm/gc_implementation/parallelScavenge", | 246 currentDir = dir; |
240 sbase)); | 247 if (container != null) { |
241 gc_impl.add(new DirectoryFilter("Shared", | 248 rv.add(container); |
242 "share/vm/gc_implementation/shared", | 249 } |
243 sbase)); | 250 |
244 // for all leftovers | 251 // remove "share/vm/" from names |
245 gc_impl.add(new DirectoryFilter("Misc", | 252 String name = dir; |
246 "share/vm/gc_implementation", | 253 if (dir.startsWith("share/vm/")) { |
247 sbase)); | 254 name = dir.substring("share/vm/".length(), dir.length()); |
248 | 255 } |
249 gc.add(gc_impl); | 256 container = new DirectoryFilter(name, dir, sbase); |
250 rv.add(gc); | 257 } |
251 | 258 } |
252 rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase)); | 259 if (container != null) { |
253 | 260 rv.add(container); |
254 rv.add(new DirectoryFilter("C2", "share/vm/opto", sbase)); | 261 } |
255 | |
256 ContainerFilter comp = new ContainerFilter("Compiler Common"); | |
257 comp.add(new DirectoryFilter("share/vm/asm", sbase)); | |
258 comp.add(new DirectoryFilter("share/vm/ci", sbase)); | |
259 comp.add(new DirectoryFilter("share/vm/code", sbase)); | |
260 comp.add(new DirectoryFilter("share/vm/compiler", sbase)); | |
261 rv.add(comp); | |
262 | |
263 rv.add(new DirectoryFilter("Interpreter", | |
264 "share/vm/interpreter", | |
265 sbase)); | |
266 | |
267 ContainerFilter misc = new ContainerFilter("Misc"); | |
268 misc.add(new DirectoryFilter("share/vm/libadt", sbase)); | |
269 misc.add(new DirectoryFilter("share/vm/services", sbase)); | |
270 misc.add(new DirectoryFilter("share/vm/utilities", sbase)); | |
271 misc.add(new DirectoryFilter("share/vm/classfile", sbase)); | |
272 rv.add(misc); | |
273 | |
274 rv.add(new DirectoryFilter("os_cpu", sbase)); | |
275 | |
276 rv.add(new DirectoryFilter("cpu", sbase)); | |
277 | |
278 rv.add(new DirectoryFilter("os", sbase)); | |
279 | 262 |
280 ContainerFilter generated = new ContainerFilter("Generated"); | 263 ContainerFilter generated = new ContainerFilter("Generated"); |
281 ContainerFilter c1Generated = new ContainerFilter("C1"); | 264 ContainerFilter c1Generated = new ContainerFilter("C1"); |
282 c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | 265 c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); |
283 c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); | 266 c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); |
395 startTag("FileConfiguration", | 378 startTag("FileConfiguration", |
396 new String[] { | 379 new String[] { |
397 "Name", cfg, | 380 "Name", cfg, |
398 "ExcludedFromBuild", "TRUE" | 381 "ExcludedFromBuild", "TRUE" |
399 }); | 382 }); |
400 tag("Tool", new String[] {"Name", "VCCLCompilerTool"}); | |
401 endTag("FileConfiguration"); | 383 endTag("FileConfiguration"); |
402 | 384 |
403 } | 385 } |
404 } | 386 } |
405 } | 387 } |
439 | 421 |
440 tagV("Tool", cfg.getV("LinkerFlags")); | 422 tagV("Tool", cfg.getV("LinkerFlags")); |
441 | 423 |
442 tag("Tool", | 424 tag("Tool", |
443 new String[] { | 425 new String[] { |
444 "Name", "VCPostBuildEventTool" | 426 "Name", "VCPostBuildEventTool", |
427 "Description", BuildConfig.getFieldString(null, "PostbuildDescription"), | |
428 //Caution: String.replace(String,String) is available from JDK5 onwards only | |
429 "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace | |
430 ("\t", "
")) | |
445 } | 431 } |
446 ); | 432 ); |
447 | 433 |
448 tag("Tool", | 434 tag("Tool", |
449 new String[] { | 435 new String[] { |
465 new String[] { | 451 new String[] { |
466 "Name", "VCResourceCompilerTool", | 452 "Name", "VCResourceCompilerTool", |
467 // XXX??? | 453 // XXX??? |
468 "PreprocessorDefinitions", "NDEBUG", | 454 "PreprocessorDefinitions", "NDEBUG", |
469 "Culture", "1033" | 455 "Culture", "1033" |
470 } | |
471 ); | |
472 tag("Tool", | |
473 new String[] { | |
474 "Name", "VCWebServiceProxyGeneratorTool" | |
475 } | |
476 ); | |
477 | |
478 tag ("Tool", | |
479 new String[] { | |
480 "Name", "VCXMLDataGeneratorTool" | |
481 } | |
482 ); | |
483 | |
484 tag("Tool", | |
485 new String[] { | |
486 "Name", "VCWebDeploymentTool" | |
487 } | |
488 ); | |
489 tag("Tool", | |
490 new String[] { | |
491 "Name", "VCManagedWrapperGeneratorTool" | |
492 } | |
493 ); | |
494 tag("Tool", | |
495 new String[] { | |
496 "Name", "VCAuxiliaryManagedWrapperGeneratorTool" | |
497 } | 456 } |
498 ); | 457 ); |
499 | 458 |
500 tag("Tool", | 459 tag("Tool", |
501 new String[] { | 460 new String[] { |
595 Util.join(";", defines).replace("\"",""")); | 554 Util.join(";", defines).replace("\"",""")); |
596 addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp"); | 555 addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp"); |
597 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch"); | 556 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch"); |
598 addAttr(rv, "AssemblerListingLocation", outDir); | 557 addAttr(rv, "AssemblerListingLocation", outDir); |
599 addAttr(rv, "ObjectFile", outDir+Util.sep); | 558 addAttr(rv, "ObjectFile", outDir+Util.sep); |
600 addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb"); | 559 addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb"); |
601 // Set /nologo optin | 560 // Set /nologo optin |
602 addAttr(rv, "SuppressStartupBanner", "TRUE"); | 561 addAttr(rv, "SuppressStartupBanner", "TRUE"); |
603 // Surpass the default /Tc or /Tp. 0 is compileAsDefault | 562 // Surpass the default /Tc or /Tp. 0 is compileAsDefault |
604 addAttr(rv, "CompileAs", "0"); | 563 addAttr(rv, "CompileAs", "0"); |
605 // Set /W3 option. 3 is warningLevel_3 | 564 // Set /W3 option. 3 is warningLevel_3 |
629 | 588 |
630 addAttr(rv, "Name", "VCLinkerTool"); | 589 addAttr(rv, "Name", "VCLinkerTool"); |
631 addAttr(rv, "AdditionalOptions", | 590 addAttr(rv, "AdditionalOptions", |
632 "/export:JNI_GetDefaultJavaVMInitArgs " + | 591 "/export:JNI_GetDefaultJavaVMInitArgs " + |
633 "/export:JNI_CreateJavaVM " + | 592 "/export:JNI_CreateJavaVM " + |
593 "/export:JVM_FindClassFromBootLoader "+ | |
634 "/export:JNI_GetCreatedJavaVMs "+ | 594 "/export:JNI_GetCreatedJavaVMs "+ |
635 "/export:jio_snprintf /export:jio_printf "+ | 595 "/export:jio_snprintf /export:jio_printf "+ |
636 "/export:jio_fprintf /export:jio_vfprintf "+ | 596 "/export:jio_fprintf /export:jio_vfprintf "+ |
637 "/export:jio_vsnprintf "); | 597 "/export:jio_vsnprintf "+ |
598 "/export:JVM_GetVersionInfo "+ | |
599 "/export:JVM_GetThreadStateNames "+ | |
600 "/export:JVM_GetThreadStateValues "+ | |
601 "/export:JVM_InitAgentProperties "); | |
638 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); | 602 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); |
639 addAttr(rv, "OutputFile", outDll); | 603 addAttr(rv, "OutputFile", outDll); |
640 // Set /INCREMENTAL option. 1 is linkIncrementalNo | 604 // Set /INCREMENTAL option. 1 is linkIncrementalNo |
641 addAttr(rv, "LinkIncremental", "1"); | 605 addAttr(rv, "LinkIncremental", "1"); |
642 addAttr(rv, "SuppressStartupBanner", "TRUE"); | 606 addAttr(rv, "SuppressStartupBanner", "TRUE"); |
643 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); | 607 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); |
644 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb"); | 608 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); |
645 // Set /SUBSYSTEM option. 2 is subSystemWindows | 609 // Set /SUBSYSTEM option. 2 is subSystemWindows |
646 addAttr(rv, "SubSystem", "2"); | 610 addAttr(rv, "SubSystem", "2"); |
647 addAttr(rv, "BaseAddress", "0x8000000"); | 611 addAttr(rv, "BaseAddress", "0x8000000"); |
648 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); | 612 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); |
649 // Set /MACHINE option. 1 is machineX86 | 613 // Set /MACHINE option. 1 is machineX86 |
680 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option | 644 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option |
681 | 645 |
682 return rv; | 646 return rv; |
683 } | 647 } |
684 | 648 |
649 void getAdditionalNonKernelLinkerFlags(Vector rv) { | |
650 extAttr(rv, "AdditionalOptions", | |
651 "/export:AsyncGetCallTrace "); | |
652 } | |
653 | |
685 void getProductCompilerFlags_common(Vector rv) { | 654 void getProductCompilerFlags_common(Vector rv) { |
686 // Set /O2 option. 2 is optimizeMaxSpeed | 655 // Set /O2 option. 2 is optimizeMaxSpeed |
687 addAttr(rv, "Optimization", "2"); | 656 addAttr(rv, "Optimization", "2"); |
688 // Set /Oy- option | 657 // Set /Oy- option |
689 addAttr(rv, "OmitFramePointers", "FALSE"); | 658 addAttr(rv, "OmitFramePointers", "FALSE"); |