annotate src/share/tools/ProjectCreator/BuildConfig.java @ 4970:33df1aeaebbf

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