win64 visual studio projects
Lukas Stadler
lukas.stadler at jku.at
Thu Jun 10 13:58:09 UTC 2010
I recently modified the tools/MakeDeps to allow it to create 64-bit
visual studio projects - it's just a small patch but I think it might be
interesting for the subscribers of this list anyway.
(Only tested with VS2008, and I recommend using the Windows7 SDK command
line to run the create.bat script.)
- Lukas
-------------- next part --------------
diff --git a/make/windows/create.bat b/make/windows/create.bat
--- a/make/windows/create.bat
+++ b/make/windows/create.bat
@@ -42,6 +42,8 @@ cl 2>&1 | grep "IA-64" >NUL
cl 2>&1 | grep "IA-64" >NUL
if %errorlevel% == 0 goto isia64
cl 2>&1 | grep "AMD64" >NUL
+if %errorlevel% == 0 goto amd64
+cl 2>&1 | grep "x64" >NUL
if %errorlevel% == 0 goto amd64
set ARCH=x86
set BUILDARCH=i486
diff --git a/src/share/tools/MakeDeps/BuildConfig.java b/src/share/tools/MakeDeps/BuildConfig.java
--- a/src/share/tools/MakeDeps/BuildConfig.java
+++ b/src/share/tools/MakeDeps/BuildConfig.java
@@ -242,12 +242,22 @@ class BuildConfig {
void initDefaultDefines(Vector defines) {
Vector sysDefines = new Vector();
- sysDefines.add("WIN32");
+ if( Util.os().equals("Win32")) {
+ sysDefines.add("WIN32");
+ sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
+ } else {
+ sysDefines.add("_AMD64_");
+ sysDefines.add("AMD64");
+ sysDefines.add("_WIN64");
+ sysDefines.add("_LP64");
+ if (System.getenv("MSC_VER") != null)
+ sysDefines.add("MSC_VER=" + System.getenv("MSC_VER"));
+ sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
+ }
sysDefines.add("_WINDOWS");
sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name"));
sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
sysDefines.add("_JNI_IMPLEMENTATION_");
- sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
sysDefines.addAll(defines);
diff --git a/src/share/tools/MakeDeps/MakeDeps.java b/src/share/tools/MakeDeps/MakeDeps.java
--- a/src/share/tools/MakeDeps/MakeDeps.java
+++ b/src/share/tools/MakeDeps/MakeDeps.java
@@ -1,3 +1,6 @@
+import java.util.Map;
+import java.util.Map.Entry;
+
/*
* Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
diff --git a/src/share/tools/MakeDeps/Util.java b/src/share/tools/MakeDeps/Util.java
--- a/src/share/tools/MakeDeps/Util.java
+++ b/src/share/tools/MakeDeps/Util.java
@@ -23,6 +23,7 @@
*/
import java.util.*;
+import java.util.Map.Entry;
import java.io.File;
public class Util {
@@ -84,5 +85,25 @@ public class Util {
}
static String sep = File.separator;
- static String os = "Win32"; //System.getProperty("os.name");
+
+ private static String _os;
+
+ static String os() {
+ if( _os==null) {
+
+ for(Map.Entry<String, String> entry: System.getenv().entrySet())
+ if("PLATFORM_ARCH_MODEL".equals(entry.getKey().toUpperCase())) {
+ String archModel = entry.getValue();
+ if("x86_32".equals(archModel))
+ _os = "Win32";
+ else if("x86_64".equals(archModel))
+ _os = "x64";
+ else
+ throw new RuntimeException("Unsupported PLATFORM_ARCH_MODEL " + archModel);
+ return _os;
+ }
+ throw new RuntimeException("PLATFORM_ARCH_MODEL not specified");
+ }
+ return _os;
+ }
}
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC6.java b/src/share/tools/MakeDeps/WinGammaPlatformVC6.java
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC6.java
+++ b/src/share/tools/MakeDeps/WinGammaPlatformVC6.java
@@ -286,6 +286,6 @@ class CompilerInterfaceVC6 extends Comp
}
String makeCfgName(String flavourBuild) {
- return "vm - "+ Util.os + " " + flavourBuild;
+ return "vm - "+ "Win32" + " " + flavourBuild;
}
}
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC7.java b/src/share/tools/MakeDeps/WinGammaPlatformVC7.java
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC7.java
+++ b/src/share/tools/MakeDeps/WinGammaPlatformVC7.java
@@ -51,7 +51,7 @@ public class WinGammaPlatformVC7 extends
);
startTag("Platforms", null);
- tag("Platform", new String[] {"Name", Util.os});
+ tag("Platform", new String[] {"Name", Util.os()});
endTag("Platforms");
startTag("Configurations", null);
@@ -467,7 +467,7 @@ public class WinGammaPlatformVC7 extends
"PreprocessorDefinitions", "NDEBUG",
"MkTypLibCompatible", "TRUE",
"SuppressStartupBanner", "TRUE",
- "TargetEnvironment", "1",
+ "TargetEnvironment", Util.os().equals("Win32") ? "1" : "3",
"TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
"HeaderFileName", ""
}
@@ -609,7 +609,7 @@ class CompilerInterfaceVC7 extends Compi
addAttr(rv, "BaseAddress", "0x8000000");
addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
// Set /MACHINE option. 1 is machineX86
- addAttr(rv, "TargetMachine", "1");
+ addAttr(rv, "TargetMachine", Util.os().equals("Win32") ? "1" : "17");
return rv;
}
@@ -687,6 +687,6 @@ class CompilerInterfaceVC7 extends Compi
}
String makeCfgName(String flavourBuild) {
- return flavourBuild + "|" + Util.os;
+ return flavourBuild + "|" + Util.os();
}
}
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC8.java b/src/share/tools/MakeDeps/WinGammaPlatformVC8.java
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC8.java
+++ b/src/share/tools/MakeDeps/WinGammaPlatformVC8.java
@@ -41,6 +41,8 @@ class CompilerInterfaceVC8 extends Compi
addAttr(rv, "UsePrecompiledHeader", "2");
// Set /EHsc- option. 0 is cppExceptionHandlingNo
addAttr(rv, "ExceptionHandling", "0");
+ // Parallel compilation
+ addAttr(rv, "AdditionalOptions", "/MP");
return rv;
}
More information about the build-dev
mailing list