Mercurial > hg > graal-jvmci-8
comparison src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @ 2273:2ab52cda08e5
Merge with OpenJDK.
author | Thomas Wuerthinger <thomas.wuerthinger@gmail.com> |
---|---|
date | Thu, 03 Mar 2011 19:25:53 +0100 |
parents | 06f017f7daa7 15d6977f04b0 |
children | 0654ee04b214 |
comparison
equal
deleted
inserted
replaced
2219:0a14ff0a8cc4 | 2273:2ab52cda08e5 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
35 String projectVersion() {return "7.10";}; | 35 String projectVersion() {return "7.10";}; |
36 | 36 |
37 public void writeProjectFile(String projectFileName, String projectName, | 37 public void writeProjectFile(String projectFileName, String projectName, |
38 Vector allConfigs) throws IOException { | 38 Vector allConfigs) throws IOException { |
39 System.out.println(); | 39 System.out.println(); |
40 System.out.println(" Writing .vcproj file..."); | 40 System.out.println(" Writing .vcproj file: "+projectFileName); |
41 // If we got this far without an error, we're safe to actually | 41 // If we got this far without an error, we're safe to actually |
42 // write the .vcproj file | 42 // write the .vcproj file |
43 printWriter = new PrintWriter(new FileWriter(projectFileName)); | 43 printWriter = new PrintWriter(new FileWriter(projectFileName)); |
44 | 44 |
45 printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>"); | 45 printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>"); |
52 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}", | 52 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}", |
53 "SccProjectName", "", | 53 "SccProjectName", "", |
54 "SccLocalPath", "" | 54 "SccLocalPath", "" |
55 } | 55 } |
56 ); | 56 ); |
57 | |
58 startTag("Platforms", null); | 57 startTag("Platforms", null); |
59 tag("Platform", new String[] {"Name", Util.os()}); | 58 tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")}); |
60 endTag("Platforms"); | 59 endTag("Platforms"); |
61 | 60 |
62 startTag("Configurations", null); | 61 startTag("Configurations", null); |
63 | 62 |
64 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { | 63 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { |
79 System.out.println(" Done."); | 78 System.out.println(" Done."); |
80 } | 79 } |
81 | 80 |
82 | 81 |
83 abstract class NameFilter { | 82 abstract class NameFilter { |
84 protected String fname; | 83 protected String fname; |
85 | 84 |
86 abstract boolean match(FileInfo fi); | 85 abstract boolean match(FileInfo fi); |
87 | 86 |
88 String filterString() { return ""; } | 87 String filterString() { return ""; } |
89 String name() { return this.fname;} | 88 String name() { return this.fname;} |
89 | |
90 @Override | |
91 // eclipse auto-generated | |
92 public int hashCode() { | |
93 final int prime = 31; | |
94 int result = 1; | |
95 result = prime * result + getOuterType().hashCode(); | |
96 result = prime * result + ((fname == null) ? 0 : fname.hashCode()); | |
97 return result; | |
98 } | |
99 | |
100 @Override | |
101 // eclipse auto-generated | |
102 public boolean equals(Object obj) { | |
103 if (this == obj) | |
104 return true; | |
105 if (obj == null) | |
106 return false; | |
107 if (getClass() != obj.getClass()) | |
108 return false; | |
109 NameFilter other = (NameFilter) obj; | |
110 if (!getOuterType().equals(other.getOuterType())) | |
111 return false; | |
112 if (fname == null) { | |
113 if (other.fname != null) | |
114 return false; | |
115 } else if (!fname.equals(other.fname)) | |
116 return false; | |
117 return true; | |
118 } | |
119 | |
120 // eclipse auto-generated | |
121 private WinGammaPlatformVC7 getOuterType() { | |
122 return WinGammaPlatformVC7.this; | |
123 } | |
90 } | 124 } |
91 | 125 |
92 class DirectoryFilter extends NameFilter { | 126 class DirectoryFilter extends NameFilter { |
93 String dir; | 127 String dir; |
94 int baseLen, dirLen; | 128 int baseLen, dirLen; |
107 this.fname = fname; | 141 this.fname = fname; |
108 } | 142 } |
109 | 143 |
110 | 144 |
111 boolean match(FileInfo fi) { | 145 boolean match(FileInfo fi) { |
112 int lastSlashIndex = fi.full.lastIndexOf('/'); | 146 int lastSlashIndex = fi.full.lastIndexOf('/'); |
113 String fullDir = fi.full.substring(0, lastSlashIndex); | 147 String fullDir = fi.full.substring(0, lastSlashIndex); |
114 return fullDir.endsWith(dir); | 148 return fullDir.endsWith(dir); |
149 } | |
150 | |
151 @Override | |
152 // eclipse auto-generated | |
153 public int hashCode() { | |
154 final int prime = 31; | |
155 int result = super.hashCode(); | |
156 result = prime * result + getOuterType().hashCode(); | |
157 result = prime * result + baseLen; | |
158 result = prime * result + ((dir == null) ? 0 : dir.hashCode()); | |
159 result = prime * result + dirLen; | |
160 return result; | |
161 } | |
162 | |
163 @Override | |
164 // eclipse auto-generated | |
165 public boolean equals(Object obj) { | |
166 if (this == obj) | |
167 return true; | |
168 if (!super.equals(obj)) | |
169 return false; | |
170 if (getClass() != obj.getClass()) | |
171 return false; | |
172 DirectoryFilter other = (DirectoryFilter) obj; | |
173 if (!getOuterType().equals(other.getOuterType())) | |
174 return false; | |
175 if (baseLen != other.baseLen) | |
176 return false; | |
177 if (dir == null) { | |
178 if (other.dir != null) | |
179 return false; | |
180 } else if (!dir.equals(other.dir)) | |
181 return false; | |
182 if (dirLen != other.dirLen) | |
183 return false; | |
184 return true; | |
185 } | |
186 | |
187 // eclipse auto-generated | |
188 private WinGammaPlatformVC7 getOuterType() { | |
189 return WinGammaPlatformVC7.this; | |
115 } | 190 } |
116 } | 191 } |
117 | 192 |
118 class TypeFilter extends NameFilter { | 193 class TypeFilter extends NameFilter { |
119 String[] exts; | 194 String[] exts; |
230 | 305 |
231 String currentDir = ""; | 306 String currentDir = ""; |
232 DirectoryFilter container = null; | 307 DirectoryFilter container = null; |
233 for(FileInfo fileInfo : files) { | 308 for(FileInfo fileInfo : files) { |
234 | 309 |
235 if (!fileInfo.full.startsWith(sbase)) { | 310 if (!fileInfo.full.startsWith(sbase)) { |
236 continue; | 311 continue; |
237 } | 312 } |
238 | 313 |
239 int lastSlash = fileInfo.full.lastIndexOf('/'); | 314 int lastSlash = fileInfo.full.lastIndexOf('/'); |
240 String dir = fileInfo.full.substring(sbase.length(), lastSlash); | 315 String dir = fileInfo.full.substring(sbase.length(), lastSlash); |
241 if(dir.equals("share/vm")) { | 316 if(dir.equals("share/vm")) { |
242 // skip files directly in share/vm - should only be precompiled.hpp which is handled below | 317 // skip files directly in share/vm - should only be precompiled.hpp which is handled below |
243 continue; | 318 continue; |
244 } | 319 } |
245 if (!dir.equals(currentDir)) { | 320 if (!dir.equals(currentDir)) { |
246 currentDir = dir; | 321 currentDir = dir; |
247 if (container != null) { | 322 if (container != null && !rv.contains(container)) { |
248 rv.add(container); | 323 rv.add(container); |
249 } | 324 } |
250 | 325 |
251 // remove "share/vm/" from names | 326 // remove "share/vm/" from names |
252 String name = dir; | 327 String name = dir; |
253 if (dir.startsWith("share/vm/")) { | 328 if (dir.startsWith("share/vm/")) { |
254 name = dir.substring("share/vm/".length(), dir.length()); | 329 name = dir.substring("share/vm/".length(), dir.length()); |
255 } | 330 } |
256 container = new DirectoryFilter(name, dir, sbase); | 331 DirectoryFilter newfilter = new DirectoryFilter(name, dir, sbase); |
257 } | 332 int i = rv.indexOf(newfilter); |
258 } | 333 if(i == -1) { |
259 if (container != null) { | 334 container = newfilter; |
260 rv.add(container); | 335 } else { |
261 } | 336 // if the filter already exists, reuse it |
262 | 337 container = (DirectoryFilter) rv.get(i); |
263 rv.add(new DirectoryFilter("C1X", "share/vm/c1x", sbase)); | 338 } |
264 rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase)); | 339 } |
340 } | |
341 if (container != null && !rv.contains(container)) { | |
342 rv.add(container); | |
343 } | |
265 | 344 |
266 ContainerFilter generated = new ContainerFilter("Generated"); | 345 ContainerFilter generated = new ContainerFilter("Generated"); |
267 ContainerFilter c1Generated = new ContainerFilter("C1"); | 346 ContainerFilter c1Generated = new ContainerFilter("C1"); |
268 c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); | 347 c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); |
269 c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); | 348 c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); |
463 new String[] { | 542 new String[] { |
464 "Name", "VCMIDLTool", | 543 "Name", "VCMIDLTool", |
465 "PreprocessorDefinitions", "NDEBUG", | 544 "PreprocessorDefinitions", "NDEBUG", |
466 "MkTypLibCompatible", "TRUE", | 545 "MkTypLibCompatible", "TRUE", |
467 "SuppressStartupBanner", "TRUE", | 546 "SuppressStartupBanner", "TRUE", |
468 "TargetEnvironment", Util.os().equals("Win32") ? "1" : "3", | 547 "TargetEnvironment", "1", |
469 "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb", | 548 "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb", |
470 "HeaderFileName", "" | 549 "HeaderFileName", "" |
471 } | 550 } |
472 ); | 551 ); |
473 | 552 |
584 addAttr(rv, "ExceptionHandling", "FALSE"); | 663 addAttr(rv, "ExceptionHandling", "FALSE"); |
585 | 664 |
586 return rv; | 665 return rv; |
587 } | 666 } |
588 | 667 |
589 Vector getBaseLinkerFlags(String outDir, String outDll) { | 668 Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { |
590 Vector rv = new Vector(); | 669 Vector rv = new Vector(); |
591 | 670 |
592 addAttr(rv, "Name", "VCLinkerTool"); | 671 addAttr(rv, "Name", "VCLinkerTool"); |
593 addAttr(rv, "AdditionalOptions", | 672 addAttr(rv, "AdditionalOptions", |
594 "/export:JNI_GetDefaultJavaVMInitArgs " + | 673 "/export:JNI_GetDefaultJavaVMInitArgs " + |
611 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); | 690 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); |
612 // Set /SUBSYSTEM option. 2 is subSystemWindows | 691 // Set /SUBSYSTEM option. 2 is subSystemWindows |
613 addAttr(rv, "SubSystem", "2"); | 692 addAttr(rv, "SubSystem", "2"); |
614 addAttr(rv, "BaseAddress", "0x8000000"); | 693 addAttr(rv, "BaseAddress", "0x8000000"); |
615 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); | 694 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); |
616 // Set /MACHINE option. 1 is machineX86 | 695 if(platformName.equals("Win32")) { |
617 addAttr(rv, "TargetMachine", Util.os().equals("Win32") ? "1" : "17"); | 696 // Set /MACHINE option. 1 is X86 |
697 addAttr(rv, "TargetMachine", "1"); | |
698 } else { | |
699 // Set /MACHINE option. 17 is X64 | |
700 addAttr(rv, "TargetMachine", "17"); | |
701 } | |
618 | 702 |
619 return rv; | 703 return rv; |
620 } | 704 } |
621 | 705 |
622 void getDebugCompilerFlags_common(String opt,Vector rv) { | 706 void getDebugCompilerFlags_common(String opt,Vector rv) { |
657 void getProductCompilerFlags_common(Vector rv) { | 741 void getProductCompilerFlags_common(Vector rv) { |
658 // Set /O2 option. 2 is optimizeMaxSpeed | 742 // Set /O2 option. 2 is optimizeMaxSpeed |
659 addAttr(rv, "Optimization", "2"); | 743 addAttr(rv, "Optimization", "2"); |
660 // Set /Oy- option | 744 // Set /Oy- option |
661 addAttr(rv, "OmitFramePointers", "FALSE"); | 745 addAttr(rv, "OmitFramePointers", "FALSE"); |
662 } | |
663 | |
664 Vector getProductCompilerFlags() { | |
665 Vector rv = new Vector(); | |
666 | |
667 getProductCompilerFlags_common(rv); | |
668 // Set /Ob option. 1 is expandOnlyInline | 746 // Set /Ob option. 1 is expandOnlyInline |
669 addAttr(rv, "InlineFunctionExpansion", "1"); | 747 addAttr(rv, "InlineFunctionExpansion", "1"); |
670 // Set /GF option. | 748 // Set /GF option. |
671 addAttr(rv, "StringPooling", "TRUE"); | 749 addAttr(rv, "StringPooling", "TRUE"); |
672 // Set /MD option. 2 is rtMultiThreadedDLL | 750 // Set /MD option. 2 is rtMultiThreadedDLL |
673 addAttr(rv, "RuntimeLibrary", "2"); | 751 addAttr(rv, "RuntimeLibrary", "2"); |
674 // Set /Gy option | 752 // Set /Gy option |
675 addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); | 753 addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); |
754 } | |
755 | |
756 Vector getProductCompilerFlags() { | |
757 Vector rv = new Vector(); | |
758 | |
759 getProductCompilerFlags_common(rv); | |
676 | 760 |
677 return rv; | 761 return rv; |
678 } | 762 } |
679 | 763 |
680 Vector getProductLinkerFlags() { | 764 Vector getProductLinkerFlags() { |
694 | 778 |
695 String getNoOptFlag() { | 779 String getNoOptFlag() { |
696 return "0"; | 780 return "0"; |
697 } | 781 } |
698 | 782 |
699 String makeCfgName(String flavourBuild) { | 783 String makeCfgName(String flavourBuild, String platform) { |
700 return flavourBuild + "|" + Util.os(); | 784 return flavourBuild + "|" + platform; |
701 } | 785 } |
702 } | 786 } |