annotate src/share/tools/ProjectCreator/BuildConfig.java @ 2044:06f017f7daa7

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