annotate src/share/tools/MakeDeps/WinGammaPlatformVC7.java @ 0:a61af66fc99e jdk7-b24

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