Mercurial > hg > truffle
annotate src/share/tools/MakeDeps/WinGammaPlatformVC7.java @ 1406:35069ca331f2
Hooked C1XCompiler class into the system.
Two new flags:
-XX:+UseC1X makes sure that the C1X compiler is used instead of C1
-XX:TraceC1X=0 sets the trace level for C1X (value between 0=no output and 5=verbose)
author | Thomas Wuerthinger <thomas.wuerthinger@gmail.com> |
---|---|
date | Tue, 11 May 2010 18:19:17 +0200 |
parents | bd02caa94611 |
children | 0ba67bb5392c |
rev | line source |
---|---|
0 | 1 /* |
844 | 2 * Copyright 2005-2009 Sun Microsystems, Inc. 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 * | |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
22 * | |
23 */ | |
24 | |
25 import java.io.*; | |
26 import java.util.*; | |
27 | |
28 public class WinGammaPlatformVC7 extends WinGammaPlatform { | |
29 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
30 String projectVersion() {return "7.10";}; |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
31 |
0 | 32 public void writeProjectFile(String projectFileName, String projectName, |
33 Vector allConfigs) throws IOException { | |
34 System.out.println(); | |
35 System.out.println(" Writing .vcproj file..."); | |
36 // If we got this far without an error, we're safe to actually | |
37 // write the .vcproj file | |
38 printWriter = new PrintWriter(new FileWriter(projectFileName)); | |
39 | |
40 printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>"); | |
41 startTag( | |
42 "VisualStudioProject", | |
43 new String[] { | |
44 "ProjectType", "Visual C++", | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
45 "Version", projectVersion(), |
0 | 46 "Name", projectName, |
47 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}", | |
48 "SccProjectName", "", | |
49 "SccLocalPath", "" | |
50 } | |
51 ); | |
52 | |
53 startTag("Platforms", null); | |
54 tag("Platform", new String[] {"Name", Util.os}); | |
55 endTag("Platforms"); | |
56 | |
57 startTag("Configurations", null); | |
58 | |
59 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { | |
60 writeConfiguration((BuildConfig)i.next()); | |
61 } | |
62 | |
63 endTag("Configurations"); | |
64 | |
65 tag("References", null); | |
66 | |
67 writeFiles(allConfigs); | |
68 | |
69 tag("Globals", null); | |
70 | |
71 endTag("VisualStudioProject"); | |
72 printWriter.close(); | |
73 | |
74 System.out.println(" Done."); | |
75 } | |
76 | |
77 | |
78 abstract class NameFilter { | |
79 protected String fname; | |
80 | |
81 abstract boolean match(FileInfo fi); | |
82 | |
83 String filterString() { return ""; } | |
84 String name() { return this.fname;} | |
85 } | |
86 | |
87 class DirectoryFilter extends NameFilter { | |
88 String dir; | |
89 int baseLen, dirLen; | |
90 | |
91 DirectoryFilter(String dir, String sbase) { | |
92 this.dir = dir; | |
93 this.baseLen = sbase.length(); | |
94 this.dirLen = dir.length(); | |
95 this.fname = dir; | |
96 } | |
97 | |
98 DirectoryFilter(String fname, String dir, String sbase) { | |
99 this.dir = dir; | |
100 this.baseLen = sbase.length(); | |
101 this.dirLen = dir.length(); | |
102 this.fname = fname; | |
103 } | |
104 | |
105 | |
106 boolean match(FileInfo fi) { | |
107 return fi.full.regionMatches(true, baseLen, dir, 0, dirLen); | |
108 } | |
109 } | |
110 | |
111 class TypeFilter extends NameFilter { | |
112 String[] exts; | |
113 | |
114 TypeFilter(String fname, String[] exts) { | |
115 this.fname = fname; | |
116 this.exts = exts; | |
117 } | |
118 | |
119 boolean match(FileInfo fi) { | |
120 for (int i=0; i<exts.length; i++) { | |
121 if (fi.full.endsWith(exts[i])) { | |
122 return true; | |
123 } | |
124 } | |
125 return false; | |
126 } | |
127 | |
128 String filterString() { | |
129 return Util.join(";", exts); | |
130 } | |
131 } | |
132 | |
133 class TerminatorFilter extends NameFilter { | |
134 TerminatorFilter(String fname) { | |
135 this.fname = fname; | |
136 | |
137 } | |
138 boolean match(FileInfo fi) { | |
139 return true; | |
140 } | |
141 | |
142 } | |
143 | |
144 class SpecificNameFilter extends NameFilter { | |
145 String pats[]; | |
146 | |
147 SpecificNameFilter(String fname, String[] pats) { | |
148 this.fname = fname; | |
149 this.pats = pats; | |
150 } | |
151 | |
152 boolean match(FileInfo fi) { | |
153 for (int i=0; i<pats.length; i++) { | |
154 if (fi.attr.shortName.matches(pats[i])) { | |
155 return true; | |
156 } | |
157 } | |
158 return false; | |
159 } | |
160 | |
161 } | |
162 | |
163 class ContainerFilter extends NameFilter { | |
164 Vector children; | |
165 | |
166 ContainerFilter(String fname) { | |
167 this.fname = fname; | |
168 children = new Vector(); | |
169 | |
170 } | |
171 boolean match(FileInfo fi) { | |
172 return false; | |
173 } | |
174 | |
175 Iterator babies() { return children.iterator(); } | |
176 | |
177 void add(NameFilter f) { | |
178 children.add(f); | |
179 } | |
180 } | |
181 | |
182 | |
183 void writeCustomToolConfig(Vector configs, String[] customToolAttrs) { | |
184 for (Iterator i = configs.iterator(); i.hasNext(); ) { | |
185 startTag("FileConfiguration", | |
186 new String[] { | |
187 "Name", (String)i.next() | |
188 } | |
189 ); | |
190 tag("Tool", customToolAttrs); | |
191 | |
192 endTag("FileConfiguration"); | |
193 } | |
194 } | |
195 | |
196 // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC | |
197 // Basically there are two types of entities - container filters and real filters | |
198 // - container filter just provides a container to group together real filters | |
199 // - real filter can select elements from the set according to some rule, put it into XML | |
200 // and remove from the list | |
201 Vector makeFilters(TreeSet files) { | |
202 Vector rv = new Vector(); | |
203 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); | |
204 | |
205 ContainerFilter rt = new ContainerFilter("Runtime"); | |
206 rt.add(new DirectoryFilter("share/vm/prims", sbase)); | |
207 rt.add(new DirectoryFilter("share/vm/runtime", sbase)); | |
208 rt.add(new DirectoryFilter("share/vm/oops", sbase)); | |
209 rv.add(rt); | |
210 | |
211 ContainerFilter gc = new ContainerFilter("GC"); | |
212 gc.add(new DirectoryFilter("share/vm/memory", sbase)); | |
213 gc.add(new DirectoryFilter("share/vm/gc_interface", sbase)); | |
214 | |
215 ContainerFilter gc_impl = new ContainerFilter("Implementations"); | |
216 gc_impl.add(new DirectoryFilter("CMS", | |
217 "share/vm/gc_implementation/concurrentMarkSweep", | |
218 sbase)); | |
219 gc_impl.add(new DirectoryFilter("Parallel Scavenge", | |
220 "share/vm/gc_implementation/parallelScavenge", | |
221 sbase)); | |
222 gc_impl.add(new DirectoryFilter("Shared", | |
223 "share/vm/gc_implementation/shared", | |
224 sbase)); | |
225 // for all leftovers | |
226 gc_impl.add(new DirectoryFilter("Misc", | |
227 "share/vm/gc_implementation", | |
228 sbase)); | |
229 | |
230 gc.add(gc_impl); | |
231 rv.add(gc); | |
232 | |
1406
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
844
diff
changeset
|
233 rv.add(new DirectoryFilter("C1X", "share/vm/c1x", sbase)); |
35069ca331f2
Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
844
diff
changeset
|
234 |
0 | 235 rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase)); |
236 | |
237 ContainerFilter c2 = new ContainerFilter("C2"); | |
238 //c2.add(new DirectoryFilter("share/vm/adlc", sbase)); | |
239 c2.add(new DirectoryFilter("share/vm/opto", sbase)); | |
240 c2.add(new SpecificNameFilter("Generated", new String[] {"^ad_.+", "^dfa_.+", "^adGlobals.+"})); | |
241 rv.add(c2); | |
242 | |
243 ContainerFilter comp = new ContainerFilter("Compiler Common"); | |
244 comp.add(new DirectoryFilter("share/vm/asm", sbase)); | |
245 comp.add(new DirectoryFilter("share/vm/ci", sbase)); | |
246 comp.add(new DirectoryFilter("share/vm/code", sbase)); | |
247 comp.add(new DirectoryFilter("share/vm/compiler", sbase)); | |
248 rv.add(comp); | |
249 | |
250 rv.add(new DirectoryFilter("Interpreter", | |
251 "share/vm/interpreter", | |
252 sbase)); | |
253 | |
254 ContainerFilter misc = new ContainerFilter("Misc"); | |
255 //misc.add(new DirectoryFilter("share/vm/launch", sbase)); | |
256 misc.add(new DirectoryFilter("share/vm/libadt", sbase)); | |
257 misc.add(new DirectoryFilter("share/vm/services", sbase)); | |
258 misc.add(new DirectoryFilter("share/vm/utilities", sbase)); | |
259 rv.add(misc); | |
260 | |
261 rv.add(new DirectoryFilter("os_cpu", sbase)); | |
262 | |
263 rv.add(new DirectoryFilter("cpu", sbase)); | |
264 | |
265 rv.add(new DirectoryFilter("os", sbase)); | |
266 | |
267 rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"})); | |
268 | |
269 rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"})); | |
270 | |
271 rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"})); | |
272 | |
273 // this one is to catch files not caught by other filters | |
274 //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"})); | |
275 rv.add(new TerminatorFilter("Source Files")); | |
276 | |
277 return rv; | |
278 } | |
279 | |
280 void writeFiles(Vector allConfigs) { | |
281 | |
282 Hashtable allFiles = computeAttributedFiles(allConfigs); | |
283 | |
284 Vector allConfigNames = new Vector(); | |
285 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { | |
286 allConfigNames.add(((BuildConfig)i.next()).get("Name")); | |
287 } | |
288 | |
289 TreeSet sortedFiles = sortFiles(allFiles); | |
290 | |
291 startTag("Files", null); | |
292 | |
293 for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) { | |
294 doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next()); | |
295 } | |
296 | |
297 | |
298 startTag("Filter", | |
299 new String[] { | |
300 "Name", "Resource Files", | |
301 "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" | |
302 } | |
303 ); | |
304 endTag("Filter"); | |
305 | |
306 endTag("Files"); | |
307 } | |
308 | |
309 void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) { | |
310 startTag("Filter", | |
311 new String[] { | |
312 "Name", filter.name(), | |
313 "Filter", filter.filterString() | |
314 } | |
315 ); | |
316 | |
317 if (filter instanceof ContainerFilter) { | |
318 | |
319 Iterator i = ((ContainerFilter)filter).babies(); | |
320 while (i.hasNext()) { | |
321 doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next()); | |
322 } | |
323 | |
324 } else { | |
325 | |
326 Iterator i = allFiles.iterator(); | |
327 while (i.hasNext()) { | |
328 FileInfo fi = (FileInfo)i.next(); | |
329 | |
330 if (!filter.match(fi)) { | |
331 continue; | |
332 } | |
333 | |
334 startTag("File", | |
335 new String[] { | |
336 "RelativePath", fi.full.replace('/', '\\') | |
337 } | |
338 ); | |
339 | |
340 FileAttribute a = fi.attr; | |
341 if (a.pchRoot) { | |
342 writeCustomToolConfig(allConfigNames, | |
343 new String[] { | |
344 "Name", "VCCLCompilerTool", | |
345 "UsePrecompiledHeader", "1" | |
346 }); | |
347 } | |
348 | |
349 if (a.noPch) { | |
350 writeCustomToolConfig(allConfigNames, | |
351 new String[] { | |
352 "Name", "VCCLCompilerTool", | |
353 "UsePrecompiledHeader", "0" | |
354 }); | |
355 } | |
356 | |
357 if (a.configs != null) { | |
358 for (Iterator j=allConfigNames.iterator(); j.hasNext();) { | |
359 String cfg = (String)j.next(); | |
360 if (!a.configs.contains(cfg)) { | |
361 startTag("FileConfiguration", | |
362 new String[] { | |
363 "Name", cfg, | |
364 "ExcludedFromBuild", "TRUE" | |
365 }); | |
366 tag("Tool", new String[] {"Name", "VCCLCompilerTool"}); | |
367 endTag("FileConfiguration"); | |
368 | |
369 } | |
370 } | |
371 } | |
372 | |
373 endTag("File"); | |
374 | |
375 // we not gonna look at this file anymore | |
376 i.remove(); | |
377 } | |
378 } | |
379 | |
380 endTag("Filter"); | |
381 } | |
382 | |
383 | |
384 void writeConfiguration(BuildConfig cfg) { | |
385 startTag("Configuration", | |
386 new String[] { | |
387 "Name", cfg.get("Name"), | |
388 "OutputDirectory", cfg.get("OutputDir"), | |
389 "IntermediateDirectory", cfg.get("OutputDir"), | |
390 "ConfigurationType", "2", | |
391 "UseOfMFC", "0", | |
392 "ATLMinimizesCRunTimeLibraryUsage", "FALSE" | |
393 } | |
394 ); | |
395 | |
396 | |
397 | |
398 tagV("Tool", cfg.getV("CompilerFlags")); | |
399 | |
400 tag("Tool", | |
401 new String[] { | |
402 "Name", "VCCustomBuildTool" | |
403 } | |
404 ); | |
405 | |
406 tagV("Tool", cfg.getV("LinkerFlags")); | |
407 | |
408 tag("Tool", | |
409 new String[] { | |
410 "Name", "VCPostBuildEventTool" | |
411 } | |
412 ); | |
413 | |
414 tag("Tool", | |
415 new String[] { | |
416 "Name", "VCPreBuildEventTool" | |
417 } | |
418 ); | |
419 | |
420 tag("Tool", | |
421 new String[] { | |
422 "Name", "VCPreLinkEventTool", | |
423 "Description", BuildConfig.getFieldString(null, "PrelinkDescription"), | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
424 //Caution: String.replace(String,String) is available from JDK5 onwards only |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
425 "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
426 ("\t", "
")) |
0 | 427 } |
428 ); | |
429 | |
430 tag("Tool", | |
431 new String[] { | |
432 "Name", "VCResourceCompilerTool", | |
433 // XXX??? | |
434 "PreprocessorDefinitions", "NDEBUG", | |
435 "Culture", "1033" | |
436 } | |
437 ); | |
438 tag("Tool", | |
439 new String[] { | |
440 "Name", "VCWebServiceProxyGeneratorTool" | |
441 } | |
442 ); | |
443 | |
444 tag ("Tool", | |
445 new String[] { | |
446 "Name", "VCXMLDataGeneratorTool" | |
447 } | |
448 ); | |
449 | |
450 tag("Tool", | |
451 new String[] { | |
452 "Name", "VCWebDeploymentTool" | |
453 } | |
454 ); | |
455 tag("Tool", | |
456 new String[] { | |
457 "Name", "VCManagedWrapperGeneratorTool" | |
458 } | |
459 ); | |
460 tag("Tool", | |
461 new String[] { | |
462 "Name", "VCAuxiliaryManagedWrapperGeneratorTool" | |
463 } | |
464 ); | |
465 | |
466 tag("Tool", | |
467 new String[] { | |
468 "Name", "VCMIDLTool", | |
469 "PreprocessorDefinitions", "NDEBUG", | |
470 "MkTypLibCompatible", "TRUE", | |
471 "SuppressStartupBanner", "TRUE", | |
472 "TargetEnvironment", "1", | |
473 "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb", | |
474 "HeaderFileName", "" | |
475 } | |
476 ); | |
477 | |
478 endTag("Configuration"); | |
479 } | |
480 | |
481 int indent; | |
482 | |
483 private void startTagPrim(String name, | |
484 String[] attrs, | |
485 boolean close) { | |
486 doIndent(); | |
487 printWriter.print("<"+name); | |
488 indent++; | |
489 | |
490 if (attrs != null) { | |
491 printWriter.println(); | |
492 for (int i=0; i<attrs.length; i+=2) { | |
493 doIndent(); | |
494 printWriter.println(" " + attrs[i]+"=\""+attrs[i+1]+"\""); | |
495 } | |
496 } | |
497 | |
498 if (close) { | |
499 indent--; | |
500 //doIndent(); | |
501 printWriter.println("/>"); | |
502 } else { | |
503 //doIndent(); | |
504 printWriter.println(">"); | |
505 } | |
506 } | |
507 | |
508 void startTag(String name, String[] attrs) { | |
509 startTagPrim(name, attrs, false); | |
510 } | |
511 | |
512 void startTagV(String name, Vector attrs) { | |
513 String s[] = new String [attrs.size()]; | |
514 for (int i=0; i<attrs.size(); i++) { | |
515 s[i] = (String)attrs.elementAt(i); | |
516 } | |
517 startTagPrim(name, s, false); | |
518 } | |
519 | |
520 void endTag(String name) { | |
521 indent--; | |
522 doIndent(); | |
523 printWriter.println("</"+name+">"); | |
524 } | |
525 | |
526 void tag(String name, String[] attrs) { | |
527 startTagPrim(name, attrs, true); | |
528 } | |
529 | |
530 void tagV(String name, Vector attrs) { | |
531 String s[] = new String [attrs.size()]; | |
532 for (int i=0; i<attrs.size(); i++) { | |
533 s[i] = (String)attrs.elementAt(i); | |
534 } | |
535 startTagPrim(name, s, true); | |
536 } | |
537 | |
538 | |
539 void doIndent() { | |
540 for (int i=0; i<indent; i++) { | |
541 printWriter.print(" "); | |
542 } | |
543 } | |
544 | |
545 protected String getProjectExt() { | |
546 return ".vcproj"; | |
547 } | |
548 } | |
549 | |
550 class CompilerInterfaceVC7 extends CompilerInterface { | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
551 void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) { |
0 | 552 |
553 // advanced M$ IDE (2003) can only recognize name if it's first or | |
554 // second attribute in the tag - go guess | |
555 addAttr(rv, "Name", "VCCLCompilerTool"); | |
556 addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes)); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
557 addAttr(rv, "PreprocessorDefinitions", |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
558 Util.join(";", defines).replace("\"",""")); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
559 addAttr(rv, "PrecompiledHeaderThrough", |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
560 "incls"+Util.sep+"_precompiled.incl"); |
0 | 561 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch"); |
562 addAttr(rv, "AssemblerListingLocation", outDir); | |
563 addAttr(rv, "ObjectFile", outDir+Util.sep); | |
564 addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb"); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
565 // Set /nologo optin |
0 | 566 addAttr(rv, "SuppressStartupBanner", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
567 // Surpass the default /Tc or /Tp. 0 is compileAsDefault |
0 | 568 addAttr(rv, "CompileAs", "0"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
569 // Set /W3 option. 3 is warningLevel_3 |
0 | 570 addAttr(rv, "WarningLevel", "3"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
571 // Set /WX option, |
0 | 572 addAttr(rv, "WarnAsError", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
573 // Set /GS option |
0 | 574 addAttr(rv, "BufferSecurityCheck", "FALSE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
575 // Set /Zi option. 3 is debugEnabled |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
576 addAttr(rv, "DebugInformationFormat", "3"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
577 } |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
578 Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
579 Vector rv = new Vector(); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
580 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
581 getBaseCompilerFlags_common(defines,includes, outDir, rv); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
582 // Set /Yu option. 3 is pchUseUsingSpecific |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
583 // Note: Starting VC8 pchUseUsingSpecific is 2 !!! |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
584 addAttr(rv, "UsePrecompiledHeader", "3"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
585 // Set /EHsc- option |
0 | 586 addAttr(rv, "ExceptionHandling", "FALSE"); |
587 | |
588 return rv; | |
589 } | |
590 | |
591 Vector getBaseLinkerFlags(String outDir, String outDll) { | |
592 Vector rv = new Vector(); | |
593 | |
594 addAttr(rv, "Name", "VCLinkerTool"); | |
595 addAttr(rv, "AdditionalOptions", | |
596 "/export:JNI_GetDefaultJavaVMInitArgs " + | |
597 "/export:JNI_CreateJavaVM " + | |
598 "/export:JNI_GetCreatedJavaVMs "+ | |
599 "/export:jio_snprintf /export:jio_printf "+ | |
600 "/export:jio_fprintf /export:jio_vfprintf "+ | |
601 "/export:jio_vsnprintf "); | |
602 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); | |
603 addAttr(rv, "OutputFile", outDll); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
604 // Set /INCREMENTAL option. 1 is linkIncrementalNo |
0 | 605 addAttr(rv, "LinkIncremental", "1"); |
606 addAttr(rv, "SuppressStartupBanner", "TRUE"); | |
607 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); | |
608 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb"); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
609 // Set /SUBSYSTEM option. 2 is subSystemWindows |
0 | 610 addAttr(rv, "SubSystem", "2"); |
611 addAttr(rv, "BaseAddress", "0x8000000"); | |
612 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
613 // Set /MACHINE option. 1 is machineX86 |
0 | 614 addAttr(rv, "TargetMachine", "1"); |
615 | |
616 return rv; | |
617 } | |
618 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
619 void getDebugCompilerFlags_common(String opt,Vector rv) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
620 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
621 // Set /On option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
622 addAttr(rv, "Optimization", opt); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
623 // Set /FR option. 1 is brAllInfo |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
624 addAttr(rv, "BrowseInformation", "1"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
625 addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
626 // Set /MD option. 2 is rtMultiThreadedDLL |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
627 addAttr(rv, "RuntimeLibrary", "2"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
628 // Set /Oy- option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
629 addAttr(rv, "OmitFramePointers", "FALSE"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
630 |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
631 } |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
632 |
0 | 633 Vector getDebugCompilerFlags(String opt) { |
634 Vector rv = new Vector(); | |
635 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
636 getDebugCompilerFlags_common(opt,rv); |
0 | 637 |
638 return rv; | |
639 } | |
640 | |
641 Vector getDebugLinkerFlags() { | |
642 Vector rv = new Vector(); | |
643 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
644 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option |
0 | 645 |
646 return rv; | |
647 } | |
648 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
649 void getProductCompilerFlags_common(Vector rv) { |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
650 // Set /O2 option. 2 is optimizeMaxSpeed |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
651 addAttr(rv, "Optimization", "2"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
652 // Set /Oy- option |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
653 addAttr(rv, "OmitFramePointers", "FALSE"); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
654 } |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
655 |
0 | 656 Vector getProductCompilerFlags() { |
657 Vector rv = new Vector(); | |
658 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
659 getProductCompilerFlags_common(rv); |
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
660 // Set /Ob option. 1 is expandOnlyInline |
0 | 661 addAttr(rv, "InlineFunctionExpansion", "1"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
662 // Set /GF option. |
0 | 663 addAttr(rv, "StringPooling", "TRUE"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
664 // Set /MD option. 2 is rtMultiThreadedDLL |
0 | 665 addAttr(rv, "RuntimeLibrary", "2"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
666 // Set /Gy option |
0 | 667 addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); |
668 | |
669 return rv; | |
670 } | |
671 | |
672 Vector getProductLinkerFlags() { | |
673 Vector rv = new Vector(); | |
674 | |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
675 // Set /OPT:REF option. 2 is optReferences |
0 | 676 addAttr(rv, "OptimizeReferences", "2"); |
659
520d43965b1f
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
0
diff
changeset
|
677 // Set /OPT:optFolding option. 2 is optFolding |
0 | 678 addAttr(rv, "EnableCOMDATFolding", "2"); |
679 | |
680 return rv; | |
681 } | |
682 | |
683 String getOptFlag() { | |
684 return "2"; | |
685 } | |
686 | |
687 String getNoOptFlag() { | |
688 return "0"; | |
689 } | |
690 | |
691 String makeCfgName(String flavourBuild) { | |
692 return flavourBuild + "|" + Util.os; | |
693 } | |
694 } |