1.1 --- a/src/share/tools/ProjectCreator/BuildConfig.java Tue Dec 14 15:10:52 2010 -0500 1.2 +++ b/src/share/tools/ProjectCreator/BuildConfig.java Wed Dec 15 07:11:31 2010 -0800 1.3 @@ -22,8 +22,11 @@ 1.4 * 1.5 */ 1.6 1.7 -import java.util.*; 1.8 import java.io.File; 1.9 +import java.util.Enumeration; 1.10 +import java.util.Hashtable; 1.11 +import java.util.Iterator; 1.12 +import java.util.Vector; 1.13 1.14 class BuildConfig { 1.15 Hashtable vars; 1.16 @@ -57,7 +60,6 @@ 1.17 1.18 // ones mentioned above were needed to expand format 1.19 String buildBase = expandFormat(getFieldString(null, "BuildBase")); 1.20 - String jdkDir = getFieldString(null, "JdkTargetRoot"); 1.21 String sourceBase = getFieldString(null, "SourceBase"); 1.22 String outDir = buildBase; 1.23 1.24 @@ -65,7 +67,7 @@ 1.25 put("OutputDir", outDir); 1.26 put("SourceBase", sourceBase); 1.27 put("BuildBase", buildBase); 1.28 - put("OutputDll", jdkDir + Util.sep + outDll); 1.29 + put("OutputDll", outDir + Util.sep + outDll); 1.30 1.31 context = new String [] {flavourBuild, flavour, build, null}; 1.32 } 1.33 @@ -537,68 +539,75 @@ 1.34 } 1.35 } 1.36 1.37 -class C1DebugConfig extends GenericDebugConfig { 1.38 +abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { 1.39 + protected void init(Vector includes, Vector defines) { 1.40 + super.init(includes, defines); 1.41 + getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); 1.42 + } 1.43 +} 1.44 + 1.45 +class C1DebugConfig extends GenericDebugNonKernelConfig { 1.46 String getOptFlag() { 1.47 return getCI().getNoOptFlag(); 1.48 } 1.49 1.50 C1DebugConfig() { 1.51 - initNames("compiler1", "debug", "fastdebug\\jre\\bin\\client\\jvm.dll"); 1.52 + initNames("compiler1", "debug", "jvm.dll"); 1.53 init(getIncludes(), getDefines()); 1.54 } 1.55 } 1.56 1.57 -class C1FastDebugConfig extends GenericDebugConfig { 1.58 +class C1FastDebugConfig extends GenericDebugNonKernelConfig { 1.59 String getOptFlag() { 1.60 return getCI().getOptFlag(); 1.61 } 1.62 1.63 C1FastDebugConfig() { 1.64 - initNames("compiler1", "fastdebug", "fastdebug\\jre\\bin\\client\\jvm.dll"); 1.65 + initNames("compiler1", "fastdebug", "jvm.dll"); 1.66 init(getIncludes(), getDefines()); 1.67 } 1.68 } 1.69 1.70 -class C2DebugConfig extends GenericDebugConfig { 1.71 +class C2DebugConfig extends GenericDebugNonKernelConfig { 1.72 String getOptFlag() { 1.73 return getCI().getNoOptFlag(); 1.74 } 1.75 1.76 C2DebugConfig() { 1.77 - initNames("compiler2", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 1.78 + initNames("compiler2", "debug", "jvm.dll"); 1.79 init(getIncludes(), getDefines()); 1.80 } 1.81 } 1.82 1.83 -class C2FastDebugConfig extends GenericDebugConfig { 1.84 +class C2FastDebugConfig extends GenericDebugNonKernelConfig { 1.85 String getOptFlag() { 1.86 return getCI().getOptFlag(); 1.87 } 1.88 1.89 C2FastDebugConfig() { 1.90 - initNames("compiler2", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 1.91 + initNames("compiler2", "fastdebug", "jvm.dll"); 1.92 init(getIncludes(), getDefines()); 1.93 } 1.94 } 1.95 1.96 -class TieredDebugConfig extends GenericDebugConfig { 1.97 +class TieredDebugConfig extends GenericDebugNonKernelConfig { 1.98 String getOptFlag() { 1.99 return getCI().getNoOptFlag(); 1.100 } 1.101 1.102 TieredDebugConfig() { 1.103 - initNames("tiered", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 1.104 + initNames("tiered", "debug", "jvm.dll"); 1.105 init(getIncludes(), getDefines()); 1.106 } 1.107 } 1.108 1.109 -class TieredFastDebugConfig extends GenericDebugConfig { 1.110 +class TieredFastDebugConfig extends GenericDebugNonKernelConfig { 1.111 String getOptFlag() { 1.112 return getCI().getOptFlag(); 1.113 } 1.114 1.115 TieredFastDebugConfig() { 1.116 - initNames("tiered", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 1.117 + initNames("tiered", "fastdebug", "jvm.dll"); 1.118 init(getIncludes(), getDefines()); 1.119 } 1.120 } 1.121 @@ -618,45 +627,45 @@ 1.122 1.123 class C1ProductConfig extends ProductConfig { 1.124 C1ProductConfig() { 1.125 - initNames("compiler1", "product", "jre\\bin\\client\\jvm.dll"); 1.126 + initNames("compiler1", "product", "jvm.dll"); 1.127 init(getIncludes(), getDefines()); 1.128 } 1.129 } 1.130 1.131 class C2ProductConfig extends ProductConfig { 1.132 C2ProductConfig() { 1.133 - initNames("compiler2", "product", "jre\\bin\\server\\jvm.dll"); 1.134 + initNames("compiler2", "product", "jvm.dll"); 1.135 init(getIncludes(), getDefines()); 1.136 } 1.137 } 1.138 1.139 class TieredProductConfig extends ProductConfig { 1.140 TieredProductConfig() { 1.141 - initNames("tiered", "product", "jre\\bin\\server\\jvm.dll"); 1.142 + initNames("tiered", "product", "jvm.dll"); 1.143 init(getIncludes(), getDefines()); 1.144 } 1.145 } 1.146 1.147 1.148 -class CoreDebugConfig extends GenericDebugConfig { 1.149 +class CoreDebugConfig extends GenericDebugNonKernelConfig { 1.150 String getOptFlag() { 1.151 return getCI().getNoOptFlag(); 1.152 } 1.153 1.154 CoreDebugConfig() { 1.155 - initNames("core", "debug", "fastdebug\\jre\\bin\\core\\jvm.dll"); 1.156 + initNames("core", "debug", "jvm.dll"); 1.157 init(getIncludes(), getDefines()); 1.158 } 1.159 } 1.160 1.161 1.162 -class CoreFastDebugConfig extends GenericDebugConfig { 1.163 +class CoreFastDebugConfig extends GenericDebugNonKernelConfig { 1.164 String getOptFlag() { 1.165 return getCI().getOptFlag(); 1.166 } 1.167 1.168 CoreFastDebugConfig() { 1.169 - initNames("core", "fastdebug", "fastdebug\\jre\\bin\\core\\jvm.dll"); 1.170 + initNames("core", "fastdebug", "jvm.dll"); 1.171 init(getIncludes(), getDefines()); 1.172 } 1.173 } 1.174 @@ -664,7 +673,7 @@ 1.175 1.176 class CoreProductConfig extends ProductConfig { 1.177 CoreProductConfig() { 1.178 - initNames("core", "product", "jre\\bin\\core\\jvm.dll"); 1.179 + initNames("core", "product", "jvm.dll"); 1.180 init(getIncludes(), getDefines()); 1.181 } 1.182 } 1.183 @@ -675,7 +684,7 @@ 1.184 } 1.185 1.186 KernelDebugConfig() { 1.187 - initNames("kernel", "debug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); 1.188 + initNames("kernel", "debug", "jvm.dll"); 1.189 init(getIncludes(), getDefines()); 1.190 } 1.191 } 1.192 @@ -687,7 +696,7 @@ 1.193 } 1.194 1.195 KernelFastDebugConfig() { 1.196 - initNames("kernel", "fastdebug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); 1.197 + initNames("kernel", "fastdebug", "jvm.dll"); 1.198 init(getIncludes(), getDefines()); 1.199 } 1.200 } 1.201 @@ -695,7 +704,7 @@ 1.202 1.203 class KernelProductConfig extends ProductConfig { 1.204 KernelProductConfig() { 1.205 - initNames("kernel", "product", "jre\\bin\\kernel\\jvm.dll"); 1.206 + initNames("kernel", "product", "jvm.dll"); 1.207 init(getIncludes(), getDefines()); 1.208 } 1.209 } 1.210 @@ -704,6 +713,7 @@ 1.211 abstract Vector getBaseLinkerFlags(String outDir, String outDll); 1.212 abstract Vector getDebugCompilerFlags(String opt); 1.213 abstract Vector getDebugLinkerFlags(); 1.214 + abstract void getAdditionalNonKernelLinkerFlags(Vector rv); 1.215 abstract Vector getProductCompilerFlags(); 1.216 abstract Vector getProductLinkerFlags(); 1.217 abstract String getOptFlag(); 1.218 @@ -713,4 +723,14 @@ 1.219 void addAttr(Vector receiver, String attr, String value) { 1.220 receiver.add(attr); receiver.add(value); 1.221 } 1.222 + void extAttr(Vector receiver, String attr, String value) { 1.223 + int attr_pos=receiver.indexOf(attr) ; 1.224 + if ( attr_pos == -1) { 1.225 + // If attr IS NOT present in the Vector - add it 1.226 + receiver.add(attr); receiver.add(value); 1.227 + } else { 1.228 + // If attr IS present in the Vector - append value to it 1.229 + receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value); 1.230 + } 1.231 + } 1.232 }