comparison src/share/tools/ProjectCreator/BuildConfig.java @ 12039:3cce976666d9

Merge hs25-b46
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 10 Oct 2013 14:20:04 +0200
parents f40010b67b6e 31f3b1e1c5e5
children 2a69cbe850a8
comparison
equal deleted inserted replaced
11958:a0f5be106e67 12039:3cce976666d9
158 } 158 }
159 } 159 }
160 return rv; 160 return rv;
161 } 161 }
162 162
163 // Returns true if the specified path refers to a relative alternate
164 // source file. RelativeAltSrcInclude is usually "src\closed".
165 public static boolean matchesRelativeAltSrcInclude(String path) {
166 String relativeAltSrcInclude =
167 getFieldString(null, "RelativeAltSrcInclude");
168 Vector<String> v = getFieldVector(null, "AltRelativeInclude");
169 for (String pathPart : v) {
170 if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) {
171 return true;
172 }
173 }
174 return false;
175 }
176
177 // Returns the relative alternate source file for the specified path.
178 // Null is returned if the specified path does not have a matching
179 // alternate source file.
180 public static String getMatchingRelativeAltSrcFile(String path) {
181 Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList");
182 if (v == null) {
183 return null;
184 }
185 for (String pathPart : v) {
186 if (path.endsWith(pathPart)) {
187 String relativeAltSrcInclude =
188 getFieldString(null, "RelativeAltSrcInclude");
189 return relativeAltSrcInclude + Util.sep + pathPart;
190 }
191 }
192 return null;
193 }
194
195 // Returns true if the specified path has a matching alternate
196 // source file.
197 public static boolean matchesRelativeAltSrcFile(String path) {
198 return getMatchingRelativeAltSrcFile(path) != null;
199 }
200
201 // Track the specified alternate source file. The source file is
202 // tracked without the leading .*<sep><RelativeAltSrcFileList><sep>
203 // part to make matching regular source files easier.
204 public static void trackRelativeAltSrcFile(String path) {
205 String pattern = getFieldString(null, "RelativeAltSrcInclude") +
206 Util.sep;
207 int altSrcInd = path.indexOf(pattern);
208 if (altSrcInd == -1) {
209 // not an AltSrc path
210 return;
211 }
212
213 altSrcInd += pattern.length();
214 if (altSrcInd >= path.length()) {
215 // not a valid AltSrc path
216 return;
217 }
218
219 String altSrcFile = path.substring(altSrcInd);
220 Vector v = getFieldVector(null, "RelativeAltSrcFileList");
221 if (v == null || !v.contains(altSrcFile)) {
222 addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
223 }
224 }
225
163 void addTo(Hashtable ht, String key, String value) { 226 void addTo(Hashtable ht, String key, String value) {
164 ht.put(expandFormat(key), expandFormat(value)); 227 ht.put(expandFormat(key), expandFormat(value));
165 } 228 }
166 229
167 void initDefaultDefines(Vector defines) { 230 void initDefaultDefines(Vector defines) {
304 return rv; 367 return rv;
305 } 368 }
306 369
307 private Vector getSourceIncludes() { 370 private Vector getSourceIncludes() {
308 Vector<String> rv = new Vector<String>(); 371 Vector<String> rv = new Vector<String>();
372 String sourceBase = getFieldString(null, "SourceBase");
373
374 // add relative alternate source include values:
375 String relativeAltSrcInclude =
376 getFieldString(null, "RelativeAltSrcInclude");
377 Vector<String> asri = new Vector<String>();
378 collectRelevantVectors(asri, "AltRelativeInclude");
379 for (String f : asri) {
380 rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
381 Util.sep + f);
382 }
383
309 Vector<String> ri = new Vector<String>(); 384 Vector<String> ri = new Vector<String>();
310 String sourceBase = getFieldString(null, "SourceBase");
311 collectRelevantVectors(ri, "RelativeInclude"); 385 collectRelevantVectors(ri, "RelativeInclude");
312 for (String f : ri) { 386 for (String f : ri) {
313 rv.add(sourceBase + Util.sep + f); 387 rv.add(sourceBase + Util.sep + f);
314 } 388 }
315 return rv; 389 return rv;
605 initNames("tiered", "product", "jvm.dll"); 679 initNames("tiered", "product", "jvm.dll");
606 init(getIncludes(), getDefines()); 680 init(getIncludes(), getDefines());
607 } 681 }
608 } 682 }
609 683
610 class CoreDebugConfig extends GenericDebugNonKernelConfig {
611 String getOptFlag() {
612 return getCI().getNoOptFlag();
613 }
614
615 CoreDebugConfig() {
616 initNames("core", "debug", "jvm.dll");
617 init(getIncludes(), getDefines());
618 }
619 }
620
621 class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
622 String getOptFlag() {
623 return getCI().getOptFlag();
624 }
625
626 CoreFastDebugConfig() {
627 initNames("core", "fastdebug", "jvm.dll");
628 init(getIncludes(), getDefines());
629 }
630 }
631
632 class CoreProductConfig extends ProductConfig {
633 CoreProductConfig() {
634 initNames("core", "product", "jvm.dll");
635 init(getIncludes(), getDefines());
636 }
637 }
638
639 684
640 abstract class CompilerInterface { 685 abstract class CompilerInterface {
641 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); 686 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
642 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); 687 abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
643 abstract Vector getDebugCompilerFlags(String opt); 688 abstract Vector getDebugCompilerFlags(String opt);