Mercurial > hg > graal-compiler
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | b9a918201d47 f2110083203d |
children | f40010b67b6e |
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 |
70 put("Id", flavourBuild); | |
71 put("OutputDir", outDir); | |
72 put("SourceBase", sourceBase); | |
73 put("BuildBase", buildBase); | |
6801 | 74 put("BuildSpace", buildSpace); |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
75 put("OutputDll", outDir + Util.sep + outDll); |
10277 | 76 put("JdkTargetRoot", jdkTargetRoot); |
0 | 77 |
78 context = new String [] {flavourBuild, flavour, build, null}; | |
79 } | |
80 | |
6801 | 81 protected void init(Vector<String> includes, Vector<String> defines) { |
0 | 82 initDefaultDefines(defines); |
83 initDefaultCompilerFlags(includes); | |
84 initDefaultLinkerFlags(); | |
6801 | 85 //handleDB(); |
0 | 86 } |
87 | |
88 | |
6801 | 89 protected void initDefaultCompilerFlags(Vector<String> includes) { |
0 | 90 Vector compilerFlags = new Vector(); |
91 | |
92 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
93 includes, | |
94 get("OutputDir"))); | |
95 | |
96 put("CompilerFlags", compilerFlags); | |
97 } | |
98 | |
99 protected void initDefaultLinkerFlags() { | |
100 Vector linkerFlags = new Vector(); | |
101 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
102 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 103 |
104 put("LinkerFlags", linkerFlags); | |
105 } | |
106 | |
6801 | 107 public boolean matchesIgnoredPath(String path) { |
108 Vector<String> rv = new Vector<String>(); | |
1972 | 109 collectRelevantVectors(rv, "IgnorePath"); |
6801 | 110 for (String pathPart : rv) { |
111 if (path.contains(pathPart)) { | |
1972 | 112 return true; |
113 } | |
114 } | |
115 return false; | |
116 } | |
117 | |
6801 | 118 public boolean matchesHidePath(String path) { |
119 Vector<String> rv = new Vector<String>(); | |
120 collectRelevantVectors(rv, "HidePath"); | |
121 for (String pathPart : rv) { | |
122 if (path.contains(Util.normalize(pathPart))) { | |
123 return true; | |
124 } | |
125 } | |
126 return false; | |
127 } | |
128 | |
129 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) { | |
130 Vector<String> rv = new Vector<String>(); | |
131 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile"); | |
132 if (v != null) { | |
133 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) { | |
134 String key = e.nextElement(); | |
135 String val = v.get(key); | |
136 | |
137 if (fullPath.endsWith(expandFormat(key))) { | |
138 rv.add(expandFormat(val)); | |
0 | 139 } |
140 } | |
141 } | |
6801 | 142 return rv; |
0 | 143 } |
144 | |
145 void addTo(Hashtable ht, String key, String value) { | |
146 ht.put(expandFormat(key), expandFormat(value)); | |
147 } | |
148 | |
149 void initDefaultDefines(Vector defines) { | |
150 Vector sysDefines = new Vector(); | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
151 |
2273 | 152 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
|
153 sysDefines.add("WIN32"); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
154 } else { |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
155 sysDefines.add("_AMD64_"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
156 sysDefines.add("AMD64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
157 sysDefines.add("_WIN64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
158 sysDefines.add("_LP64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
159 if (System.getenv("MSC_VER") != null) |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
160 sysDefines.add("MSC_VER=" + System.getenv("MSC_VER")); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
161 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
162 } |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
163 |
0 | 164 sysDefines.add("_WINDOWS"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
165 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 166 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
10405 | 167 sysDefines.add("INCLUDE_TRACE=1"); |
0 | 168 sysDefines.add("_JNI_IMPLEMENTATION_"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
169 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
170 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
171 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
172 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
173 } |
0 | 174 |
175 sysDefines.addAll(defines); | |
176 | |
177 put("Define", sysDefines); | |
178 } | |
179 | |
180 String get(String key) { | |
181 return (String)vars.get(key); | |
182 } | |
183 | |
184 Vector getV(String key) { | |
185 return (Vector)vars.get(key); | |
186 } | |
187 | |
188 Object getO(String key) { | |
189 return vars.get(key); | |
190 } | |
191 | |
192 Hashtable getH(String key) { | |
193 return (Hashtable)vars.get(key); | |
194 } | |
195 | |
196 Object getFieldInContext(String field) { | |
197 for (int i=0; i<context.length; i++) { | |
198 Object rv = getField(context[i], field); | |
199 if (rv != null) { | |
200 return rv; | |
201 } | |
202 } | |
203 return null; | |
204 } | |
205 | |
206 Object lookupHashFieldInContext(String field, String key) { | |
207 for (int i=0; i<context.length; i++) { | |
208 Hashtable ht = (Hashtable)getField(context[i], field); | |
209 if (ht != null) { | |
210 Object rv = ht.get(key); | |
211 if (rv != null) { | |
212 return rv; | |
213 } | |
214 } | |
215 } | |
216 return null; | |
217 } | |
218 | |
219 void put(String key, String value) { | |
220 vars.put(key, value); | |
221 } | |
222 | |
223 void put(String key, Vector vvalue) { | |
224 vars.put(key, vvalue); | |
225 } | |
226 | |
227 void add(String key, Vector vvalue) { | |
228 getV(key).addAll(vvalue); | |
229 } | |
230 | |
231 String flavour() { | |
232 return get("Flavour"); | |
233 } | |
234 | |
235 String build() { | |
236 return get("Build"); | |
237 } | |
238 | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
239 String outputDir() { |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
240 return get("OutputDir"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
241 } |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
242 |
0 | 243 Object getSpecificField(String field) { |
244 return getField(get("Id"), field); | |
245 } | |
246 | |
247 void putSpecificField(String field, Object value) { | |
248 putField(get("Id"), field, value); | |
249 } | |
250 | |
251 void collectRelevantVectors(Vector rv, String field) { | |
6801 | 252 for (String ctx : context) { |
253 Vector<String> v = getFieldVector(ctx, field); | |
0 | 254 if (v != null) { |
6801 | 255 for (String val : v) { |
256 rv.add(expandFormat(val).replace('/', '\\')); | |
0 | 257 } |
258 } | |
259 } | |
260 } | |
261 | |
262 void collectRelevantHashes(Hashtable rv, String field) { | |
6801 | 263 for (String ctx : context) { |
264 Hashtable v = (Hashtable)getField(ctx, field); | |
0 | 265 if (v != null) { |
266 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
267 String key = (String)e.nextElement(); | |
268 String val = (String)v.get(key); | |
269 addTo(rv, key, val); | |
270 } | |
271 } | |
272 } | |
273 } | |
274 | |
275 | |
276 Vector getDefines() { | |
277 Vector rv = new Vector(); | |
278 collectRelevantVectors(rv, "Define"); | |
279 return rv; | |
280 } | |
281 | |
282 Vector getIncludes() { | |
283 Vector rv = new Vector(); | |
284 collectRelevantVectors(rv, "AbsoluteInclude"); | |
1972 | 285 rv.addAll(getSourceIncludes()); |
286 return rv; | |
287 } | |
288 | |
289 private Vector getSourceIncludes() { | |
6801 | 290 Vector<String> rv = new Vector<String>(); |
291 Vector<String> ri = new Vector<String>(); | |
0 | 292 String sourceBase = getFieldString(null, "SourceBase"); |
293 collectRelevantVectors(ri, "RelativeInclude"); | |
6801 | 294 for (String f : ri) { |
0 | 295 rv.add(sourceBase + Util.sep + f); |
296 } | |
297 return rv; | |
298 } | |
299 | |
300 static Hashtable cfgData = new Hashtable(); | |
301 static Hashtable globalData = new Hashtable(); | |
302 | |
303 static boolean appliesToTieredBuild(String cfg) { | |
304 return (cfg != null && | |
305 (cfg.startsWith("compiler1") || | |
306 cfg.startsWith("compiler2"))); | |
307 } | |
308 | |
1972 | 309 // Filters out the IgnoreFile and IgnorePaths since they are |
310 // handled specially for tiered builds. | |
0 | 311 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 312 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 313 } |
314 | |
315 static String getTieredBuildCfg(String cfg) { | |
316 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
317 return "tiered" + cfg.substring(9); | |
318 } | |
319 | |
320 static Object getField(String cfg, String field) { | |
321 if (cfg == null) { | |
322 return globalData.get(field); | |
323 } | |
324 | |
325 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
326 return ht == null ? null : ht.get(field); | |
327 } | |
328 | |
329 static String getFieldString(String cfg, String field) { | |
330 return (String)getField(cfg, field); | |
331 } | |
332 | |
333 static Vector getFieldVector(String cfg, String field) { | |
334 return (Vector)getField(cfg, field); | |
335 } | |
336 | |
337 static void putField(String cfg, String field, Object value) { | |
338 putFieldImpl(cfg, field, value); | |
339 if (appliesToTieredBuild(cfg, field)) { | |
340 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
341 } | |
342 } | |
343 | |
344 private static void putFieldImpl(String cfg, String field, Object value) { | |
345 if (cfg == null) { | |
346 globalData.put(field, value); | |
347 return; | |
348 } | |
349 | |
350 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
351 if (ht == null) { | |
352 ht = new Hashtable(); | |
353 cfgData.put(cfg, ht); | |
354 } | |
355 | |
356 ht.put(field, value); | |
357 } | |
358 | |
359 static Object getFieldHash(String cfg, String field, String name) { | |
360 Hashtable ht = (Hashtable)getField(cfg, field); | |
361 | |
362 return ht == null ? null : ht.get(name); | |
363 } | |
364 | |
365 static void putFieldHash(String cfg, String field, String name, Object val) { | |
366 putFieldHashImpl(cfg, field, name, val); | |
1972 | 367 if (appliesToTieredBuild(cfg, field)) { |
0 | 368 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
369 } | |
370 } | |
371 | |
372 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
373 Hashtable ht = (Hashtable)getField(cfg, field); | |
374 | |
375 if (ht == null) { | |
376 ht = new Hashtable(); | |
377 putFieldImpl(cfg, field, ht); | |
378 } | |
379 | |
380 ht.put(name, val); | |
381 } | |
382 | |
383 static void addFieldVector(String cfg, String field, String element) { | |
384 addFieldVectorImpl(cfg, field, element); | |
1972 | 385 if (appliesToTieredBuild(cfg, field)) { |
0 | 386 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
387 } | |
388 } | |
389 | |
390 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
391 Vector v = (Vector)getField(cfg, field); | |
392 | |
393 if (v == null) { | |
394 v = new Vector(); | |
395 putFieldImpl(cfg, field, v); | |
396 } | |
397 | |
398 v.add(element); | |
399 } | |
400 | |
401 String expandFormat(String format) { | |
402 if (format == null) { | |
403 return null; | |
404 } | |
405 | |
406 if (format.indexOf('%') == -1) { | |
407 return format; | |
408 } | |
409 | |
410 StringBuffer sb = new StringBuffer(); | |
411 int len = format.length(); | |
412 for (int i=0; i<len; i++) { | |
413 char ch = format.charAt(i); | |
414 if (ch == '%') { | |
415 char ch1 = format.charAt(i+1); | |
416 switch (ch1) { | |
417 case '%': | |
418 sb.append(ch1); | |
419 break; | |
420 case 'b': | |
421 sb.append(build()); | |
422 break; | |
423 case 'f': | |
424 sb.append(flavour()); | |
425 break; | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
426 case 'o': |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
427 sb.append(outputDir()); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
428 break; |
0 | 429 default: |
430 sb.append(ch); | |
431 sb.append(ch1); | |
432 } | |
433 i++; | |
434 } else { | |
435 sb.append(ch); | |
436 } | |
437 } | |
438 | |
439 return sb.toString(); | |
440 } | |
441 } | |
442 | |
443 abstract class GenericDebugConfig extends BuildConfig { | |
444 abstract String getOptFlag(); | |
445 | |
446 protected void init(Vector includes, Vector defines) { | |
447 defines.add("_DEBUG"); | |
448 defines.add("ASSERT"); | |
449 | |
450 super.init(includes, defines); | |
451 | |
452 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
453 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
454 } | |
455 } | |
456 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
457 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
458 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
459 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
460 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
461 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
462 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
463 |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
464 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
|
465 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
|
466 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
|
467 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
468 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
469 GraalDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
470 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
|
471 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
|
472 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
473 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
474 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
475 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
|
476 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
|
477 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
|
478 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
479 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
480 GraalFastDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
481 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
|
482 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
|
483 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
484 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
485 |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
486 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 487 String getOptFlag() { |
488 return getCI().getNoOptFlag(); | |
489 } | |
490 | |
491 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
492 initNames("compiler1", "debug", "jvm.dll"); |
0 | 493 init(getIncludes(), getDefines()); |
494 } | |
495 } | |
496 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
497 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 498 String getOptFlag() { |
499 return getCI().getOptFlag(); | |
500 } | |
501 | |
502 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
503 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 504 init(getIncludes(), getDefines()); |
505 } | |
506 } | |
507 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
508 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 509 String getOptFlag() { |
510 return getCI().getNoOptFlag(); | |
511 } | |
512 | |
513 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
514 initNames("compiler2", "debug", "jvm.dll"); |
0 | 515 init(getIncludes(), getDefines()); |
516 } | |
517 } | |
518 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
519 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 520 String getOptFlag() { |
521 return getCI().getOptFlag(); | |
522 } | |
523 | |
524 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
525 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 526 init(getIncludes(), getDefines()); |
527 } | |
528 } | |
529 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
530 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 531 String getOptFlag() { |
532 return getCI().getNoOptFlag(); | |
533 } | |
534 | |
535 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
536 initNames("tiered", "debug", "jvm.dll"); |
0 | 537 init(getIncludes(), getDefines()); |
538 } | |
539 } | |
540 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
541 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 542 String getOptFlag() { |
543 return getCI().getOptFlag(); | |
544 } | |
545 | |
546 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
547 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 548 init(getIncludes(), getDefines()); |
549 } | |
550 } | |
551 | |
552 abstract class ProductConfig extends BuildConfig { | |
553 protected void init(Vector includes, Vector defines) { | |
554 defines.add("NDEBUG"); | |
555 defines.add("PRODUCT"); | |
556 | |
557 super.init(includes, defines); | |
558 | |
559 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
560 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
561 } | |
562 } | |
563 | |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
564 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
|
565 GraalProductConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
566 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
|
567 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
|
568 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
569 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
570 |
0 | 571 class C1ProductConfig extends ProductConfig { |
572 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
573 initNames("compiler1", "product", "jvm.dll"); |
0 | 574 init(getIncludes(), getDefines()); |
575 } | |
576 } | |
577 | |
578 class C2ProductConfig extends ProductConfig { | |
579 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
580 initNames("compiler2", "product", "jvm.dll"); |
0 | 581 init(getIncludes(), getDefines()); |
582 } | |
583 } | |
584 | |
585 class TieredProductConfig extends ProductConfig { | |
586 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
587 initNames("tiered", "product", "jvm.dll"); |
0 | 588 init(getIncludes(), getDefines()); |
589 } | |
590 } | |
591 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
592 class CoreDebugConfig extends GenericDebugNonKernelConfig { |
0 | 593 String getOptFlag() { |
594 return getCI().getNoOptFlag(); | |
595 } | |
596 | |
597 CoreDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
598 initNames("core", "debug", "jvm.dll"); |
0 | 599 init(getIncludes(), getDefines()); |
600 } | |
601 } | |
602 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
603 class CoreFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 604 String getOptFlag() { |
605 return getCI().getOptFlag(); | |
606 } | |
607 | |
608 CoreFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
609 initNames("core", "fastdebug", "jvm.dll"); |
0 | 610 init(getIncludes(), getDefines()); |
611 } | |
612 } | |
613 | |
614 class CoreProductConfig extends ProductConfig { | |
615 CoreProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
616 initNames("core", "product", "jvm.dll"); |
0 | 617 init(getIncludes(), getDefines()); |
618 } | |
619 } | |
620 | |
6801 | 621 |
0 | 622 abstract class CompilerInterface { |
623 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
|
624 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 625 abstract Vector getDebugCompilerFlags(String opt); |
626 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
627 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 628 abstract Vector getProductCompilerFlags(); |
629 abstract Vector getProductLinkerFlags(); | |
630 abstract String getOptFlag(); | |
631 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
632 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 633 |
634 void addAttr(Vector receiver, String attr, String value) { | |
635 receiver.add(attr); receiver.add(value); | |
636 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
637 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
638 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
639 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
640 // 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
|
641 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
642 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
643 // 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
|
644 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
|
645 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
646 } |
0 | 647 } |