8022740: Visual 2008 IDE build is broken
authoriklam
Sat, 10 Aug 2013 10:56:27 -0700
changeset 19277 8952a5e25673
parent 19276 9c3ecc7c60cc
child 19278 c4355bebb414
8022740: Visual 2008 IDE build is broken Summary: Fixed project generation code, and added warning to upgrade to VS 2008 SP1. Reviewed-by: dcubed, ccheung
hotspot/make/windows/projectfiles/common/Makefile
hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
--- a/hotspot/make/windows/projectfiles/common/Makefile	Fri Aug 09 15:36:09 2013 -0700
+++ b/hotspot/make/windows/projectfiles/common/Makefile	Sat Aug 10 10:56:27 2013 -0700
@@ -112,6 +112,7 @@
 ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
 
 $(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
+	@if "$(MSC_VER)"=="1500" echo Make sure you have VS2008 SP1 or later, or you may see 'expanded command line too long'
 	@$(RUN_JAVA) -Djava.class.path="$(HOTSPOTBUILDSPACE)/classes" ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
 
 clean:
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java	Fri Aug 09 15:36:09 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java	Sat Aug 10 10:56:27 2013 -0700
@@ -12,11 +12,15 @@
    final int startDirLength;
    Stack<DirAttributes> attributes = new Stack<DirAttributes>();
    Vector<BuildConfig> allConfigs;
-   WinGammaPlatformVC10 wg;
+   WinGammaPlatform wg;
+   WinGammaPlatformVC10 wg10;
 
-   public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) {
+   public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatform wg) {
       super();
       this.wg = wg;
+      if (wg instanceof WinGammaPlatformVC10) {
+          wg10 = (WinGammaPlatformVC10)wg;
+      }
       this.allConfigs = allConfigs;
       this.startDir = startDir;
       startDirLength = startDir.toAbsolutePath().toString().length();
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java	Fri Aug 09 15:36:09 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java	Sat Aug 10 10:56:27 2013 -0700
@@ -103,7 +103,7 @@
             }
          }
 
-         String tagName = wg.getFileTagFromSuffix(fileName);
+         String tagName = wg10.getFileTagFromSuffix(fileName);
 
          if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
             wg.tag(tagName, new String[] { "Include", fileLoc});
@@ -133,7 +133,7 @@
          }
 
          String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
-         wg.addFilterDependency(fileLoc, filter);
+         wg10.addFilterDependency(fileLoc, filter);
 
          return CONTINUE;
       }
@@ -162,7 +162,7 @@
          if (!hide) {
             String name = startDir.relativize(path.toAbsolutePath()).toString();
             if (!"".equals(name)) {
-               wg.addFilter(name);
+               wg10.addFilter(name);
             }
 
             attributes.push(newAttr);
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java	Fri Aug 09 15:36:09 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java	Sat Aug 10 10:56:27 2013 -0700
@@ -12,7 +12,7 @@
 public class FileTreeCreatorVC7 extends FileTreeCreator {
 
       public FileTreeCreatorVC7(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatform wg) {
-         super(startDir, allConfigs, null);
+         super(startDir, allConfigs, wg);
       }
 
       @Override
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java	Fri Aug 09 15:36:09 2013 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java	Sat Aug 10 10:56:27 2013 -0700
@@ -139,19 +139,22 @@
 
       tagV("Tool", cfg.getV("LinkerFlags"));
 
-      tag("Tool",
-            new String[] {
-            "Name",
-            "VCPostBuildEventTool",
-            "Description",
-            BuildConfig
-            .getFieldString(null, "PostbuildDescription"),
-            // Caution: String.replace(String,String) is available
-            // from JDK5 onwards only
-            "CommandLine",
-            cfg.expandFormat(BuildConfig.getFieldString(null,
-                  "PostbuildCommand").replace("\t",
-                        "&#x0D;&#x0A;")) });
+      String postBuildCmd = BuildConfig.getFieldString(null,
+            "PostbuildCommand");
+      if (postBuildCmd != null) {
+         tag("Tool",
+               new String[] {
+               "Name",
+               "VCPostBuildEventTool",
+               "Description",
+               BuildConfig
+               .getFieldString(null, "PostbuildDescription"),
+               // Caution: String.replace(String,String) is available
+               // from JDK5 onwards only
+               "CommandLine",
+                   cfg.expandFormat(postBuildCmd.replace("\t",
+                           "&#x0D;&#x0A;")) });
+      }
 
       tag("Tool", new String[] { "Name", "VCPreBuildEventTool" });