Mercurial > hg > truffle
annotate src/share/tools/ProjectCreator/BuildConfig.java @ 21231:0bb06deee33b
Check for null in LabelOp#setIncomingValues and JumpOp#setOutgoingValues.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 05 May 2015 12:12:33 +0200 |
parents | 2a69cbe850a8 |
children | da7e30544879 |
rev | line source |
---|---|
0 | 1 /* |
10405 | 2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
844
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
25 import java.util.Enumeration; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
26 import java.util.Hashtable; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
27 import java.util.Vector; |
0 | 28 |
29 class BuildConfig { | |
6801 | 30 @SuppressWarnings("rawtypes") |
0 | 31 Hashtable vars; |
6801 | 32 Vector<String> basicNames, basicPaths; |
0 | 33 String[] context; |
34 | |
35 static CompilerInterface ci; | |
36 static CompilerInterface getCI() { | |
37 if (ci == null) { | |
38 String comp = (String)getField(null, "CompilerVersion"); | |
39 try { | |
40 ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance(); | |
41 } catch (Exception cnfe) { | |
42 System.err.println("Cannot find support for compiler " + comp); | |
43 throw new RuntimeException(cnfe.toString()); | |
44 } | |
45 } | |
46 return ci; | |
47 } | |
48 | |
6801 | 49 @SuppressWarnings("rawtypes") |
0 | 50 protected void initNames(String flavour, String build, String outDll) { |
51 if (vars == null) vars = new Hashtable(); | |
52 | |
53 String flavourBuild = flavour + "_" + build; | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
54 String platformName = getFieldString(null, "PlatformName"); |
1972 | 55 System.out.println(); |
56 System.out.println(flavourBuild); | |
57 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
58 put("Name", getCI().makeCfgName(flavourBuild, platformName)); |
0 | 59 put("Flavour", flavour); |
60 put("Build", build); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
61 put("PlatformName", platformName); |
0 | 62 |
63 // ones mentioned above were needed to expand format | |
64 String buildBase = expandFormat(getFieldString(null, "BuildBase")); | |
65 String sourceBase = getFieldString(null, "SourceBase"); | |
6801 | 66 String buildSpace = getFieldString(null, "BuildSpace"); |
0 | 67 String outDir = buildBase; |
10277 | 68 String jdkTargetRoot = getFieldString(null, "JdkTargetRoot"); |
0 | 69 |
10510
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
70 String value = System.getenv("OUT_DIR"); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
71 if (value != null) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
72 outDir = value; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
73 int lastDirectorySeparator = Math.max(outDir.lastIndexOf("/"), outDir.lastIndexOf("\\")); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
74 if (lastDirectorySeparator >= 0) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
75 outDir = outDir.substring(0, lastDirectorySeparator); |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
76 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
77 outDir += Util.sep + build + Util.sep + "jre" + Util.sep + "bin"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
78 if (flavour.equals("graal")) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
79 outDir += Util.sep + "graal"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
80 } else if (flavour.equals("compiler1")) { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
81 outDir += Util.sep + "client"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
82 } else { |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
83 outDir += Util.sep + "server"; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
84 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
85 buildBase = outDir; |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
86 } |
f40010b67b6e
fix windows build directory
Andreas Woess <andreas.woess@jku.at>
parents:
10408
diff
changeset
|
87 |
0 | 88 put("Id", flavourBuild); |
89 put("OutputDir", outDir); | |
90 put("SourceBase", sourceBase); | |
91 put("BuildBase", buildBase); | |
6801 | 92 put("BuildSpace", buildSpace); |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
93 put("OutputDll", outDir + Util.sep + outDll); |
10277 | 94 put("JdkTargetRoot", jdkTargetRoot); |
0 | 95 |
96 context = new String [] {flavourBuild, flavour, build, null}; | |
97 } | |
98 | |
6801 | 99 protected void init(Vector<String> includes, Vector<String> defines) { |
0 | 100 initDefaultDefines(defines); |
101 initDefaultCompilerFlags(includes); | |
102 initDefaultLinkerFlags(); | |
6801 | 103 //handleDB(); |
0 | 104 } |
105 | |
106 | |
6801 | 107 protected void initDefaultCompilerFlags(Vector<String> includes) { |
0 | 108 Vector compilerFlags = new Vector(); |
109 | |
110 compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"), | |
111 includes, | |
112 get("OutputDir"))); | |
113 | |
114 put("CompilerFlags", compilerFlags); | |
115 } | |
116 | |
117 protected void initDefaultLinkerFlags() { | |
118 Vector linkerFlags = new Vector(); | |
119 | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
120 linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); |
0 | 121 |
122 put("LinkerFlags", linkerFlags); | |
123 } | |
124 | |
6801 | 125 public boolean matchesIgnoredPath(String path) { |
126 Vector<String> rv = new Vector<String>(); | |
1972 | 127 collectRelevantVectors(rv, "IgnorePath"); |
6801 | 128 for (String pathPart : rv) { |
129 if (path.contains(pathPart)) { | |
1972 | 130 return true; |
131 } | |
132 } | |
133 return false; | |
134 } | |
135 | |
6801 | 136 public boolean matchesHidePath(String path) { |
137 Vector<String> rv = new Vector<String>(); | |
138 collectRelevantVectors(rv, "HidePath"); | |
139 for (String pathPart : rv) { | |
140 if (path.contains(Util.normalize(pathPart))) { | |
141 return true; | |
142 } | |
143 } | |
144 return false; | |
145 } | |
146 | |
147 public Vector<String> matchesAdditionalGeneratedPath(String fullPath) { | |
148 Vector<String> rv = new Vector<String>(); | |
149 Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile"); | |
150 if (v != null) { | |
151 for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) { | |
152 String key = e.nextElement(); | |
153 String val = v.get(key); | |
154 | |
155 if (fullPath.endsWith(expandFormat(key))) { | |
156 rv.add(expandFormat(val)); | |
0 | 157 } |
158 } | |
159 } | |
6801 | 160 return rv; |
0 | 161 } |
162 | |
12014
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
163 // Returns true if the specified path refers to a relative alternate |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
164 // source file. RelativeAltSrcInclude is usually "src\closed". |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
165 public static boolean matchesRelativeAltSrcInclude(String path) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
166 String relativeAltSrcInclude = |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
167 getFieldString(null, "RelativeAltSrcInclude"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
168 Vector<String> v = getFieldVector(null, "AltRelativeInclude"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
169 for (String pathPart : v) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
170 if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
171 return true; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
172 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
173 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
174 return false; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
175 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
176 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
177 // Returns the relative alternate source file for the specified path. |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
178 // Null is returned if the specified path does not have a matching |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
179 // alternate source file. |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
180 public static String getMatchingRelativeAltSrcFile(String path) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
181 Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
182 if (v == null) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
183 return null; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
184 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
185 for (String pathPart : v) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
186 if (path.endsWith(pathPart)) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
187 String relativeAltSrcInclude = |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
188 getFieldString(null, "RelativeAltSrcInclude"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
189 return relativeAltSrcInclude + Util.sep + pathPart; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
190 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
191 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
192 return null; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
193 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
194 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
195 // Returns true if the specified path has a matching alternate |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
196 // source file. |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
197 public static boolean matchesRelativeAltSrcFile(String path) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
198 return getMatchingRelativeAltSrcFile(path) != null; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
199 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
200 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
201 // Track the specified alternate source file. The source file is |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
202 // tracked without the leading .*<sep><RelativeAltSrcFileList><sep> |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
203 // part to make matching regular source files easier. |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
204 public static void trackRelativeAltSrcFile(String path) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
205 String pattern = getFieldString(null, "RelativeAltSrcInclude") + |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
206 Util.sep; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
207 int altSrcInd = path.indexOf(pattern); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
208 if (altSrcInd == -1) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
209 // not an AltSrc path |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
210 return; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
211 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
212 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
213 altSrcInd += pattern.length(); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
214 if (altSrcInd >= path.length()) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
215 // not a valid AltSrc path |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
216 return; |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
217 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
218 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
219 String altSrcFile = path.substring(altSrcInd); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
220 Vector v = getFieldVector(null, "RelativeAltSrcFileList"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
221 if (v == null || !v.contains(altSrcFile)) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
222 addFieldVector(null, "RelativeAltSrcFileList", altSrcFile); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
223 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
224 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
225 |
0 | 226 void addTo(Hashtable ht, String key, String value) { |
227 ht.put(expandFormat(key), expandFormat(value)); | |
228 } | |
229 | |
230 void initDefaultDefines(Vector defines) { | |
231 Vector sysDefines = new Vector(); | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
232 |
2273 | 233 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
|
234 sysDefines.add("WIN32"); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
235 } else { |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
236 sysDefines.add("_AMD64_"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
237 sysDefines.add("AMD64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
238 sysDefines.add("_WIN64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
239 sysDefines.add("_LP64"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
240 if (System.getenv("MSC_VER") != null) |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
241 sysDefines.add("MSC_VER=" + System.getenv("MSC_VER")); |
1408
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
242 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
0ba67bb5392c
added c1x build directory, added MSVC Win64 project support
lstadler
parents:
844
diff
changeset
|
243 } |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
244 |
0 | 245 sysDefines.add("_WINDOWS"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
246 sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); |
0 | 247 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); |
10405 | 248 sysDefines.add("INCLUDE_TRACE=1"); |
0 | 249 sysDefines.add("_JNI_IMPLEMENTATION_"); |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
250 if (vars.get("PlatformName").equals("Win32")) { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
251 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
252 } else { |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
253 sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); |
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
254 } |
0 | 255 |
256 sysDefines.addAll(defines); | |
257 | |
258 put("Define", sysDefines); | |
259 } | |
260 | |
261 String get(String key) { | |
262 return (String)vars.get(key); | |
263 } | |
264 | |
265 Vector getV(String key) { | |
266 return (Vector)vars.get(key); | |
267 } | |
268 | |
269 Object getO(String key) { | |
270 return vars.get(key); | |
271 } | |
272 | |
273 Hashtable getH(String key) { | |
274 return (Hashtable)vars.get(key); | |
275 } | |
276 | |
277 Object getFieldInContext(String field) { | |
278 for (int i=0; i<context.length; i++) { | |
279 Object rv = getField(context[i], field); | |
280 if (rv != null) { | |
281 return rv; | |
282 } | |
283 } | |
284 return null; | |
285 } | |
286 | |
287 Object lookupHashFieldInContext(String field, String key) { | |
288 for (int i=0; i<context.length; i++) { | |
289 Hashtable ht = (Hashtable)getField(context[i], field); | |
290 if (ht != null) { | |
291 Object rv = ht.get(key); | |
292 if (rv != null) { | |
293 return rv; | |
294 } | |
295 } | |
296 } | |
297 return null; | |
298 } | |
299 | |
300 void put(String key, String value) { | |
301 vars.put(key, value); | |
302 } | |
303 | |
304 void put(String key, Vector vvalue) { | |
305 vars.put(key, vvalue); | |
306 } | |
307 | |
308 void add(String key, Vector vvalue) { | |
309 getV(key).addAll(vvalue); | |
310 } | |
311 | |
312 String flavour() { | |
313 return get("Flavour"); | |
314 } | |
315 | |
316 String build() { | |
317 return get("Build"); | |
318 } | |
319 | |
2184
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
320 String outputDir() { |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
321 return get("OutputDir"); |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
322 } |
5d801e6b9a80
Imported build system changes from other repository.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2044
diff
changeset
|
323 |
0 | 324 Object getSpecificField(String field) { |
325 return getField(get("Id"), field); | |
326 } | |
327 | |
328 void putSpecificField(String field, Object value) { | |
329 putField(get("Id"), field, value); | |
330 } | |
331 | |
332 void collectRelevantVectors(Vector rv, String field) { | |
6801 | 333 for (String ctx : context) { |
334 Vector<String> v = getFieldVector(ctx, field); | |
0 | 335 if (v != null) { |
6801 | 336 for (String val : v) { |
337 rv.add(expandFormat(val).replace('/', '\\')); | |
0 | 338 } |
339 } | |
340 } | |
341 } | |
342 | |
343 void collectRelevantHashes(Hashtable rv, String field) { | |
6801 | 344 for (String ctx : context) { |
345 Hashtable v = (Hashtable)getField(ctx, field); | |
0 | 346 if (v != null) { |
347 for (Enumeration e=v.keys(); e.hasMoreElements(); ) { | |
348 String key = (String)e.nextElement(); | |
349 String val = (String)v.get(key); | |
350 addTo(rv, key, val); | |
351 } | |
352 } | |
353 } | |
354 } | |
355 | |
356 | |
357 Vector getDefines() { | |
358 Vector rv = new Vector(); | |
359 collectRelevantVectors(rv, "Define"); | |
360 return rv; | |
361 } | |
362 | |
363 Vector getIncludes() { | |
364 Vector rv = new Vector(); | |
365 collectRelevantVectors(rv, "AbsoluteInclude"); | |
1972 | 366 rv.addAll(getSourceIncludes()); |
367 return rv; | |
368 } | |
369 | |
370 private Vector getSourceIncludes() { | |
6801 | 371 Vector<String> rv = new Vector<String>(); |
12014
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
372 String sourceBase = getFieldString(null, "SourceBase"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
373 |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
374 // add relative alternate source include values: |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
375 String relativeAltSrcInclude = |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
376 getFieldString(null, "RelativeAltSrcInclude"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
377 Vector<String> asri = new Vector<String>(); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
378 collectRelevantVectors(asri, "AltRelativeInclude"); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
379 for (String f : asri) { |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
380 rv.add(sourceBase + Util.sep + relativeAltSrcInclude + |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
381 Util.sep + f); |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
382 } |
31f3b1e1c5e5
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents:
10405
diff
changeset
|
383 |
6801 | 384 Vector<String> ri = new Vector<String>(); |
0 | 385 collectRelevantVectors(ri, "RelativeInclude"); |
6801 | 386 for (String f : ri) { |
0 | 387 rv.add(sourceBase + Util.sep + f); |
388 } | |
389 return rv; | |
390 } | |
391 | |
392 static Hashtable cfgData = new Hashtable(); | |
393 static Hashtable globalData = new Hashtable(); | |
394 | |
395 static boolean appliesToTieredBuild(String cfg) { | |
396 return (cfg != null && | |
397 (cfg.startsWith("compiler1") || | |
398 cfg.startsWith("compiler2"))); | |
399 } | |
400 | |
1972 | 401 // Filters out the IgnoreFile and IgnorePaths since they are |
402 // handled specially for tiered builds. | |
0 | 403 static boolean appliesToTieredBuild(String cfg, String key) { |
1972 | 404 return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); |
0 | 405 } |
406 | |
407 static String getTieredBuildCfg(String cfg) { | |
408 assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg; | |
409 return "tiered" + cfg.substring(9); | |
410 } | |
411 | |
412 static Object getField(String cfg, String field) { | |
413 if (cfg == null) { | |
414 return globalData.get(field); | |
415 } | |
416 | |
417 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
418 return ht == null ? null : ht.get(field); | |
419 } | |
420 | |
421 static String getFieldString(String cfg, String field) { | |
422 return (String)getField(cfg, field); | |
423 } | |
424 | |
425 static Vector getFieldVector(String cfg, String field) { | |
426 return (Vector)getField(cfg, field); | |
427 } | |
428 | |
429 static void putField(String cfg, String field, Object value) { | |
430 putFieldImpl(cfg, field, value); | |
431 if (appliesToTieredBuild(cfg, field)) { | |
432 putFieldImpl(getTieredBuildCfg(cfg), field, value); | |
433 } | |
434 } | |
435 | |
436 private static void putFieldImpl(String cfg, String field, Object value) { | |
437 if (cfg == null) { | |
438 globalData.put(field, value); | |
439 return; | |
440 } | |
441 | |
442 Hashtable ht = (Hashtable)cfgData.get(cfg); | |
443 if (ht == null) { | |
444 ht = new Hashtable(); | |
445 cfgData.put(cfg, ht); | |
446 } | |
447 | |
448 ht.put(field, value); | |
449 } | |
450 | |
451 static Object getFieldHash(String cfg, String field, String name) { | |
452 Hashtable ht = (Hashtable)getField(cfg, field); | |
453 | |
454 return ht == null ? null : ht.get(name); | |
455 } | |
456 | |
457 static void putFieldHash(String cfg, String field, String name, Object val) { | |
458 putFieldHashImpl(cfg, field, name, val); | |
1972 | 459 if (appliesToTieredBuild(cfg, field)) { |
0 | 460 putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); |
461 } | |
462 } | |
463 | |
464 private static void putFieldHashImpl(String cfg, String field, String name, Object val) { | |
465 Hashtable ht = (Hashtable)getField(cfg, field); | |
466 | |
467 if (ht == null) { | |
468 ht = new Hashtable(); | |
469 putFieldImpl(cfg, field, ht); | |
470 } | |
471 | |
472 ht.put(name, val); | |
473 } | |
474 | |
475 static void addFieldVector(String cfg, String field, String element) { | |
476 addFieldVectorImpl(cfg, field, element); | |
1972 | 477 if (appliesToTieredBuild(cfg, field)) { |
0 | 478 addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); |
479 } | |
480 } | |
481 | |
482 private static void addFieldVectorImpl(String cfg, String field, String element) { | |
483 Vector v = (Vector)getField(cfg, field); | |
484 | |
485 if (v == null) { | |
486 v = new Vector(); | |
487 putFieldImpl(cfg, field, v); | |
488 } | |
489 | |
490 v.add(element); | |
491 } | |
492 | |
493 String expandFormat(String format) { | |
494 if (format == null) { | |
495 return null; | |
496 } | |
497 | |
498 if (format.indexOf('%') == -1) { | |
499 return format; | |
500 } | |
501 | |
502 StringBuffer sb = new StringBuffer(); | |
503 int len = format.length(); | |
504 for (int i=0; i<len; i++) { | |
505 char ch = format.charAt(i); | |
506 if (ch == '%') { | |
507 char ch1 = format.charAt(i+1); | |
508 switch (ch1) { | |
509 case '%': | |
510 sb.append(ch1); | |
511 break; | |
512 case 'b': | |
513 sb.append(build()); | |
514 break; | |
515 case 'f': | |
516 sb.append(flavour()); | |
517 break; | |
18125
2a69cbe850a8
Reduce diff with upstream
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12039
diff
changeset
|
518 case 'o': |
2a69cbe850a8
Reduce diff with upstream
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12039
diff
changeset
|
519 sb.append(outputDir()); |
2a69cbe850a8
Reduce diff with upstream
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12039
diff
changeset
|
520 break; |
0 | 521 default: |
522 sb.append(ch); | |
523 sb.append(ch1); | |
524 } | |
525 i++; | |
526 } else { | |
527 sb.append(ch); | |
528 } | |
529 } | |
530 | |
531 return sb.toString(); | |
532 } | |
533 } | |
534 | |
535 abstract class GenericDebugConfig extends BuildConfig { | |
536 abstract String getOptFlag(); | |
537 | |
538 protected void init(Vector includes, Vector defines) { | |
539 defines.add("_DEBUG"); | |
540 defines.add("ASSERT"); | |
541 | |
542 super.init(includes, defines); | |
543 | |
544 getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag())); | |
545 getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags()); | |
546 } | |
547 } | |
548 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
549 abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
550 protected void init(Vector includes, Vector defines) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
551 super.init(includes, defines); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
552 getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
553 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
554 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
555 |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
556 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
|
557 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
|
558 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
|
559 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
560 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
561 GraalDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
562 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
|
563 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
|
564 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
565 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
566 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
567 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
|
568 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
|
569 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
|
570 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
571 |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
572 GraalFastDebugConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
573 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
|
574 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
|
575 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
576 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
577 |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
578 class C1DebugConfig extends GenericDebugNonKernelConfig { |
0 | 579 String getOptFlag() { |
580 return getCI().getNoOptFlag(); | |
581 } | |
582 | |
583 C1DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
584 initNames("compiler1", "debug", "jvm.dll"); |
0 | 585 init(getIncludes(), getDefines()); |
586 } | |
587 } | |
588 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
589 class C1FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 590 String getOptFlag() { |
591 return getCI().getOptFlag(); | |
592 } | |
593 | |
594 C1FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
595 initNames("compiler1", "fastdebug", "jvm.dll"); |
0 | 596 init(getIncludes(), getDefines()); |
597 } | |
598 } | |
599 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
600 class C2DebugConfig extends GenericDebugNonKernelConfig { |
0 | 601 String getOptFlag() { |
602 return getCI().getNoOptFlag(); | |
603 } | |
604 | |
605 C2DebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
606 initNames("compiler2", "debug", "jvm.dll"); |
0 | 607 init(getIncludes(), getDefines()); |
608 } | |
609 } | |
610 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
611 class C2FastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 612 String getOptFlag() { |
613 return getCI().getOptFlag(); | |
614 } | |
615 | |
616 C2FastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
617 initNames("compiler2", "fastdebug", "jvm.dll"); |
0 | 618 init(getIncludes(), getDefines()); |
619 } | |
620 } | |
621 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
622 class TieredDebugConfig extends GenericDebugNonKernelConfig { |
0 | 623 String getOptFlag() { |
624 return getCI().getNoOptFlag(); | |
625 } | |
626 | |
627 TieredDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
628 initNames("tiered", "debug", "jvm.dll"); |
0 | 629 init(getIncludes(), getDefines()); |
630 } | |
631 } | |
632 | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
633 class TieredFastDebugConfig extends GenericDebugNonKernelConfig { |
0 | 634 String getOptFlag() { |
635 return getCI().getOptFlag(); | |
636 } | |
637 | |
638 TieredFastDebugConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
639 initNames("tiered", "fastdebug", "jvm.dll"); |
0 | 640 init(getIncludes(), getDefines()); |
641 } | |
642 } | |
643 | |
644 abstract class ProductConfig extends BuildConfig { | |
645 protected void init(Vector includes, Vector defines) { | |
646 defines.add("NDEBUG"); | |
647 defines.add("PRODUCT"); | |
648 | |
649 super.init(includes, defines); | |
650 | |
651 getV("CompilerFlags").addAll(getCI().getProductCompilerFlags()); | |
652 getV("LinkerFlags").addAll(getCI().getProductLinkerFlags()); | |
653 } | |
654 } | |
655 | |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
656 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
|
657 GraalProductConfig() { |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
658 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
|
659 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
|
660 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
661 } |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4475
diff
changeset
|
662 |
0 | 663 class C1ProductConfig extends ProductConfig { |
664 C1ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
665 initNames("compiler1", "product", "jvm.dll"); |
0 | 666 init(getIncludes(), getDefines()); |
667 } | |
668 } | |
669 | |
670 class C2ProductConfig extends ProductConfig { | |
671 C2ProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
672 initNames("compiler2", "product", "jvm.dll"); |
0 | 673 init(getIncludes(), getDefines()); |
674 } | |
675 } | |
676 | |
677 class TieredProductConfig extends ProductConfig { | |
678 TieredProductConfig() { | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
679 initNames("tiered", "product", "jvm.dll"); |
0 | 680 init(getIncludes(), getDefines()); |
681 } | |
682 } | |
683 | |
6801 | 684 |
0 | 685 abstract class CompilerInterface { |
686 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
|
687 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); |
0 | 688 abstract Vector getDebugCompilerFlags(String opt); |
689 abstract Vector getDebugLinkerFlags(); | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
690 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); |
0 | 691 abstract Vector getProductCompilerFlags(); |
692 abstract Vector getProductLinkerFlags(); | |
693 abstract String getOptFlag(); | |
694 abstract String getNoOptFlag(); | |
2233
15d6977f04b0
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
2027
diff
changeset
|
695 abstract String makeCfgName(String flavourBuild, String platformName); |
0 | 696 |
697 void addAttr(Vector receiver, String attr, String value) { | |
698 receiver.add(attr); receiver.add(value); | |
699 } | |
2027
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
700 void extAttr(Vector receiver, String attr, String value) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
701 int attr_pos=receiver.indexOf(attr) ; |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
702 if ( attr_pos == -1) { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
703 // 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
|
704 receiver.add(attr); receiver.add(value); |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
705 } else { |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
706 // 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
|
707 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
|
708 } |
aa6e219afbf1
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
1972
diff
changeset
|
709 } |
0 | 710 } |