annotate src/share/tools/ProjectCreator/BuildConfig.java @ 8821:6b748c9e1845

8010651: create.bat still builds the kernel Summary: Remove old kernel build targets and VS C++ projects created by create.bat on Windows Reviewed-by: coleenp, sla
author zgu
date Tue, 26 Mar 2013 14:11:21 -0400
parents 1a9b9cfcef41
children b9a918201d47 aabf54ccedb1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
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
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 class BuildConfig {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
30 @SuppressWarnings("rawtypes")
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 Hashtable vars;
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
32 Vector<String> basicNames, basicPaths;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33 String[] context;
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 static CompilerInterface ci;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 static CompilerInterface getCI() {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 if (ci == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 String comp = (String)getField(null, "CompilerVersion");
a61af66fc99e Initial load
duke
parents:
diff changeset
39 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
a61af66fc99e Initial load
duke
parents:
diff changeset
41 } catch (Exception cnfe) {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 System.err.println("Cannot find support for compiler " + comp);
a61af66fc99e Initial load
duke
parents:
diff changeset
43 throw new RuntimeException(cnfe.toString());
a61af66fc99e Initial load
duke
parents:
diff changeset
44 }
a61af66fc99e Initial load
duke
parents:
diff changeset
45 }
a61af66fc99e Initial load
duke
parents:
diff changeset
46 return ci;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 }
a61af66fc99e Initial load
duke
parents:
diff changeset
48
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
49 @SuppressWarnings("rawtypes")
0
a61af66fc99e Initial load
duke
parents:
diff changeset
50 protected void initNames(String flavour, String build, String outDll) {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 if (vars == null) vars = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
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
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
55 System.out.println();
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
56 System.out.println(flavourBuild);
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
59 put("Flavour", flavour);
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // ones mentioned above were needed to expand format
a61af66fc99e Initial load
duke
parents:
diff changeset
64 String buildBase = expandFormat(getFieldString(null, "BuildBase"));
a61af66fc99e Initial load
duke
parents:
diff changeset
65 String sourceBase = getFieldString(null, "SourceBase");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
66 String buildSpace = getFieldString(null, "BuildSpace");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
67 String outDir = buildBase;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 put("Id", flavourBuild);
a61af66fc99e Initial load
duke
parents:
diff changeset
70 put("OutputDir", outDir);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 put("SourceBase", sourceBase);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 put("BuildBase", buildBase);
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
73 put("BuildSpace", buildSpace);
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
74 put("OutputDll", outDir + Util.sep + outDll);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 context = new String [] {flavourBuild, flavour, build, null};
a61af66fc99e Initial load
duke
parents:
diff changeset
77 }
a61af66fc99e Initial load
duke
parents:
diff changeset
78
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
79 protected void init(Vector<String> includes, Vector<String> defines) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
80 initDefaultDefines(defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
81 initDefaultCompilerFlags(includes);
a61af66fc99e Initial load
duke
parents:
diff changeset
82 initDefaultLinkerFlags();
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
83 //handleDB();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
87 protected void initDefaultCompilerFlags(Vector<String> includes) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88 Vector compilerFlags = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
a61af66fc99e Initial load
duke
parents:
diff changeset
91 includes,
a61af66fc99e Initial load
duke
parents:
diff changeset
92 get("OutputDir")));
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 put("CompilerFlags", compilerFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
95 }
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 protected void initDefaultLinkerFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 Vector linkerFlags = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
99
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
100 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 put("LinkerFlags", linkerFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
105 public boolean matchesIgnoredPath(String path) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
106 Vector<String> rv = new Vector<String>();
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
107 collectRelevantVectors(rv, "IgnorePath");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
108 for (String pathPart : rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
109 if (path.contains(pathPart)) {
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
110 return true;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
111 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
112 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
113 return false;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
114 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
115
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
116 public boolean matchesHidePath(String path) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
117 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
118 collectRelevantVectors(rv, "HidePath");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
119 for (String pathPart : rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
120 if (path.contains(Util.normalize(pathPart))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
121 return true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
122 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
123 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
124 return false;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
125 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
126
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
127 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
128 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
129 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
130 if (v != null) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
131 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
132 String key = e.nextElement();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
133 String val = v.get(key);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
134
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
135 if (fullPath.endsWith(expandFormat(key))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
136 rv.add(expandFormat(val));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
140 return rv;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 void addTo(Hashtable ht, String key, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 ht.put(expandFormat(key), expandFormat(value));
a61af66fc99e Initial load
duke
parents:
diff changeset
145 }
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 void initDefaultDefines(Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 Vector sysDefines = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
149 sysDefines.add("WIN32");
a61af66fc99e Initial load
duke
parents:
diff changeset
150 sysDefines.add("_WINDOWS");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
151 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
152 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
153 sysDefines.add("INCLUDE_TRACE");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
154 sysDefines.add("_JNI_IMPLEMENTATION_");
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
155 if (vars.get("PlatformName").equals("Win32")) {
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
156 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
157 } else {
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
158 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
159 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 sysDefines.addAll(defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 put("Define", sysDefines);
a61af66fc99e Initial load
duke
parents:
diff changeset
164 }
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 String get(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 return (String)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 Vector getV(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 return (Vector)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 }
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 Object getO(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 return vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 Hashtable getH(String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
179 return (Hashtable)vars.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
180 }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 Object getFieldInContext(String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 for (int i=0; i<context.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 Object rv = getField(context[i], field);
a61af66fc99e Initial load
duke
parents:
diff changeset
185 if (rv != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 Object lookupHashFieldInContext(String field, String key) {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 for (int i=0; i<context.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
194 Hashtable ht = (Hashtable)getField(context[i], field);
a61af66fc99e Initial load
duke
parents:
diff changeset
195 if (ht != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 Object rv = ht.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 if (rv != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201 }
a61af66fc99e Initial load
duke
parents:
diff changeset
202 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
203 }
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205 void put(String key, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
206 vars.put(key, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 }
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 void put(String key, Vector vvalue) {
a61af66fc99e Initial load
duke
parents:
diff changeset
210 vars.put(key, vvalue);
a61af66fc99e Initial load
duke
parents:
diff changeset
211 }
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 void add(String key, Vector vvalue) {
a61af66fc99e Initial load
duke
parents:
diff changeset
214 getV(key).addAll(vvalue);
a61af66fc99e Initial load
duke
parents:
diff changeset
215 }
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 String flavour() {
a61af66fc99e Initial load
duke
parents:
diff changeset
218 return get("Flavour");
a61af66fc99e Initial load
duke
parents:
diff changeset
219 }
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 String build() {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 return get("Build");
a61af66fc99e Initial load
duke
parents:
diff changeset
223 }
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 Object getSpecificField(String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 return getField(get("Id"), field);
a61af66fc99e Initial load
duke
parents:
diff changeset
227 }
a61af66fc99e Initial load
duke
parents:
diff changeset
228
a61af66fc99e Initial load
duke
parents:
diff changeset
229 void putSpecificField(String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 putField(get("Id"), field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 }
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 void collectRelevantVectors(Vector rv, String field) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
234 for (String ctx : context) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
235 Vector<String> v = getFieldVector(ctx, field);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
236 if (v != null) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
237 for (String val : v) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
238 rv.add(expandFormat(val).replace('/', '\\'));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 void collectRelevantHashes(Hashtable rv, String field) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
245 for (String ctx : context) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
246 Hashtable v = (Hashtable)getField(ctx, field);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
247 if (v != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 String key = (String)e.nextElement();
a61af66fc99e Initial load
duke
parents:
diff changeset
250 String val = (String)v.get(key);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 addTo(rv, key, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 }
a61af66fc99e Initial load
duke
parents:
diff changeset
253 }
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 Vector getDefines() {
a61af66fc99e Initial load
duke
parents:
diff changeset
259 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
260 collectRelevantVectors(rv, "Define");
a61af66fc99e Initial load
duke
parents:
diff changeset
261 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
262 }
a61af66fc99e Initial load
duke
parents:
diff changeset
263
a61af66fc99e Initial load
duke
parents:
diff changeset
264 Vector getIncludes() {
a61af66fc99e Initial load
duke
parents:
diff changeset
265 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
266 collectRelevantVectors(rv, "AbsoluteInclude");
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
267 rv.addAll(getSourceIncludes());
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
268 return rv;
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
269 }
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
270
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
271 private Vector getSourceIncludes() {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
272 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
273 Vector<String> ri = new Vector<String>();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
274 String sourceBase = getFieldString(null, "SourceBase");
a61af66fc99e Initial load
duke
parents:
diff changeset
275 collectRelevantVectors(ri, "RelativeInclude");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
276 for (String f : ri) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
277 rv.add(sourceBase + Util.sep + f);
a61af66fc99e Initial load
duke
parents:
diff changeset
278 }
a61af66fc99e Initial load
duke
parents:
diff changeset
279 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 static Hashtable cfgData = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
283 static Hashtable globalData = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
284
a61af66fc99e Initial load
duke
parents:
diff changeset
285 static boolean appliesToTieredBuild(String cfg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
286 return (cfg != null &&
a61af66fc99e Initial load
duke
parents:
diff changeset
287 (cfg.startsWith("compiler1") ||
a61af66fc99e Initial load
duke
parents:
diff changeset
288 cfg.startsWith("compiler2")));
a61af66fc99e Initial load
duke
parents:
diff changeset
289 }
a61af66fc99e Initial load
duke
parents:
diff changeset
290
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
291 // Filters out the IgnoreFile and IgnorePaths since they are
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
292 // handled specially for tiered builds.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
293 static boolean appliesToTieredBuild(String cfg, String key) {
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
294 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
295 }
a61af66fc99e Initial load
duke
parents:
diff changeset
296
a61af66fc99e Initial load
duke
parents:
diff changeset
297 static String getTieredBuildCfg(String cfg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
298 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
a61af66fc99e Initial load
duke
parents:
diff changeset
299 return "tiered" + cfg.substring(9);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 }
a61af66fc99e Initial load
duke
parents:
diff changeset
301
a61af66fc99e Initial load
duke
parents:
diff changeset
302 static Object getField(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
303 if (cfg == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
304 return globalData.get(field);
a61af66fc99e Initial load
duke
parents:
diff changeset
305 }
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 Hashtable ht = (Hashtable)cfgData.get(cfg);
a61af66fc99e Initial load
duke
parents:
diff changeset
308 return ht == null ? null : ht.get(field);
a61af66fc99e Initial load
duke
parents:
diff changeset
309 }
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 static String getFieldString(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 return (String)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
313 }
a61af66fc99e Initial load
duke
parents:
diff changeset
314
a61af66fc99e Initial load
duke
parents:
diff changeset
315 static Vector getFieldVector(String cfg, String field) {
a61af66fc99e Initial load
duke
parents:
diff changeset
316 return (Vector)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
317 }
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 static void putField(String cfg, String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
320 putFieldImpl(cfg, field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
321 if (appliesToTieredBuild(cfg, field)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
322 putFieldImpl(getTieredBuildCfg(cfg), field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
323 }
a61af66fc99e Initial load
duke
parents:
diff changeset
324 }
a61af66fc99e Initial load
duke
parents:
diff changeset
325
a61af66fc99e Initial load
duke
parents:
diff changeset
326 private static void putFieldImpl(String cfg, String field, Object value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
327 if (cfg == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
328 globalData.put(field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
329 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
330 }
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 Hashtable ht = (Hashtable)cfgData.get(cfg);
a61af66fc99e Initial load
duke
parents:
diff changeset
333 if (ht == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
334 ht = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
335 cfgData.put(cfg, ht);
a61af66fc99e Initial load
duke
parents:
diff changeset
336 }
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338 ht.put(field, value);
a61af66fc99e Initial load
duke
parents:
diff changeset
339 }
a61af66fc99e Initial load
duke
parents:
diff changeset
340
a61af66fc99e Initial load
duke
parents:
diff changeset
341 static Object getFieldHash(String cfg, String field, String name) {
a61af66fc99e Initial load
duke
parents:
diff changeset
342 Hashtable ht = (Hashtable)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
343
a61af66fc99e Initial load
duke
parents:
diff changeset
344 return ht == null ? null : ht.get(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
345 }
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 static void putFieldHash(String cfg, String field, String name, Object val) {
a61af66fc99e Initial load
duke
parents:
diff changeset
348 putFieldHashImpl(cfg, field, name, val);
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
349 if (appliesToTieredBuild(cfg, field)) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
350 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
351 }
a61af66fc99e Initial load
duke
parents:
diff changeset
352 }
a61af66fc99e Initial load
duke
parents:
diff changeset
353
a61af66fc99e Initial load
duke
parents:
diff changeset
354 private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
a61af66fc99e Initial load
duke
parents:
diff changeset
355 Hashtable ht = (Hashtable)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
356
a61af66fc99e Initial load
duke
parents:
diff changeset
357 if (ht == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
358 ht = new Hashtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
359 putFieldImpl(cfg, field, ht);
a61af66fc99e Initial load
duke
parents:
diff changeset
360 }
a61af66fc99e Initial load
duke
parents:
diff changeset
361
a61af66fc99e Initial load
duke
parents:
diff changeset
362 ht.put(name, val);
a61af66fc99e Initial load
duke
parents:
diff changeset
363 }
a61af66fc99e Initial load
duke
parents:
diff changeset
364
a61af66fc99e Initial load
duke
parents:
diff changeset
365 static void addFieldVector(String cfg, String field, String element) {
a61af66fc99e Initial load
duke
parents:
diff changeset
366 addFieldVectorImpl(cfg, field, element);
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
367 if (appliesToTieredBuild(cfg, field)) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
368 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
a61af66fc99e Initial load
duke
parents:
diff changeset
369 }
a61af66fc99e Initial load
duke
parents:
diff changeset
370 }
a61af66fc99e Initial load
duke
parents:
diff changeset
371
a61af66fc99e Initial load
duke
parents:
diff changeset
372 private static void addFieldVectorImpl(String cfg, String field, String element) {
a61af66fc99e Initial load
duke
parents:
diff changeset
373 Vector v = (Vector)getField(cfg, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
374
a61af66fc99e Initial load
duke
parents:
diff changeset
375 if (v == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
376 v = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
377 putFieldImpl(cfg, field, v);
a61af66fc99e Initial load
duke
parents:
diff changeset
378 }
a61af66fc99e Initial load
duke
parents:
diff changeset
379
a61af66fc99e Initial load
duke
parents:
diff changeset
380 v.add(element);
a61af66fc99e Initial load
duke
parents:
diff changeset
381 }
a61af66fc99e Initial load
duke
parents:
diff changeset
382
a61af66fc99e Initial load
duke
parents:
diff changeset
383 String expandFormat(String format) {
a61af66fc99e Initial load
duke
parents:
diff changeset
384 if (format == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
385 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
386 }
a61af66fc99e Initial load
duke
parents:
diff changeset
387
a61af66fc99e Initial load
duke
parents:
diff changeset
388 if (format.indexOf('%') == -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
389 return format;
a61af66fc99e Initial load
duke
parents:
diff changeset
390 }
a61af66fc99e Initial load
duke
parents:
diff changeset
391
a61af66fc99e Initial load
duke
parents:
diff changeset
392 StringBuffer sb = new StringBuffer();
a61af66fc99e Initial load
duke
parents:
diff changeset
393 int len = format.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
394 for (int i=0; i<len; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
395 char ch = format.charAt(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
396 if (ch == '%') {
a61af66fc99e Initial load
duke
parents:
diff changeset
397 char ch1 = format.charAt(i+1);
a61af66fc99e Initial load
duke
parents:
diff changeset
398 switch (ch1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
399 case '%':
a61af66fc99e Initial load
duke
parents:
diff changeset
400 sb.append(ch1);
a61af66fc99e Initial load
duke
parents:
diff changeset
401 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
402 case 'b':
a61af66fc99e Initial load
duke
parents:
diff changeset
403 sb.append(build());
a61af66fc99e Initial load
duke
parents:
diff changeset
404 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
405 case 'f':
a61af66fc99e Initial load
duke
parents:
diff changeset
406 sb.append(flavour());
a61af66fc99e Initial load
duke
parents:
diff changeset
407 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
408 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
409 sb.append(ch);
a61af66fc99e Initial load
duke
parents:
diff changeset
410 sb.append(ch1);
a61af66fc99e Initial load
duke
parents:
diff changeset
411 }
a61af66fc99e Initial load
duke
parents:
diff changeset
412 i++;
a61af66fc99e Initial load
duke
parents:
diff changeset
413 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
414 sb.append(ch);
a61af66fc99e Initial load
duke
parents:
diff changeset
415 }
a61af66fc99e Initial load
duke
parents:
diff changeset
416 }
a61af66fc99e Initial load
duke
parents:
diff changeset
417
a61af66fc99e Initial load
duke
parents:
diff changeset
418 return sb.toString();
a61af66fc99e Initial load
duke
parents:
diff changeset
419 }
a61af66fc99e Initial load
duke
parents:
diff changeset
420 }
a61af66fc99e Initial load
duke
parents:
diff changeset
421
a61af66fc99e Initial load
duke
parents:
diff changeset
422 abstract class GenericDebugConfig extends BuildConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
423 abstract String getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
424
a61af66fc99e Initial load
duke
parents:
diff changeset
425 protected void init(Vector includes, Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
426 defines.add("_DEBUG");
a61af66fc99e Initial load
duke
parents:
diff changeset
427 defines.add("ASSERT");
a61af66fc99e Initial load
duke
parents:
diff changeset
428
a61af66fc99e Initial load
duke
parents:
diff changeset
429 super.init(includes, defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
430
a61af66fc99e Initial load
duke
parents:
diff changeset
431 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag()));
a61af66fc99e Initial load
duke
parents:
diff changeset
432 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
433 }
a61af66fc99e Initial load
duke
parents:
diff changeset
434 }
a61af66fc99e Initial load
duke
parents:
diff changeset
435
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
436 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
437 protected void init(Vector includes, Vector defines) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
438 super.init(includes, defines);
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
439 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
440 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
441 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
442
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
443 class C1DebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
444 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
445 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
446 }
a61af66fc99e Initial load
duke
parents:
diff changeset
447
a61af66fc99e Initial load
duke
parents:
diff changeset
448 C1DebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
449 initNames("compiler1", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
450 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
451 }
a61af66fc99e Initial load
duke
parents:
diff changeset
452 }
a61af66fc99e Initial load
duke
parents:
diff changeset
453
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
454 class C1FastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
455 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
456 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
457 }
a61af66fc99e Initial load
duke
parents:
diff changeset
458
a61af66fc99e Initial load
duke
parents:
diff changeset
459 C1FastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
460 initNames("compiler1", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
461 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
462 }
a61af66fc99e Initial load
duke
parents:
diff changeset
463 }
a61af66fc99e Initial load
duke
parents:
diff changeset
464
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
465 class C2DebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
466 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
467 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
468 }
a61af66fc99e Initial load
duke
parents:
diff changeset
469
a61af66fc99e Initial load
duke
parents:
diff changeset
470 C2DebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
471 initNames("compiler2", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
472 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
473 }
a61af66fc99e Initial load
duke
parents:
diff changeset
474 }
a61af66fc99e Initial load
duke
parents:
diff changeset
475
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
476 class C2FastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
477 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
478 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
479 }
a61af66fc99e Initial load
duke
parents:
diff changeset
480
a61af66fc99e Initial load
duke
parents:
diff changeset
481 C2FastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
482 initNames("compiler2", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
483 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
484 }
a61af66fc99e Initial load
duke
parents:
diff changeset
485 }
a61af66fc99e Initial load
duke
parents:
diff changeset
486
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
487 class TieredDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
488 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
489 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
490 }
a61af66fc99e Initial load
duke
parents:
diff changeset
491
a61af66fc99e Initial load
duke
parents:
diff changeset
492 TieredDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
493 initNames("tiered", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
494 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
495 }
a61af66fc99e Initial load
duke
parents:
diff changeset
496 }
a61af66fc99e Initial load
duke
parents:
diff changeset
497
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
498 class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
499 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
500 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
501 }
a61af66fc99e Initial load
duke
parents:
diff changeset
502
a61af66fc99e Initial load
duke
parents:
diff changeset
503 TieredFastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
504 initNames("tiered", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
505 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
506 }
a61af66fc99e Initial load
duke
parents:
diff changeset
507 }
a61af66fc99e Initial load
duke
parents:
diff changeset
508
a61af66fc99e Initial load
duke
parents:
diff changeset
509 abstract class ProductConfig extends BuildConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
510 protected void init(Vector includes, Vector defines) {
a61af66fc99e Initial load
duke
parents:
diff changeset
511 defines.add("NDEBUG");
a61af66fc99e Initial load
duke
parents:
diff changeset
512 defines.add("PRODUCT");
a61af66fc99e Initial load
duke
parents:
diff changeset
513
a61af66fc99e Initial load
duke
parents:
diff changeset
514 super.init(includes, defines);
a61af66fc99e Initial load
duke
parents:
diff changeset
515
a61af66fc99e Initial load
duke
parents:
diff changeset
516 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
517 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
a61af66fc99e Initial load
duke
parents:
diff changeset
518 }
a61af66fc99e Initial load
duke
parents:
diff changeset
519 }
a61af66fc99e Initial load
duke
parents:
diff changeset
520
a61af66fc99e Initial load
duke
parents:
diff changeset
521 class C1ProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
522 C1ProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
523 initNames("compiler1", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
524 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
525 }
a61af66fc99e Initial load
duke
parents:
diff changeset
526 }
a61af66fc99e Initial load
duke
parents:
diff changeset
527
a61af66fc99e Initial load
duke
parents:
diff changeset
528 class C2ProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
529 C2ProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
530 initNames("compiler2", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
531 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
532 }
a61af66fc99e Initial load
duke
parents:
diff changeset
533 }
a61af66fc99e Initial load
duke
parents:
diff changeset
534
a61af66fc99e Initial load
duke
parents:
diff changeset
535 class TieredProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
536 TieredProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
537 initNames("tiered", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
538 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
539 }
a61af66fc99e Initial load
duke
parents:
diff changeset
540 }
a61af66fc99e Initial load
duke
parents:
diff changeset
541
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
542 class CoreDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
543 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
544 return getCI().getNoOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
545 }
a61af66fc99e Initial load
duke
parents:
diff changeset
546
a61af66fc99e Initial load
duke
parents:
diff changeset
547 CoreDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
548 initNames("core", "debug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
549 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
550 }
a61af66fc99e Initial load
duke
parents:
diff changeset
551 }
a61af66fc99e Initial load
duke
parents:
diff changeset
552
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
553 class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
554 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
555 return getCI().getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
556 }
a61af66fc99e Initial load
duke
parents:
diff changeset
557
a61af66fc99e Initial load
duke
parents:
diff changeset
558 CoreFastDebugConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
559 initNames("core", "fastdebug", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
560 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
561 }
a61af66fc99e Initial load
duke
parents:
diff changeset
562 }
a61af66fc99e Initial load
duke
parents:
diff changeset
563
a61af66fc99e Initial load
duke
parents:
diff changeset
564 class CoreProductConfig extends ProductConfig {
a61af66fc99e Initial load
duke
parents:
diff changeset
565 CoreProductConfig() {
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
566 initNames("core", "product", "jvm.dll");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
567 init(getIncludes(), getDefines());
a61af66fc99e Initial load
duke
parents:
diff changeset
568 }
a61af66fc99e Initial load
duke
parents:
diff changeset
569 }
a61af66fc99e Initial load
duke
parents:
diff changeset
570
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 4878
diff changeset
571
0
a61af66fc99e Initial load
duke
parents:
diff changeset
572 abstract class CompilerInterface {
a61af66fc99e Initial load
duke
parents:
diff changeset
573 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
574 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
575 abstract Vector getDebugCompilerFlags(String opt);
a61af66fc99e Initial load
duke
parents:
diff changeset
576 abstract Vector getDebugLinkerFlags();
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
577 abstract void getAdditionalNonKernelLinkerFlags(Vector rv);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
578 abstract Vector getProductCompilerFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
579 abstract Vector getProductLinkerFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
580 abstract String getOptFlag();
a61af66fc99e Initial load
duke
parents:
diff changeset
581 abstract String getNoOptFlag();
2233
15d6977f04b0 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 2027
diff changeset
582 abstract String makeCfgName(String flavourBuild, String platformName);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
583
a61af66fc99e Initial load
duke
parents:
diff changeset
584 void addAttr(Vector receiver, String attr, String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
585 receiver.add(attr); receiver.add(value);
a61af66fc99e Initial load
duke
parents:
diff changeset
586 }
2027
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
587 void extAttr(Vector receiver, String attr, String value) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
588 int attr_pos=receiver.indexOf(attr) ;
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
589 if ( attr_pos == -1) {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
590 // 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
591 receiver.add(attr); receiver.add(value);
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
592 } else {
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
593 // 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
594 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
595 }
aa6e219afbf1 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 1972
diff changeset
596 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
597 }