8156018: Hotspot visual studio project generation broken

Reviewed-by: mgronlun, ctornqvi
This commit is contained in:
Magnus Ihse Bursie 2016-05-09 13:22:39 +02:00 committed by Erik Joelsson
parent c16b4b7673
commit 01fcb7adcf
8 changed files with 92 additions and 46 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
class ArgIterator {
String[] args;
int i;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
@ -37,7 +39,7 @@ class BuildConfig {
if (ci == null) {
String comp = (String)getField(null, "CompilerVersion");
try {
ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
ci = (CompilerInterface)Class.forName("build.tools.projectcreator.CompilerInterface" + comp).newInstance();
} catch (Exception cnfe) {
System.err.println("Cannot find support for compiler " + comp);
throw new RuntimeException(cnfe.toString());
@ -66,6 +68,8 @@ class BuildConfig {
String buildSpace = getFieldString(null, "BuildSpace");
String outDir = buildBase;
String jdkTargetRoot = getFieldString(null, "JdkTargetRoot");
String makeBinary = getFieldString(null, "MakeBinary");
String makeOutput = expandFormat(getFieldString(null, "MakeOutput"));
put("Id", flavourBuild);
put("OutputDir", outDir);
@ -74,6 +78,8 @@ class BuildConfig {
put("BuildSpace", buildSpace);
put("OutputDll", outDir + Util.sep + outDll);
put("JdkTargetRoot", jdkTargetRoot);
put("MakeBinary", makeBinary);
put("MakeOutput", makeOutput);
context = new String [] {flavourBuild, flavour, build, null};
}
@ -148,9 +154,11 @@ class BuildConfig {
String relativeAltSrcInclude =
getFieldString(null, "RelativeAltSrcInclude");
Vector<String> v = getFieldVector(null, "AltRelativeInclude");
for (String pathPart : v) {
if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) {
return true;
if (v != null) {
for (String pathPart : v) {
if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) {
return true;
}
}
}
return false;
@ -360,8 +368,7 @@ class BuildConfig {
static boolean appliesToTieredBuild(String cfg) {
return (cfg != null &&
(cfg.startsWith("compiler1") ||
cfg.startsWith("compiler2")));
cfg.startsWith("server"));
}
// Filters out the IgnoreFile and IgnorePaths since they are
@ -372,7 +379,7 @@ class BuildConfig {
static String getTieredBuildCfg(String cfg) {
assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
return "tiered" + cfg.substring(9);
return "server";
}
static Object getField(String cfg, String field) {
@ -524,7 +531,7 @@ class C1DebugConfig extends GenericDebugNonKernelConfig {
}
C1DebugConfig() {
initNames("compiler1", "debug", "jvm.dll");
initNames("client", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
@ -535,7 +542,7 @@ class C1FastDebugConfig extends GenericDebugNonKernelConfig {
}
C1FastDebugConfig() {
initNames("compiler1", "fastdebug", "jvm.dll");
initNames("client", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
@ -546,7 +553,7 @@ class TieredDebugConfig extends GenericDebugNonKernelConfig {
}
TieredDebugConfig() {
initNames("tiered", "debug", "jvm.dll");
initNames("server", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
@ -557,7 +564,7 @@ class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
}
TieredFastDebugConfig() {
initNames("tiered", "fastdebug", "jvm.dll");
initNames("server", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
@ -576,14 +583,14 @@ abstract class ProductConfig extends BuildConfig {
class C1ProductConfig extends ProductConfig {
C1ProductConfig() {
initNames("compiler1", "product", "jvm.dll");
initNames("client", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class TieredProductConfig extends ProductConfig {
TieredProductConfig() {
initNames("tiered", "product", "jvm.dll");
initNames("server", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}

View File

@ -1,3 +1,29 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package build.tools.projectcreator;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
import static java.nio.file.FileVisitResult.CONTINUE;
import java.io.IOException;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
public class ProjectCreator {
public static void usage() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
import java.util.*;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
@ -317,6 +319,18 @@ public abstract class WinGammaPlatform {
HsArgHandler.STRING
),
new HsArgRule("-makeBinary",
"MakeBinary",
null,
HsArgHandler.STRING
),
new HsArgRule("-makeOutput",
"MakeOutput",
null,
HsArgHandler.STRING
),
new HsArgRule("-platformName",
"PlatformName",
null,
@ -554,10 +568,6 @@ public abstract class WinGammaPlatform {
usage();
}
if (BuildConfig.getField(null, "UseToGeneratePch") == null) {
throw new RuntimeException("ERROR: need to specify one file to compute PCH, with -useToGeneratePch flag");
}
BuildConfig.putField(null, "PlatformObject", this);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,6 +22,8 @@
*
*/
package build.tools.projectcreator;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@ -71,6 +73,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
startTag("PropertyGroup", "Label", "Globals");
tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}");
tagData("Keyword", "MakeFileProj");
tag("SccProjectName");
tag("SccLocalPath");
endTag();
@ -79,9 +82,8 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup", "Label", "Configuration");
tagData("ConfigurationType", "DynamicLibrary");
tagData("UseOfMfc", "false");
tagData("PlatformToolset", "v120");
tagData("ConfigurationType", "Makefile");
tagData("UseDebugLibraries", "true");
endTag();
}
@ -111,6 +113,14 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
tag(cfg, "CodeAnalysisRules");
tag(cfg, "CodeAnalysisRuleAssemblies");
}
for (BuildConfig cfg : allConfigs) {
tagData(cfg, "NMakeBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile import-hotspot LOG=info");
tagData(cfg, "NMakeReBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot import-hotspot LOG=info");
tagData(cfg, "NMakeCleanCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot LOG=info");
tagData(cfg, "NMakeOutput", cfg.get("MakeOutput") + Util.sep + "jvm.dll");
tagData(cfg, "NMakePreprocessorDefinitions", Util.join(";", cfg.getDefines()));
tagData(cfg, "NMakeIncludeSearchPath", Util.join(";", cfg.getIncludes()));
}
endTag();
for (BuildConfig cfg : allConfigs) {
@ -123,11 +133,6 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
tagV(cfg.getV("LinkerFlags"));
endTag();
startTag("PreLinkEvent");
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
endTag();
endTag();
}
@ -162,18 +167,13 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup");
tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe");
// The JVM loads some libraries using a path relative to
// itself because it expects to be in a JRE or a JDK. The java
// launcher's '-XXaltjvm=' option allows the JVM to be outside
// the JRE or JDK so '-Dsun.java.launcher.is_altjvm=true'
// forces a fake JAVA_HOME relative path to be used to
// find the other libraries. The '-XX:+PauseAtExit' option
// Since we run "make hotspot-import", we get the correct jvm.dll by java.exe.
// The '-XX:+PauseAtExit' option
// causes the VM to wait for key press before exiting; this
// allows any stdout or stderr messages to be seen before
// the cmdtool exits.
tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) "
+ "-Dsun.java.launcher.is_altjvm=true "
+ "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit");
tagData("LocalDebuggerCommandArguments",
"-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit");
tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot"));
endTag();
}
@ -209,11 +209,6 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
endTag();
}
startTag("Filter", "Include", "Resource Files");
UUID uuid = UUID.randomUUID();
tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe");
endTag();
endTag();
//TODO - do I need to split cpp and hpp files?