Mercurial > hg > graal-compiler
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 4977:532be189cf09
Reducing diff to hsx24
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 27 Feb 2012 17:06:18 +0100 |
parents | 33df1aeaebbf |
children | e522a00b91aa |
rev | line source |
---|---|
0 | 1 /* |
4878
2eeebe4b4213
7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents:
2233
diff
changeset
|
2 * Copyright (c) 2005, 2012, 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 | |
25 import java.io.File; | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
26 import java.util.Enumeration; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
27 import java.util.Hashtable; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
28 import java.util.Iterator; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
29 import java.util.Vector; |
0 | 30 |
31 class BuildConfig { | |
32 Hashtable vars; | |
33 Vector basicNames, basicPaths; | |
34 String[] context; | |
35 | |
36 static CompilerInterface ci; | |
37 static CompilerInterface getCI() { | |
38 if (ci == null) { | |
39 String comp = (String)getField(null, "CompilerVersion"); | |
40 try { | |
41 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance(); | |
42 } catch (Exception cnfe) { | |
43 System.err.println("Cannot find support for compiler " + comp); | |
44 throw new RuntimeException(cnfe.toString()); | |
45 } | |
46 } | |
47 return ci; | |
48 } | |
49 | |
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"); | |
66 String outDir = buildBase; | |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
67 String value = System.getenv("OUT_DIR"); |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
68 if (value != null) { |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
69 outDir = value; |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
70 } |
4597
8bc6f680a88d
fixed visual studio project files
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4572
diff
changeset
|
71 |
8bc6f680a88d
fixed visual studio project files
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4572
diff
changeset
|
72 int lastDirectorySeparator = Math.max(outDir.lastIndexOf("/"), outDir.lastIndexOf("\\")); |
8bc6f680a88d
fixed visual studio project files
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4572
diff
changeset
|
73 if (lastDirectorySeparator >= 0) { |
8bc6f680a88d
fixed visual studio project files
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4572
diff
changeset
|
74 outDir = outDir.substring(0, lastDirectorySeparator); |
4475
f400f9554f09
fixed windows build, filtered methodDataOop for reflection
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4474
diff
changeset
|
75 } |
f400f9554f09
fixed windows build, filtered methodDataOop for reflection
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4474
diff
changeset
|
76 |
4634
0f899c0b7e86
fixed VS project files
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4597
diff
changeset
|
77 outDir += Util.sep + build + Util.sep + "jre" + Util.sep + "bin"; |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
78 if (flavour.equals("graal")) { |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
79 outDir += Util.sep + "graal"; |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
80 } else if (flavour.equals("compiler1")) { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
81 outDir += Util.sep + "client"; |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
82 } else { |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
83 outDir += Util.sep + "server"; |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
84 } |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3543
diff
changeset
|
85 buildBase = outDir; |
0 | 86 |
87 put("Id", flavourBuild); | |
88 put("OutputDir", outDir); | |
89 put("SourceBase", sourceBase); | |
90 put("BuildBase", buildBase); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
91 put("OutputDll", outDir + Util.sep + outDll); |
0 | 92 |
93 context = new String [] {flavourBuild, flavour, build, null}; | |
94 } | |
95 | |
96 protected void init(Vector includes, Vector defines) { | |
97 initDefaultDefines(defines); | |
98 initDefaultCompilerFlags(includes); | |
99 initDefaultLinkerFlags(); | |
1972 | 100 handleDB(); |
0 | 101 } |
102 | |
103 | |
104 protected void initDefaultCompilerFlags(Vector includes) { | |
105 Vector compilerFlags = new Vector(); | |
106 | |
107 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
108 includes, | |
109 get("OutputDir"))); | |
110 | |
111 put("CompilerFlags", compilerFlags); | |
112 } | |
113 | |
114 protected void initDefaultLinkerFlags() { | |
115 Vector linkerFlags = new Vector(); | |
116 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
117 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 118 |
119 put("LinkerFlags", linkerFlags); | |
120 } | |
121 | |
122 DirectoryTree getSourceTree(String sourceBase, String startAt) { | |
123 DirectoryTree tree = new DirectoryTree(); | |
124 | |
125 tree.addSubdirToIgnore("Codemgr_wsdata"); | |
126 tree.addSubdirToIgnore("deleted_files"); | |
127 tree.addSubdirToIgnore("SCCS"); | |
128 if (startAt != null) { | |
129 tree.readDirectory(sourceBase + File.separator + startAt); | |
130 } else { | |
131 tree.readDirectory(sourceBase); | |
132 } | |
133 | |
134 return tree; | |
135 } | |
136 | |
137 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
138 Vector getPreferredPaths() { |
0 | 139 Vector preferredPaths = new Vector(); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
140 |
0 | 141 // In the case of multiple files with the same name in |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
142 // different subdirectories, prefer these versions |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
143 preferredPaths.add("windows"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
144 preferredPaths.add("x86"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
145 preferredPaths.add("closed"); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
146 |
0 | 147 // Also prefer "opto" over "adlc" for adlcVMDeps.hpp |
148 preferredPaths.add("opto"); | |
149 | |
150 return preferredPaths; | |
151 } | |
152 | |
153 | |
1972 | 154 void handleDB() { |
0 | 155 WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); |
156 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
157 putSpecificField("AllFilesHash", computeAllFiles(platform)); |
0 | 158 } |
159 | |
160 | |
1972 | 161 private boolean matchesIgnoredPath(String prefixedName) { |
162 Vector rv = new Vector(); | |
163 collectRelevantVectors(rv, "IgnorePath"); | |
164 for (Iterator i = rv.iterator(); i.hasNext(); ) { | |
165 String pathPart = (String) i.next(); | |
166 if (prefixedName.contains(Util.normalize(pathPart))) { | |
167 return true; | |
168 } | |
169 } | |
170 return false; | |
171 } | |
172 | |
0 | 173 void addAll(Iterator i, Hashtable hash, |
174 WinGammaPlatform platform, DirectoryTree tree, | |
175 Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) { | |
176 for (; i.hasNext(); ) { | |
177 String fileName = (String) i.next(); | |
178 if (lookupHashFieldInContext("IgnoreFile", fileName) == null) { | |
179 String prefixedName = platform.envVarPrefixedFileName(fileName, | |
180 0, /* ignored */ | |
181 tree, | |
182 preferredPaths, | |
183 filesNotFound, | |
184 filesDuplicate); | |
185 if (prefixedName != null) { | |
1972 | 186 prefixedName = Util.normalize(prefixedName); |
187 if (!matchesIgnoredPath(prefixedName)) { | |
188 addTo(hash, prefixedName, fileName); | |
189 } | |
0 | 190 } |
191 } | |
192 } | |
193 } | |
194 | |
195 void addTo(Hashtable ht, String key, String value) { | |
196 ht.put(expandFormat(key), expandFormat(value)); | |
197 } | |
198 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
199 Hashtable computeAllFiles(WinGammaPlatform platform) { |
0 | 200 Hashtable rv = new Hashtable(); |
201 DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
202 Vector preferredPaths = getPreferredPaths(); |
0 | 203 |
204 // Hold errors until end | |
205 Vector filesNotFound = new Vector(); | |
206 Vector filesDuplicate = new Vector(); | |
207 | |
1972 | 208 Vector includedFiles = new Vector(); |
0 | 209 |
210 // find all files | |
1972 | 211 Vector dirs = getSourceIncludes(); |
212 for (Iterator i = dirs.iterator(); i.hasNext(); ) { | |
213 String dir = (String)i.next(); | |
214 DirectoryTree subtree = getSourceTree(dir, null); | |
215 for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) { | |
216 String name = ((File)fi.next()).getName(); | |
217 includedFiles.add(name); | |
218 } | |
0 | 219 } |
1972 | 220 addAll(includedFiles.iterator(), rv, |
0 | 221 platform, tree, |
222 preferredPaths, filesNotFound, filesDuplicate); | |
223 | |
224 Vector addFiles = new Vector(); | |
225 collectRelevantVectors(addFiles, "AdditionalFile"); | |
226 addAll(addFiles.iterator(), rv, | |
227 platform, tree, | |
228 preferredPaths, filesNotFound, filesDuplicate); | |
229 | |
230 collectRelevantHashes(rv, "AdditionalGeneratedFile"); | |
231 | |
232 if ((filesNotFound.size() != 0) || | |
233 (filesDuplicate.size() != 0)) { | |
234 System.err.println("Error: some files were not found or " + | |
235 "appeared in multiple subdirectories of " + | |
236 "directory " + get("SourceBase") + " and could not " + | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
237 "be resolved with os_family and arch."); |
0 | 238 if (filesNotFound.size() != 0) { |
239 System.err.println("Files not found:"); | |
240 for (Iterator iter = filesNotFound.iterator(); | |
241 iter.hasNext(); ) { | |
242 System.err.println(" " + (String) iter.next()); | |
243 } | |
244 } | |
245 if (filesDuplicate.size() != 0) { | |
246 System.err.println("Duplicate files:"); | |
247 for (Iterator iter = filesDuplicate.iterator(); | |
248 iter.hasNext(); ) { | |
249 System.err.println(" " + (String) iter.next()); | |
250 } | |
251 } | |
252 throw new RuntimeException(); | |
253 } | |
254 | |
255 return rv; | |
256 } | |
257 | |
258 void initDefaultDefines(Vector defines) { | |
259 Vector sysDefines = new Vector(); | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
260 |
2273 | 261 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
|
262 sysDefines.add("WIN32"); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
263 } else { |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
264 sysDefines.add("_AMD64_"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
265 sysDefines.add("AMD64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
266 sysDefines.add("_WIN64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
267 sysDefines.add("_LP64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
268 if (System.getenv("MSC_VER") != null) |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
269 sysDefines.add("MSC_VER=" + System.getenv("MSC_VER")); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
270 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
271 } |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
272 |
0 | 273 sysDefines.add("_WINDOWS"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
274 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 275 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
4878
2eeebe4b4213
7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents:
2233
diff
changeset
|
276 sysDefines.add("INCLUDE_TRACE"); |
0 | 277 sysDefines.add("_JNI_IMPLEMENTATION_"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
278 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
279 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
280 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
281 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
282 } |
0 | 283 |
284 sysDefines.addAll(defines); | |
285 | |
286 put("Define", sysDefines); | |
287 } | |
288 | |
289 String get(String key) { | |
290 return (String)vars.get(key); | |
291 } | |
292 | |
293 Vector getV(String key) { | |
294 return (Vector)vars.get(key); | |
295 } | |
296 | |
297 Object getO(String key) { | |
298 return vars.get(key); | |
299 } | |
300 | |
301 Hashtable getH(String key) { | |
302 return (Hashtable)vars.get(key); | |
303 } | |
304 | |
305 Object getFieldInContext(String field) { | |
306 for (int i=0; i<context.length; i++) { | |
307 Object rv = getField(context[i], field); | |
308 if (rv != null) { | |
309 return rv; | |
310 } | |
311 } | |
312 return null; | |
313 } | |
314 | |
315 Object lookupHashFieldInContext(String field, String key) { | |
316 for (int i=0; i<context.length; i++) { | |
317 Hashtable ht = (Hashtable)getField(context[i], field); | |
318 if (ht != null) { | |
319 Object rv = ht.get(key); | |
320 if (rv != null) { | |
321 return rv; | |
322 } | |
323 } | |
324 } | |
325 return null; | |
326 } | |
327 | |
328 void put(String key, String value) { | |
329 vars.put(key, value); | |
330 } | |
331 | |
332 void put(String key, Vector vvalue) { | |
333 vars.put(key, vvalue); | |
334 } | |
335 | |
336 void add(String key, Vector vvalue) { | |
337 getV(key).addAll(vvalue); | |
338 } | |
339 | |
340 String flavour() { | |
341 return get("Flavour"); | |
342 } | |
343 | |
344 String build() { | |
345 return get("Build"); | |
346 } | |
347 | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
348 String outputDir() { |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
349 return get("OutputDir"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
350 } |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
351 |
0 | 352 Object getSpecificField(String field) { |
353 return getField(get("Id"), field); | |
354 } | |
355 | |
356 void putSpecificField(String field, Object value) { | |
357 putField(get("Id"), field, value); | |
358 } | |
359 | |
360 void collectRelevantVectors(Vector rv, String field) { | |
361 for (int i = 0; i < context.length; i++) { | |
362 Vector v = getFieldVector(context[i], field); | |
363 if (v != null) { | |
364 for (Iterator j=v.iterator(); j.hasNext(); ) { | |
365 String val = (String)j.next(); | |
366 rv.add(expandFormat(val)); | |
367 } | |
368 } | |
369 } | |
370 } | |
371 | |
372 void collectRelevantHashes(Hashtable rv, String field) { | |
373 for (int i = 0; i < context.length; i++) { | |
374 Hashtable v = (Hashtable)getField(context[i], field); | |
375 if (v != null) { | |
376 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
377 String key = (String)e.nextElement(); | |
378 String val = (String)v.get(key); | |
379 addTo(rv, key, val); | |
380 } | |
381 } | |
382 } | |
383 } | |
384 | |
385 | |
386 Vector getDefines() { | |
387 Vector rv = new Vector(); | |
388 collectRelevantVectors(rv, "Define"); | |
389 return rv; | |
390 } | |
391 | |
392 Vector getIncludes() { | |
393 Vector rv = new Vector(); | |
394 | |
395 collectRelevantVectors(rv, "AbsoluteInclude"); | |
396 | |
1972 | 397 rv.addAll(getSourceIncludes()); |
398 | |
399 return rv; | |
400 } | |
401 | |
402 private Vector getSourceIncludes() { | |
403 Vector rv = new Vector(); | |
0 | 404 Vector ri = new Vector(); |
405 String sourceBase = getFieldString(null, "SourceBase"); | |
406 collectRelevantVectors(ri, "RelativeInclude"); | |
407 for (Iterator i = ri.iterator(); i.hasNext(); ) { | |
408 String f = (String)i.next(); | |
409 rv.add(sourceBase + Util.sep + f); | |
410 } | |
411 return rv; | |
412 } | |
413 | |
414 static Hashtable cfgData = new Hashtable(); | |
415 static Hashtable globalData = new Hashtable(); | |
416 | |
417 static boolean appliesToTieredBuild(String cfg) { | |
418 return (cfg != null && | |
419 (cfg.startsWith("compiler1") || | |
420 cfg.startsWith("compiler2"))); | |
421 } | |
422 | |
1972 | 423 // Filters out the IgnoreFile and IgnorePaths since they are |
424 // handled specially for tiered builds. | |
0 | 425 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 426 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 427 } |
428 | |
429 static String getTieredBuildCfg(String cfg) { | |
430 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
431 return "tiered" + cfg.substring(9); | |
432 } | |
433 | |
434 static Object getField(String cfg, String field) { | |
435 if (cfg == null) { | |
436 return globalData.get(field); | |
437 } | |
438 | |
439 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
440 return ht == null ? null : ht.get(field); | |
441 } | |
442 | |
443 static String getFieldString(String cfg, String field) { | |
444 return (String)getField(cfg, field); | |
445 } | |
446 | |
447 static Vector getFieldVector(String cfg, String field) { | |
448 return (Vector)getField(cfg, field); | |
449 } | |
450 | |
451 static void putField(String cfg, String field, Object value) { | |
452 putFieldImpl(cfg, field, value); | |
453 if (appliesToTieredBuild(cfg, field)) { | |
454 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
455 } | |
456 } | |
457 | |
458 private static void putFieldImpl(String cfg, String field, Object value) { | |
459 if (cfg == null) { | |
460 globalData.put(field, value); | |
461 return; | |
462 } | |
463 | |
464 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
465 if (ht == null) { | |
466 ht = new Hashtable(); | |
467 cfgData.put(cfg, ht); | |
468 } | |
469 | |
470 ht.put(field, value); | |
471 } | |
472 | |
473 static Object getFieldHash(String cfg, String field, String name) { | |
474 Hashtable ht = (Hashtable)getField(cfg, field); | |
475 | |
476 return ht == null ? null : ht.get(name); | |
477 } | |
478 | |
479 static void putFieldHash(String cfg, String field, String name, Object val) { | |
480 putFieldHashImpl(cfg, field, name, val); | |
1972 | 481 if (appliesToTieredBuild(cfg, field)) { |
0 | 482 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
483 } | |
484 } | |
485 | |
486 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
487 Hashtable ht = (Hashtable)getField(cfg, field); | |
488 | |
489 if (ht == null) { | |
490 ht = new Hashtable(); | |
491 putFieldImpl(cfg, field, ht); | |
492 } | |
493 | |
494 ht.put(name, val); | |
495 } | |
496 | |
497 static void addFieldVector(String cfg, String field, String element) { | |
498 addFieldVectorImpl(cfg, field, element); | |
1972 | 499 if (appliesToTieredBuild(cfg, field)) { |
0 | 500 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
501 } | |
502 } | |
503 | |
504 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
505 Vector v = (Vector)getField(cfg, field); | |
506 | |
507 if (v == null) { | |
508 v = new Vector(); | |
509 putFieldImpl(cfg, field, v); | |
510 } | |
511 | |
512 v.add(element); | |
513 } | |
514 | |
515 String expandFormat(String format) { | |
516 if (format == null) { | |
517 return null; | |
518 } | |
519 | |
520 if (format.indexOf('%') == -1) { | |
521 return format; | |
522 } | |
523 | |
524 StringBuffer sb = new StringBuffer(); | |
525 int len = format.length(); | |
526 for (int i=0; i<len; i++) { | |
527 char ch = format.charAt(i); | |
528 if (ch == '%') { | |
529 char ch1 = format.charAt(i+1); | |
530 switch (ch1) { | |
531 case '%': | |
532 sb.append(ch1); | |
533 break; | |
534 case 'b': | |
535 sb.append(build()); | |
536 break; | |
537 case 'f': | |
538 sb.append(flavour()); | |
539 break; | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
540 case 'o': |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
541 sb.append(outputDir()); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
542 break; |
0 | 543 default: |
544 sb.append(ch); | |
545 sb.append(ch1); | |
546 } | |
547 i++; | |
548 } else { | |
549 sb.append(ch); | |
550 } | |
551 } | |
552 | |
553 return sb.toString(); | |
554 } | |
555 } | |
556 | |
557 abstract class GenericDebugConfig extends BuildConfig { | |
558 abstract String getOptFlag(); | |
559 | |
560 protected void init(Vector includes, Vector defines) { | |
561 defines.add("_DEBUG"); | |
562 defines.add("ASSERT"); | |
563 | |
564 super.init(includes, defines); | |
565 | |
566 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
567 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
568 } | |
569 } | |
570 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
571 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
572 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
573 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
574 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
575 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
576 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
577 |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
578 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
|
579 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
|
580 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
|
581 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
582 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
583 GraalDebugConfig() { |
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", "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
|
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 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
589 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
|
590 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
|
591 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
|
592 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
593 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
594 GraalFastDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
595 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
|
596 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
|
597 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
598 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
599 |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
600 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 601 String getOptFlag() { |
602 return getCI().getNoOptFlag(); | |
603 } | |
604 | |
605 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
606 initNames("compiler1", "debug", "jvm.dll"); |
0 | 607 init(getIncludes(), getDefines()); |
608 } | |
609 } | |
610 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
611 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 612 String getOptFlag() { |
613 return getCI().getOptFlag(); | |
614 } | |
615 | |
616 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
617 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 618 init(getIncludes(), getDefines()); |
619 } | |
620 } | |
621 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
622 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 623 String getOptFlag() { |
624 return getCI().getNoOptFlag(); | |
625 } | |
626 | |
627 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
628 initNames("compiler2", "debug", "jvm.dll"); |
0 | 629 init(getIncludes(), getDefines()); |
630 } | |
631 } | |
632 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
633 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 634 String getOptFlag() { |
635 return getCI().getOptFlag(); | |
636 } | |
637 | |
638 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
639 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 640 init(getIncludes(), getDefines()); |
641 } | |
642 } | |
643 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
644 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 645 String getOptFlag() { |
646 return getCI().getNoOptFlag(); | |
647 } | |
648 | |
649 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
650 initNames("tiered", "debug", "jvm.dll"); |
0 | 651 init(getIncludes(), getDefines()); |
652 } | |
653 } | |
654 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
655 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 656 String getOptFlag() { |
657 return getCI().getOptFlag(); | |
658 } | |
659 | |
660 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
661 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 662 init(getIncludes(), getDefines()); |
663 } | |
664 } | |
665 | |
666 | |
667 abstract class ProductConfig extends BuildConfig { | |
668 protected void init(Vector includes, Vector defines) { | |
669 defines.add("NDEBUG"); | |
670 defines.add("PRODUCT"); | |
671 | |
672 super.init(includes, defines); | |
673 | |
674 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
675 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
676 } | |
677 } | |
678 | |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
679 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
|
680 GraalProductConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
681 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
|
682 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
|
683 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
684 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
685 |
0 | 686 class C1ProductConfig extends ProductConfig { |
687 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
688 initNames("compiler1", "product", "jvm.dll"); |
0 | 689 init(getIncludes(), getDefines()); |
690 } | |
691 } | |
692 | |
693 class C2ProductConfig extends ProductConfig { | |
694 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
695 initNames("compiler2", "product", "jvm.dll"); |
0 | 696 init(getIncludes(), getDefines()); |
697 } | |
698 } | |
699 | |
700 class TieredProductConfig extends ProductConfig { | |
701 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
702 initNames("tiered", "product", "jvm.dll"); |
0 | 703 init(getIncludes(), getDefines()); |
704 } | |
705 } | |
706 | |
707 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
708 class CoreDebugConfig extends GenericDebugNonKernelConfig { |
0 | 709 String getOptFlag() { |
710 return getCI().getNoOptFlag(); | |
711 } | |
712 | |
713 CoreDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
714 initNames("core", "debug", "jvm.dll"); |
0 | 715 init(getIncludes(), getDefines()); |
716 } | |
717 } | |
718 | |
719 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
720 class CoreFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 721 String getOptFlag() { |
722 return getCI().getOptFlag(); | |
723 } | |
724 | |
725 CoreFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
726 initNames("core", "fastdebug", "jvm.dll"); |
0 | 727 init(getIncludes(), getDefines()); |
728 } | |
729 } | |
730 | |
731 | |
732 class CoreProductConfig extends ProductConfig { | |
733 CoreProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
734 initNames("core", "product", "jvm.dll"); |
0 | 735 init(getIncludes(), getDefines()); |
736 } | |
737 } | |
738 | |
739 class KernelDebugConfig extends GenericDebugConfig { | |
740 String getOptFlag() { | |
741 return getCI().getNoOptFlag(); | |
742 } | |
743 | |
744 KernelDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
745 initNames("kernel", "debug", "jvm.dll"); |
0 | 746 init(getIncludes(), getDefines()); |
747 } | |
748 } | |
749 | |
750 | |
751 class KernelFastDebugConfig extends GenericDebugConfig { | |
752 String getOptFlag() { | |
753 return getCI().getOptFlag(); | |
754 } | |
755 | |
756 KernelFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
757 initNames("kernel", "fastdebug", "jvm.dll"); |
0 | 758 init(getIncludes(), getDefines()); |
759 } | |
760 } | |
761 | |
762 | |
763 class KernelProductConfig extends ProductConfig { | |
764 KernelProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
765 initNames("kernel", "product", "jvm.dll"); |
0 | 766 init(getIncludes(), getDefines()); |
767 } | |
768 } | |
769 abstract class CompilerInterface { | |
770 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
|
771 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 772 abstract Vector getDebugCompilerFlags(String opt); |
773 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
774 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 775 abstract Vector getProductCompilerFlags(); |
776 abstract Vector getProductLinkerFlags(); | |
777 abstract String getOptFlag(); | |
778 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
779 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 780 |
781 void addAttr(Vector receiver, String attr, String value) { | |
782 receiver.add(attr); receiver.add(value); | |
783 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
784 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
785 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
786 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
787 // 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
|
788 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
789 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
790 // 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
|
791 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
|
792 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
793 } |
0 | 794 } |