Mercurial > hg > truffle
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 11937:12e119095ac8
Fix warnings in PTX code.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 08 Oct 2013 00:17:56 +0200 |
parents | f40010b67b6e |
children | 3cce976666d9 |
rev | line source |
---|---|
0 | 1 /* |
10405 | 2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
25 import java.util.Enumeration; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
26 import java.util.Hashtable; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
27 import java.util.Vector; |
0 | 28 |
29 class BuildConfig { | |
6801 | 30 @SuppressWarnings("rawtypes") |
0 | 31 Hashtable vars; |
6801 | 32 Vector<String> basicNames, basicPaths; |
0 | 33 String[] context; |
34 | |
35 static CompilerInterface ci; | |
36 static CompilerInterface getCI() { | |
37 if (ci == null) { | |
38 String comp = (String)getField(null, "CompilerVersion"); | |
39 try { | |
40 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance(); | |
41 } catch (Exception cnfe) { | |
42 System.err.println("Cannot find support for compiler " + comp); | |
43 throw new RuntimeException(cnfe.toString()); | |
44 } | |
45 } | |
46 return ci; | |
47 } | |
48 | |
6801 | 49 @SuppressWarnings("rawtypes") |
0 | 50 protected void initNames(String flavour, String build, String outDll) { |
51 if (vars == null) vars = new Hashtable(); | |
52 | |
53 String flavourBuild = flavour + "_" + build; | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
54 String platformName = getFieldString(null, "PlatformName"); |
1972 | 55 System.out.println(); |
56 System.out.println(flavourBuild); | |
57 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
58 put("Name", getCI().makeCfgName(flavourBuild, platformName)); |
0 | 59 put("Flavour", flavour); |
60 put("Build", build); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
61 put("PlatformName", platformName); |
0 | 62 |
63 // ones mentioned above were needed to expand format | |
64 String buildBase = expandFormat(getFieldString(null, "BuildBase")); | |
65 String sourceBase = getFieldString(null, "SourceBase"); | |
6801 | 66 String buildSpace = getFieldString(null, "BuildSpace"); |
0 | 67 String outDir = buildBase; |
10277 | 68 String jdkTargetRoot = getFieldString(null, "JdkTargetRoot"); |
0 | 69 |
10510
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
70 String value = System.getenv("OUT_DIR"); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
71 if (value != null) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
72 outDir = value; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
73 int lastDirectorySeparator = Math.max(outDir.lastIndexOf("/"), outDir.lastIndexOf("\\")); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
74 if (lastDirectorySeparator >= 0) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
75 outDir = outDir.substring(0, lastDirectorySeparator); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
76 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
77 outDir += Util.sep + build + Util.sep + "jre" + Util.sep + "bin"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
78 if (flavour.equals("graal")) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
79 outDir += Util.sep + "graal"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
80 } else if (flavour.equals("compiler1")) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
81 outDir += Util.sep + "client"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
82 } else { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
83 outDir += Util.sep + "server"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
84 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
85 buildBase = outDir; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
86 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
87 |
0 | 88 put("Id", flavourBuild); |
89 put("OutputDir", outDir); | |
90 put("SourceBase", sourceBase); | |
91 put("BuildBase", buildBase); | |
6801 | 92 put("BuildSpace", buildSpace); |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
93 put("OutputDll", outDir + Util.sep + outDll); |
10277 | 94 put("JdkTargetRoot", jdkTargetRoot); |
0 | 95 |
96 context = new String [] {flavourBuild, flavour, build, null}; | |
97 } | |
98 | |
6801 | 99 protected void init(Vector<String> includes, Vector<String> defines) { |
0 | 100 initDefaultDefines(defines); |
101 initDefaultCompilerFlags(includes); | |
102 initDefaultLinkerFlags(); | |
6801 | 103 //handleDB(); |
0 | 104 } |
105 | |
106 | |
6801 | 107 protected void initDefaultCompilerFlags(Vector<String> includes) { |
0 | 108 Vector compilerFlags = new Vector(); |
109 | |
110 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
111 includes, | |
112 get("OutputDir"))); | |
113 | |
114 put("CompilerFlags", compilerFlags); | |
115 } | |
116 | |
117 protected void initDefaultLinkerFlags() { | |
118 Vector linkerFlags = new Vector(); | |
119 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
120 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 121 |
122 put("LinkerFlags", linkerFlags); | |
123 } | |
124 | |
6801 | 125 public boolean matchesIgnoredPath(String path) { |
126 Vector<String> rv = new Vector<String>(); | |
1972 | 127 collectRelevantVectors(rv, "IgnorePath"); |
6801 | 128 for (String pathPart : rv) { |
129 if (path.contains(pathPart)) { | |
1972 | 130 return true; |
131 } | |
132 } | |
133 return false; | |
134 } | |
135 | |
6801 | 136 public boolean matchesHidePath(String path) { |
137 Vector<String> rv = new Vector<String>(); | |
138 collectRelevantVectors(rv, "HidePath"); | |
139 for (String pathPart : rv) { | |
140 if (path.contains(Util.normalize(pathPart))) { | |
141 return true; | |
142 } | |
143 } | |
144 return false; | |
145 } | |
146 | |
147 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) { | |
148 Vector<String> rv = new Vector<String>(); | |
149 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile"); | |
150 if (v != null) { | |
151 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) { | |
152 String key = e.nextElement(); | |
153 String val = v.get(key); | |
154 | |
155 if (fullPath.endsWith(expandFormat(key))) { | |
156 rv.add(expandFormat(val)); | |
0 | 157 } |
158 } | |
159 } | |
6801 | 160 return rv; |
0 | 161 } |
162 | |
163 void addTo(Hashtable ht, String key, String value) { | |
164 ht.put(expandFormat(key), expandFormat(value)); | |
165 } | |
166 | |
167 void initDefaultDefines(Vector defines) { | |
168 Vector sysDefines = new Vector(); | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
169 |
2273 | 170 if( vars.get("PlatformName").equals("Win32")) { |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
171 sysDefines.add("WIN32"); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
172 } else { |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
173 sysDefines.add("_AMD64_"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
174 sysDefines.add("AMD64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
175 sysDefines.add("_WIN64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
176 sysDefines.add("_LP64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
177 if (System.getenv("MSC_VER") != null) |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
178 sysDefines.add("MSC_VER=" + System.getenv("MSC_VER")); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
179 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
180 } |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
181 |
0 | 182 sysDefines.add("_WINDOWS"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
183 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 184 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
10405 | 185 sysDefines.add("INCLUDE_TRACE=1"); |
0 | 186 sysDefines.add("_JNI_IMPLEMENTATION_"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
187 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
188 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
189 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
190 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
191 } |
0 | 192 |
193 sysDefines.addAll(defines); | |
194 | |
195 put("Define", sysDefines); | |
196 } | |
197 | |
198 String get(String key) { | |
199 return (String)vars.get(key); | |
200 } | |
201 | |
202 Vector getV(String key) { | |
203 return (Vector)vars.get(key); | |
204 } | |
205 | |
206 Object getO(String key) { | |
207 return vars.get(key); | |
208 } | |
209 | |
210 Hashtable getH(String key) { | |
211 return (Hashtable)vars.get(key); | |
212 } | |
213 | |
214 Object getFieldInContext(String field) { | |
215 for (int i=0; i<context.length; i++) { | |
216 Object rv = getField(context[i], field); | |
217 if (rv != null) { | |
218 return rv; | |
219 } | |
220 } | |
221 return null; | |
222 } | |
223 | |
224 Object lookupHashFieldInContext(String field, String key) { | |
225 for (int i=0; i<context.length; i++) { | |
226 Hashtable ht = (Hashtable)getField(context[i], field); | |
227 if (ht != null) { | |
228 Object rv = ht.get(key); | |
229 if (rv != null) { | |
230 return rv; | |
231 } | |
232 } | |
233 } | |
234 return null; | |
235 } | |
236 | |
237 void put(String key, String value) { | |
238 vars.put(key, value); | |
239 } | |
240 | |
241 void put(String key, Vector vvalue) { | |
242 vars.put(key, vvalue); | |
243 } | |
244 | |
245 void add(String key, Vector vvalue) { | |
246 getV(key).addAll(vvalue); | |
247 } | |
248 | |
249 String flavour() { | |
250 return get("Flavour"); | |
251 } | |
252 | |
253 String build() { | |
254 return get("Build"); | |
255 } | |
256 | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
257 String outputDir() { |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
258 return get("OutputDir"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
259 } |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
260 |
0 | 261 Object getSpecificField(String field) { |
262 return getField(get("Id"), field); | |
263 } | |
264 | |
265 void putSpecificField(String field, Object value) { | |
266 putField(get("Id"), field, value); | |
267 } | |
268 | |
269 void collectRelevantVectors(Vector rv, String field) { | |
6801 | 270 for (String ctx : context) { |
271 Vector<String> v = getFieldVector(ctx, field); | |
0 | 272 if (v != null) { |
6801 | 273 for (String val : v) { |
274 rv.add(expandFormat(val).replace('/', '\\')); | |
0 | 275 } |
276 } | |
277 } | |
278 } | |
279 | |
280 void collectRelevantHashes(Hashtable rv, String field) { | |
6801 | 281 for (String ctx : context) { |
282 Hashtable v = (Hashtable)getField(ctx, field); | |
0 | 283 if (v != null) { |
284 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
285 String key = (String)e.nextElement(); | |
286 String val = (String)v.get(key); | |
287 addTo(rv, key, val); | |
288 } | |
289 } | |
290 } | |
291 } | |
292 | |
293 | |
294 Vector getDefines() { | |
295 Vector rv = new Vector(); | |
296 collectRelevantVectors(rv, "Define"); | |
297 return rv; | |
298 } | |
299 | |
300 Vector getIncludes() { | |
301 Vector rv = new Vector(); | |
302 collectRelevantVectors(rv, "AbsoluteInclude"); | |
1972 | 303 rv.addAll(getSourceIncludes()); |
304 return rv; | |
305 } | |
306 | |
307 private Vector getSourceIncludes() { | |
6801 | 308 Vector<String> rv = new Vector<String>(); |
309 Vector<String> ri = new Vector<String>(); | |
0 | 310 String sourceBase = getFieldString(null, "SourceBase"); |
311 collectRelevantVectors(ri, "RelativeInclude"); | |
6801 | 312 for (String f : ri) { |
0 | 313 rv.add(sourceBase + Util.sep + f); |
314 } | |
315 return rv; | |
316 } | |
317 | |
318 static Hashtable cfgData = new Hashtable(); | |
319 static Hashtable globalData = new Hashtable(); | |
320 | |
321 static boolean appliesToTieredBuild(String cfg) { | |
322 return (cfg != null && | |
323 (cfg.startsWith("compiler1") || | |
324 cfg.startsWith("compiler2"))); | |
325 } | |
326 | |
1972 | 327 // Filters out the IgnoreFile and IgnorePaths since they are |
328 // handled specially for tiered builds. | |
0 | 329 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 330 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 331 } |
332 | |
333 static String getTieredBuildCfg(String cfg) { | |
334 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
335 return "tiered" + cfg.substring(9); | |
336 } | |
337 | |
338 static Object getField(String cfg, String field) { | |
339 if (cfg == null) { | |
340 return globalData.get(field); | |
341 } | |
342 | |
343 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
344 return ht == null ? null : ht.get(field); | |
345 } | |
346 | |
347 static String getFieldString(String cfg, String field) { | |
348 return (String)getField(cfg, field); | |
349 } | |
350 | |
351 static Vector getFieldVector(String cfg, String field) { | |
352 return (Vector)getField(cfg, field); | |
353 } | |
354 | |
355 static void putField(String cfg, String field, Object value) { | |
356 putFieldImpl(cfg, field, value); | |
357 if (appliesToTieredBuild(cfg, field)) { | |
358 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
359 } | |
360 } | |
361 | |
362 private static void putFieldImpl(String cfg, String field, Object value) { | |
363 if (cfg == null) { | |
364 globalData.put(field, value); | |
365 return; | |
366 } | |
367 | |
368 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
369 if (ht == null) { | |
370 ht = new Hashtable(); | |
371 cfgData.put(cfg, ht); | |
372 } | |
373 | |
374 ht.put(field, value); | |
375 } | |
376 | |
377 static Object getFieldHash(String cfg, String field, String name) { | |
378 Hashtable ht = (Hashtable)getField(cfg, field); | |
379 | |
380 return ht == null ? null : ht.get(name); | |
381 } | |
382 | |
383 static void putFieldHash(String cfg, String field, String name, Object val) { | |
384 putFieldHashImpl(cfg, field, name, val); | |
1972 | 385 if (appliesToTieredBuild(cfg, field)) { |
0 | 386 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
387 } | |
388 } | |
389 | |
390 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
391 Hashtable ht = (Hashtable)getField(cfg, field); | |
392 | |
393 if (ht == null) { | |
394 ht = new Hashtable(); | |
395 putFieldImpl(cfg, field, ht); | |
396 } | |
397 | |
398 ht.put(name, val); | |
399 } | |
400 | |
401 static void addFieldVector(String cfg, String field, String element) { | |
402 addFieldVectorImpl(cfg, field, element); | |
1972 | 403 if (appliesToTieredBuild(cfg, field)) { |
0 | 404 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
405 } | |
406 } | |
407 | |
408 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
409 Vector v = (Vector)getField(cfg, field); | |
410 | |
411 if (v == null) { | |
412 v = new Vector(); | |
413 putFieldImpl(cfg, field, v); | |
414 } | |
415 | |
416 v.add(element); | |
417 } | |
418 | |
419 String expandFormat(String format) { | |
420 if (format == null) { | |
421 return null; | |
422 } | |
423 | |
424 if (format.indexOf('%') == -1) { | |
425 return format; | |
426 } | |
427 | |
428 StringBuffer sb = new StringBuffer(); | |
429 int len = format.length(); | |
430 for (int i=0; i<len; i++) { | |
431 char ch = format.charAt(i); | |
432 if (ch == '%') { | |
433 char ch1 = format.charAt(i+1); | |
434 switch (ch1) { | |
435 case '%': | |
436 sb.append(ch1); | |
437 break; | |
438 case 'b': | |
439 sb.append(build()); | |
440 break; | |
441 case 'f': | |
442 sb.append(flavour()); | |
443 break; | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
444 case 'o': |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
445 sb.append(outputDir()); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
446 break; |
0 | 447 default: |
448 sb.append(ch); | |
449 sb.append(ch1); | |
450 } | |
451 i++; | |
452 } else { | |
453 sb.append(ch); | |
454 } | |
455 } | |
456 | |
457 return sb.toString(); | |
458 } | |
459 } | |
460 | |
461 abstract class GenericDebugConfig extends BuildConfig { | |
462 abstract String getOptFlag(); | |
463 | |
464 protected void init(Vector includes, Vector defines) { | |
465 defines.add("_DEBUG"); | |
466 defines.add("ASSERT"); | |
467 | |
468 super.init(includes, defines); | |
469 | |
470 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
471 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
472 } | |
473 } | |
474 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
475 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
476 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
477 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
478 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
479 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
480 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
481 |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
482 class GraalDebugConfig extends GenericDebugNonKernelConfig { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
483 String getOptFlag() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
484 return getCI().getNoOptFlag(); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
485 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
486 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
487 GraalDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
488 initNames("graal", "debug", "jvm.dll"); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
489 init(getIncludes(), getDefines()); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
490 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
491 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
492 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
493 class GraalFastDebugConfig extends GenericDebugNonKernelConfig { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
494 String getOptFlag() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
495 return getCI().getOptFlag(); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
496 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
497 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
498 GraalFastDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
499 initNames("graal", "fastdebug", "jvm.dll"); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
500 init(getIncludes(), getDefines()); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
501 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
502 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
503 |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
504 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 505 String getOptFlag() { |
506 return getCI().getNoOptFlag(); | |
507 } | |
508 | |
509 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
510 initNames("compiler1", "debug", "jvm.dll"); |
0 | 511 init(getIncludes(), getDefines()); |
512 } | |
513 } | |
514 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
515 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 516 String getOptFlag() { |
517 return getCI().getOptFlag(); | |
518 } | |
519 | |
520 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
521 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 522 init(getIncludes(), getDefines()); |
523 } | |
524 } | |
525 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
526 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 527 String getOptFlag() { |
528 return getCI().getNoOptFlag(); | |
529 } | |
530 | |
531 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
532 initNames("compiler2", "debug", "jvm.dll"); |
0 | 533 init(getIncludes(), getDefines()); |
534 } | |
535 } | |
536 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
537 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 538 String getOptFlag() { |
539 return getCI().getOptFlag(); | |
540 } | |
541 | |
542 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
543 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 544 init(getIncludes(), getDefines()); |
545 } | |
546 } | |
547 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
548 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 549 String getOptFlag() { |
550 return getCI().getNoOptFlag(); | |
551 } | |
552 | |
553 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
554 initNames("tiered", "debug", "jvm.dll"); |
0 | 555 init(getIncludes(), getDefines()); |
556 } | |
557 } | |
558 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
559 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 560 String getOptFlag() { |
561 return getCI().getOptFlag(); | |
562 } | |
563 | |
564 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
565 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 566 init(getIncludes(), getDefines()); |
567 } | |
568 } | |
569 | |
570 abstract class ProductConfig extends BuildConfig { | |
571 protected void init(Vector includes, Vector defines) { | |
572 defines.add("NDEBUG"); | |
573 defines.add("PRODUCT"); | |
574 | |
575 super.init(includes, defines); | |
576 | |
577 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
578 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
579 } | |
580 } | |
581 | |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
582 class GraalProductConfig extends ProductConfig { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
583 GraalProductConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
584 initNames("graal", "product", "jvm.dll"); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
585 init(getIncludes(), getDefines()); |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
586 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
587 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
588 |
0 | 589 class C1ProductConfig extends ProductConfig { |
590 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
591 initNames("compiler1", "product", "jvm.dll"); |
0 | 592 init(getIncludes(), getDefines()); |
593 } | |
594 } | |
595 | |
596 class C2ProductConfig extends ProductConfig { | |
597 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
598 initNames("compiler2", "product", "jvm.dll"); |
0 | 599 init(getIncludes(), getDefines()); |
600 } | |
601 } | |
602 | |
603 class TieredProductConfig extends ProductConfig { | |
604 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
605 initNames("tiered", "product", "jvm.dll"); |
0 | 606 init(getIncludes(), getDefines()); |
607 } | |
608 } | |
609 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
610 class CoreDebugConfig extends GenericDebugNonKernelConfig { |
0 | 611 String getOptFlag() { |
612 return getCI().getNoOptFlag(); | |
613 } | |
614 | |
615 CoreDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
616 initNames("core", "debug", "jvm.dll"); |
0 | 617 init(getIncludes(), getDefines()); |
618 } | |
619 } | |
620 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
621 class CoreFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 622 String getOptFlag() { |
623 return getCI().getOptFlag(); | |
624 } | |
625 | |
626 CoreFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
627 initNames("core", "fastdebug", "jvm.dll"); |
0 | 628 init(getIncludes(), getDefines()); |
629 } | |
630 } | |
631 | |
632 class CoreProductConfig extends ProductConfig { | |
633 CoreProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
634 initNames("core", "product", "jvm.dll"); |
0 | 635 init(getIncludes(), getDefines()); |
636 } | |
637 } | |
638 | |
6801 | 639 |
0 | 640 abstract class CompilerInterface { |
641 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
642 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 643 abstract Vector getDebugCompilerFlags(String opt); |
644 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
645 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 646 abstract Vector getProductCompilerFlags(); |
647 abstract Vector getProductLinkerFlags(); | |
648 abstract String getOptFlag(); | |
649 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
650 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 651 |
652 void addAttr(Vector receiver, String attr, String value) { | |
653 receiver.add(attr); receiver.add(value); | |
654 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
655 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
656 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
657 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
658 // If attr IS NOT present in the Vector - add it |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
659 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
660 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
661 // If attr IS present in the Vector - append value to it |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
662 receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
663 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
664 } |
0 | 665 } |