mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
7017824: Add support for creating 64-bit Visual Studio projects
Updated create.bat and ProjectCreator Reviewed-by: brutisso, stefank, ohair
This commit is contained in:
parent
d30b5f01d3
commit
32b46da6e3
21 changed files with 237 additions and 387 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, 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
|
||||
|
@ -51,12 +51,14 @@ class BuildConfig {
|
|||
if (vars == null) vars = new Hashtable();
|
||||
|
||||
String flavourBuild = flavour + "_" + build;
|
||||
String platformName = getFieldString(null, "PlatformName");
|
||||
System.out.println();
|
||||
System.out.println(flavourBuild);
|
||||
|
||||
put("Name", getCI().makeCfgName(flavourBuild));
|
||||
put("Name", getCI().makeCfgName(flavourBuild, platformName));
|
||||
put("Flavour", flavour);
|
||||
put("Build", build);
|
||||
put("PlatformName", platformName);
|
||||
|
||||
// ones mentioned above were needed to expand format
|
||||
String buildBase = expandFormat(getFieldString(null, "BuildBase"));
|
||||
|
@ -93,7 +95,7 @@ class BuildConfig {
|
|||
protected void initDefaultLinkerFlags() {
|
||||
Vector linkerFlags = new Vector();
|
||||
|
||||
linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll")));
|
||||
linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
|
||||
|
||||
put("LinkerFlags", linkerFlags);
|
||||
}
|
||||
|
@ -115,18 +117,15 @@ class BuildConfig {
|
|||
}
|
||||
|
||||
|
||||
Vector getPreferredPaths(MacroDefinitions macros) {
|
||||
Vector getPreferredPaths() {
|
||||
Vector preferredPaths = new Vector();
|
||||
|
||||
// In the case of multiple files with the same name in
|
||||
// different subdirectories, prefer the versions specified in
|
||||
// the platform file as the "os_family" and "arch" macros.
|
||||
for (Iterator iter = macros.getMacros(); iter.hasNext(); ) {
|
||||
Macro macro = (Macro) iter.next();
|
||||
if (macro.name.equals("os_family") ||
|
||||
macro.name.equals("arch")) {
|
||||
preferredPaths.add(macro.contents);
|
||||
}
|
||||
}
|
||||
// different subdirectories, prefer these versions
|
||||
preferredPaths.add("windows");
|
||||
preferredPaths.add("x86");
|
||||
preferredPaths.add("closed");
|
||||
|
||||
// Also prefer "opto" over "adlc" for adlcVMDeps.hpp
|
||||
preferredPaths.add("opto");
|
||||
|
||||
|
@ -137,18 +136,7 @@ class BuildConfig {
|
|||
void handleDB() {
|
||||
WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
|
||||
|
||||
File incls = new File(get("OutputDir")+Util.sep+"incls");
|
||||
|
||||
incls.mkdirs();
|
||||
|
||||
MacroDefinitions macros = new MacroDefinitions();
|
||||
try {
|
||||
macros.readFrom(getFieldString(null, "Platform"), false);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
putSpecificField("AllFilesHash", computeAllFiles(platform, macros));
|
||||
putSpecificField("AllFilesHash", computeAllFiles(platform));
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,10 +178,10 @@ class BuildConfig {
|
|||
ht.put(expandFormat(key), expandFormat(value));
|
||||
}
|
||||
|
||||
Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) {
|
||||
Hashtable computeAllFiles(WinGammaPlatform platform) {
|
||||
Hashtable rv = new Hashtable();
|
||||
DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
|
||||
Vector preferredPaths = getPreferredPaths(macros);
|
||||
Vector preferredPaths = getPreferredPaths();
|
||||
|
||||
// Hold errors until end
|
||||
Vector filesNotFound = new Vector();
|
||||
|
@ -228,8 +216,7 @@ class BuildConfig {
|
|||
System.err.println("Error: some files were not found or " +
|
||||
"appeared in multiple subdirectories of " +
|
||||
"directory " + get("SourceBase") + " and could not " +
|
||||
"be resolved with the os_family and arch " +
|
||||
"macros in the platform file.");
|
||||
"be resolved with os_family and arch.");
|
||||
if (filesNotFound.size() != 0) {
|
||||
System.err.println("Files not found:");
|
||||
for (Iterator iter = filesNotFound.iterator();
|
||||
|
@ -254,10 +241,14 @@ class BuildConfig {
|
|||
Vector sysDefines = new Vector();
|
||||
sysDefines.add("WIN32");
|
||||
sysDefines.add("_WINDOWS");
|
||||
sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name"));
|
||||
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\\\"");
|
||||
if (vars.get("PlatformName").equals("Win32")) {
|
||||
sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
|
||||
} else {
|
||||
sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
|
||||
}
|
||||
|
||||
sysDefines.addAll(defines);
|
||||
|
||||
|
@ -710,7 +701,7 @@ class KernelProductConfig extends ProductConfig {
|
|||
}
|
||||
abstract class CompilerInterface {
|
||||
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
|
||||
abstract Vector getBaseLinkerFlags(String outDir, String outDll);
|
||||
abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
|
||||
abstract Vector getDebugCompilerFlags(String opt);
|
||||
abstract Vector getDebugLinkerFlags();
|
||||
abstract void getAdditionalNonKernelLinkerFlags(Vector rv);
|
||||
|
@ -718,7 +709,7 @@ abstract class CompilerInterface {
|
|||
abstract Vector getProductLinkerFlags();
|
||||
abstract String getOptFlag();
|
||||
abstract String getNoOptFlag();
|
||||
abstract String makeCfgName(String flavourBuild);
|
||||
abstract String makeCfgName(String flavourBuild, String platformName);
|
||||
|
||||
void addAttr(Vector receiver, String attr, String value) {
|
||||
receiver.add(attr); receiver.add(value);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2011, 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
|
||||
|
@ -55,6 +55,9 @@ public class DirectoryTree {
|
|||
private Vector nodes = new Vector();
|
||||
|
||||
public FileIterator(Node rootNode) {
|
||||
if(rootNode == null) {
|
||||
return;
|
||||
}
|
||||
nodes.add(rootNode);
|
||||
prune();
|
||||
}
|
||||
|
@ -112,10 +115,7 @@ public class DirectoryTree {
|
|||
throws IllegalArgumentException {
|
||||
File root = new File(Util.normalize(baseDirectory));
|
||||
if (!root.isDirectory()) {
|
||||
throw new IllegalArgumentException("baseDirectory \"" +
|
||||
baseDirectory +
|
||||
"\" does not exist or " +
|
||||
"is not a directory");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
root = root.getCanonicalFile();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2011, 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,7 +22,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class FileFormatException extends Exception {
|
||||
|
||||
public FileFormatException() {
|
||||
super();
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2010, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
public class Macro {
|
||||
public String name;
|
||||
public String contents;
|
||||
}
|
|
@ -1,154 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2010, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class MacroDefinitions {
|
||||
private Vector macros;
|
||||
|
||||
public MacroDefinitions() {
|
||||
macros = new Vector();
|
||||
}
|
||||
|
||||
public void addMacro(String name, String contents) {
|
||||
Macro macro = new Macro();
|
||||
macro.name = name;
|
||||
macro.contents = contents;
|
||||
macros.add(macro);
|
||||
}
|
||||
|
||||
private boolean lineIsEmpty(String s) {
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
if (!Character.isWhitespace(s.charAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void readFrom(String fileName, boolean missingOk)
|
||||
throws FileNotFoundException, FileFormatException, IOException {
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(fileName));
|
||||
} catch (FileNotFoundException e) {
|
||||
if (missingOk) {
|
||||
return;
|
||||
} else {
|
||||
throw(e);
|
||||
}
|
||||
}
|
||||
String line;
|
||||
do {
|
||||
line = reader.readLine();
|
||||
if (line != null) {
|
||||
// This had to be rewritten (compare to Database.java)
|
||||
// because the Solaris platform file has been
|
||||
// repurposed and now contains "macros" with spaces in
|
||||
// them.
|
||||
|
||||
if ((!line.startsWith("//")) &&
|
||||
(!lineIsEmpty(line))) {
|
||||
int nameBegin = -1;
|
||||
int nameEnd = -1;
|
||||
boolean gotEquals = false;
|
||||
int contentsBegin = -1;
|
||||
int contentsEnd = -1;
|
||||
|
||||
int i = 0;
|
||||
// Scan forward for beginning of name
|
||||
while (i < line.length()) {
|
||||
if (!Character.isWhitespace(line.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
nameBegin = i;
|
||||
|
||||
// Scan forward for end of name
|
||||
while (i < line.length()) {
|
||||
if (Character.isWhitespace(line.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
nameEnd = i;
|
||||
|
||||
// Scan forward for equals sign
|
||||
while (i < line.length()) {
|
||||
if (line.charAt(i) == '=') {
|
||||
gotEquals = true;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// Scan forward for start of contents
|
||||
i++;
|
||||
while (i < line.length()) {
|
||||
if (!Character.isWhitespace(line.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
contentsBegin = i;
|
||||
|
||||
// Scan *backward* for end of contents
|
||||
i = line.length() - 1;
|
||||
while (i >= 0) {
|
||||
if (!Character.isWhitespace(line.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
contentsEnd = i+1;
|
||||
|
||||
// Now do consistency check
|
||||
if (!((nameBegin < nameEnd) &&
|
||||
(nameEnd < contentsBegin) &&
|
||||
(contentsBegin < contentsEnd) &&
|
||||
(gotEquals == true))) {
|
||||
throw new FileFormatException(
|
||||
"Expected \"macroname = value\", " +
|
||||
"but found: " + line
|
||||
);
|
||||
}
|
||||
|
||||
String name = line.substring(nameBegin, nameEnd);
|
||||
String contents = line.substring(contentsBegin,
|
||||
contentsEnd);
|
||||
addMacro(name, contents);
|
||||
}
|
||||
}
|
||||
} while (line != null);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
/** This returns an Iterator of Macros. You should not mutate the
|
||||
returned Macro objects or use the Iterator to remove
|
||||
macros. */
|
||||
public Iterator getMacros() {
|
||||
return macros.iterator();
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, 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
|
||||
|
@ -47,7 +47,7 @@ public class Util {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
static String join(String padder, String v[]) {
|
||||
static String join(String padder, String v[]) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
for (int i=0; i<v.length; i++) {
|
||||
|
@ -80,9 +80,16 @@ public class Util {
|
|||
|
||||
|
||||
static String normalize(String file) {
|
||||
return file.replace('\\', '/');
|
||||
file = file.replace('\\', '/');
|
||||
if (file.length() > 2) {
|
||||
if (file.charAt(1) == ':' && file.charAt(2) == '/') {
|
||||
// convert drive letter to uppercase
|
||||
String drive = file.substring(0, 1).toUpperCase();
|
||||
return drive + file.substring(1);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
static String sep = File.separator;
|
||||
static String os = "Win32"; //System.getProperty("os.name");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2011, 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
|
||||
|
@ -235,13 +235,6 @@ public abstract class WinGammaPlatform {
|
|||
(locationsInTree.size() == 0)) {
|
||||
filesNotFound.add(fileName);
|
||||
} else if (locationsInTree.size() > 1) {
|
||||
// We shouldn't have duplicate file names in our workspace.
|
||||
System.err.println();
|
||||
System.err.println("There are multiple files named as: " + fileName);
|
||||
System.exit(-1);
|
||||
// The following code could be safely removed if we don't need duplicate
|
||||
// file names.
|
||||
|
||||
// Iterate through them, trying to find one with a
|
||||
// preferred path
|
||||
search:
|
||||
|
@ -336,7 +329,7 @@ public abstract class WinGammaPlatform {
|
|||
|
||||
String projectName = getProjectName(projectFileName, ext);
|
||||
|
||||
writeProjectFile(projectFileName, projectName, createAllConfigs());
|
||||
writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
|
||||
}
|
||||
|
||||
protected void writePrologue(String[] args) {
|
||||
|
@ -376,7 +369,13 @@ public abstract class WinGammaPlatform {
|
|||
HsArgHandler.STRING
|
||||
),
|
||||
|
||||
new HsArgRule("-projectFileName",
|
||||
new HsArgRule("-platformName",
|
||||
"PlatformName",
|
||||
null,
|
||||
HsArgHandler.STRING
|
||||
),
|
||||
|
||||
new HsArgRule("-projectFileName",
|
||||
"ProjectFileName",
|
||||
null,
|
||||
HsArgHandler.STRING
|
||||
|
@ -394,12 +393,6 @@ public abstract class WinGammaPlatform {
|
|||
HsArgHandler.STRING
|
||||
),
|
||||
|
||||
new HsArgRule("-platform",
|
||||
"Platform",
|
||||
null,
|
||||
HsArgHandler.STRING
|
||||
),
|
||||
|
||||
new HsArgRule("-absoluteInclude",
|
||||
"AbsoluteInclude",
|
||||
null,
|
||||
|
@ -590,28 +583,27 @@ public abstract class WinGammaPlatform {
|
|||
BuildConfig.putField(null, "PlatformObject", this);
|
||||
}
|
||||
|
||||
Vector createAllConfigs() {
|
||||
Vector createAllConfigs(String platform) {
|
||||
Vector allConfigs = new Vector();
|
||||
|
||||
allConfigs.add(new C1DebugConfig());
|
||||
|
||||
boolean b = true;
|
||||
if (b) {
|
||||
allConfigs.add(new C1FastDebugConfig());
|
||||
allConfigs.add(new C1ProductConfig());
|
||||
allConfigs.add(new C1FastDebugConfig());
|
||||
allConfigs.add(new C1ProductConfig());
|
||||
|
||||
allConfigs.add(new C2DebugConfig());
|
||||
allConfigs.add(new C2FastDebugConfig());
|
||||
allConfigs.add(new C2ProductConfig());
|
||||
allConfigs.add(new C2DebugConfig());
|
||||
allConfigs.add(new C2FastDebugConfig());
|
||||
allConfigs.add(new C2ProductConfig());
|
||||
|
||||
allConfigs.add(new TieredDebugConfig());
|
||||
allConfigs.add(new TieredFastDebugConfig());
|
||||
allConfigs.add(new TieredProductConfig());
|
||||
allConfigs.add(new TieredDebugConfig());
|
||||
allConfigs.add(new TieredFastDebugConfig());
|
||||
allConfigs.add(new TieredProductConfig());
|
||||
|
||||
allConfigs.add(new CoreDebugConfig());
|
||||
allConfigs.add(new CoreFastDebugConfig());
|
||||
allConfigs.add(new CoreProductConfig());
|
||||
allConfigs.add(new CoreDebugConfig());
|
||||
allConfigs.add(new CoreFastDebugConfig());
|
||||
allConfigs.add(new CoreProductConfig());
|
||||
|
||||
if (platform.equals("Win32")) {
|
||||
allConfigs.add(new KernelDebugConfig());
|
||||
allConfigs.add(new KernelFastDebugConfig());
|
||||
allConfigs.add(new KernelProductConfig());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, 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
|
||||
|
@ -223,7 +223,7 @@ class CompilerInterfaceVC6 extends CompilerInterface {
|
|||
return rv;
|
||||
}
|
||||
|
||||
Vector getBaseLinkerFlags(String outDir, String outDll) {
|
||||
Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
|
||||
Vector rv = new Vector();
|
||||
|
||||
rv.add("PROP Ignore_Export_Lib 0");
|
||||
|
@ -231,8 +231,12 @@ class CompilerInterfaceVC6 extends CompilerInterface {
|
|||
rv.add("ADD CPP /MD");
|
||||
rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " +
|
||||
" advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.lib");
|
||||
String machine = "/machine:I386";
|
||||
if (platformName.equals("x64")) {
|
||||
machine = "/machine:X64";
|
||||
}
|
||||
rv.add("ADD LINK32 /out:\""+outDll+"\" "+
|
||||
" /nologo /subsystem:windows /machine:I386" +
|
||||
" /nologo /subsystem:windows /machine:" + machine +
|
||||
" /nologo /base:\"0x8000000\" /subsystem:windows /dll" +
|
||||
" /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+
|
||||
" /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+
|
||||
|
@ -287,7 +291,7 @@ class CompilerInterfaceVC6 extends CompilerInterface {
|
|||
return "d";
|
||||
}
|
||||
|
||||
String makeCfgName(String flavourBuild) {
|
||||
return "vm - "+ Util.os + " " + flavourBuild;
|
||||
String makeCfgName(String flavourBuild, String platform) {
|
||||
return "vm - "+ platform + " " + flavourBuild;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, 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
|
||||
|
@ -37,7 +37,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
|
|||
public void writeProjectFile(String projectFileName, String projectName,
|
||||
Vector allConfigs) throws IOException {
|
||||
System.out.println();
|
||||
System.out.println(" Writing .vcproj file...");
|
||||
System.out.println(" Writing .vcproj file: "+projectFileName);
|
||||
// If we got this far without an error, we're safe to actually
|
||||
// write the .vcproj file
|
||||
printWriter = new PrintWriter(new FileWriter(projectFileName));
|
||||
|
@ -54,9 +54,8 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
|
|||
"SccLocalPath", ""
|
||||
}
|
||||
);
|
||||
|
||||
startTag("Platforms", null);
|
||||
tag("Platform", new String[] {"Name", Util.os});
|
||||
tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")});
|
||||
endTag("Platforms");
|
||||
|
||||
startTag("Configurations", null);
|
||||
|
@ -81,12 +80,47 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
|
|||
|
||||
|
||||
abstract class NameFilter {
|
||||
protected String fname;
|
||||
protected String fname;
|
||||
|
||||
abstract boolean match(FileInfo fi);
|
||||
|
||||
String filterString() { return ""; }
|
||||
String name() { return this.fname;}
|
||||
|
||||
@Override
|
||||
// eclipse auto-generated
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + getOuterType().hashCode();
|
||||
result = prime * result + ((fname == null) ? 0 : fname.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
// eclipse auto-generated
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
NameFilter other = (NameFilter) obj;
|
||||
if (!getOuterType().equals(other.getOuterType()))
|
||||
return false;
|
||||
if (fname == null) {
|
||||
if (other.fname != null)
|
||||
return false;
|
||||
} else if (!fname.equals(other.fname))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// eclipse auto-generated
|
||||
private WinGammaPlatformVC7 getOuterType() {
|
||||
return WinGammaPlatformVC7.this;
|
||||
}
|
||||
}
|
||||
|
||||
class DirectoryFilter extends NameFilter {
|
||||
|
@ -109,9 +143,50 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
|
|||
|
||||
|
||||
boolean match(FileInfo fi) {
|
||||
int lastSlashIndex = fi.full.lastIndexOf('/');
|
||||
String fullDir = fi.full.substring(0, lastSlashIndex);
|
||||
return fullDir.endsWith(dir);
|
||||
int lastSlashIndex = fi.full.lastIndexOf('/');
|
||||
String fullDir = fi.full.substring(0, lastSlashIndex);
|
||||
return fullDir.endsWith(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
// eclipse auto-generated
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + getOuterType().hashCode();
|
||||
result = prime * result + baseLen;
|
||||
result = prime * result + ((dir == null) ? 0 : dir.hashCode());
|
||||
result = prime * result + dirLen;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
// eclipse auto-generated
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
DirectoryFilter other = (DirectoryFilter) obj;
|
||||
if (!getOuterType().equals(other.getOuterType()))
|
||||
return false;
|
||||
if (baseLen != other.baseLen)
|
||||
return false;
|
||||
if (dir == null) {
|
||||
if (other.dir != null)
|
||||
return false;
|
||||
} else if (!dir.equals(other.dir))
|
||||
return false;
|
||||
if (dirLen != other.dirLen)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// eclipse auto-generated
|
||||
private WinGammaPlatformVC7 getOuterType() {
|
||||
return WinGammaPlatformVC7.this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,32 +307,39 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
|
|||
DirectoryFilter container = null;
|
||||
for(FileInfo fileInfo : files) {
|
||||
|
||||
if (!fileInfo.full.startsWith(sbase)) {
|
||||
continue;
|
||||
}
|
||||
if (!fileInfo.full.startsWith(sbase)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int lastSlash = fileInfo.full.lastIndexOf('/');
|
||||
String dir = fileInfo.full.substring(sbase.length(), lastSlash);
|
||||
if(dir.equals("share/vm")) {
|
||||
// skip files directly in share/vm - should only be precompiled.hpp which is handled below
|
||||
continue;
|
||||
}
|
||||
if (!dir.equals(currentDir)) {
|
||||
currentDir = dir;
|
||||
if (container != null) {
|
||||
rv.add(container);
|
||||
}
|
||||
int lastSlash = fileInfo.full.lastIndexOf('/');
|
||||
String dir = fileInfo.full.substring(sbase.length(), lastSlash);
|
||||
if(dir.equals("share/vm")) {
|
||||
// skip files directly in share/vm - should only be precompiled.hpp which is handled below
|
||||
continue;
|
||||
}
|
||||
if (!dir.equals(currentDir)) {
|
||||
currentDir = dir;
|
||||
if (container != null && !rv.contains(container)) {
|
||||
rv.add(container);
|
||||
}
|
||||
|
||||
// remove "share/vm/" from names
|
||||
String name = dir;
|
||||
if (dir.startsWith("share/vm/")) {
|
||||
name = dir.substring("share/vm/".length(), dir.length());
|
||||
}
|
||||
container = new DirectoryFilter(name, dir, sbase);
|
||||
}
|
||||
// remove "share/vm/" from names
|
||||
String name = dir;
|
||||
if (dir.startsWith("share/vm/")) {
|
||||
name = dir.substring("share/vm/".length(), dir.length());
|
||||
}
|
||||
DirectoryFilter newfilter = new DirectoryFilter(name, dir, sbase);
|
||||
int i = rv.indexOf(newfilter);
|
||||
if(i == -1) {
|
||||
container = newfilter;
|
||||
} else {
|
||||
// if the filter already exists, reuse it
|
||||
container = (DirectoryFilter) rv.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (container != null) {
|
||||
rv.add(container);
|
||||
if (container != null && !rv.contains(container)) {
|
||||
rv.add(container);
|
||||
}
|
||||
|
||||
ContainerFilter generated = new ContainerFilter("Generated");
|
||||
|
@ -583,7 +665,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
|
|||
return rv;
|
||||
}
|
||||
|
||||
Vector getBaseLinkerFlags(String outDir, String outDll) {
|
||||
Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
|
||||
Vector rv = new Vector();
|
||||
|
||||
addAttr(rv, "Name", "VCLinkerTool");
|
||||
|
@ -610,8 +692,13 @@ class CompilerInterfaceVC7 extends CompilerInterface {
|
|||
addAttr(rv, "SubSystem", "2");
|
||||
addAttr(rv, "BaseAddress", "0x8000000");
|
||||
addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
|
||||
// Set /MACHINE option. 1 is machineX86
|
||||
addAttr(rv, "TargetMachine", "1");
|
||||
if(platformName.equals("Win32")) {
|
||||
// Set /MACHINE option. 1 is X86
|
||||
addAttr(rv, "TargetMachine", "1");
|
||||
} else {
|
||||
// Set /MACHINE option. 17 is X64
|
||||
addAttr(rv, "TargetMachine", "17");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -656,12 +743,6 @@ class CompilerInterfaceVC7 extends CompilerInterface {
|
|||
addAttr(rv, "Optimization", "2");
|
||||
// Set /Oy- option
|
||||
addAttr(rv, "OmitFramePointers", "FALSE");
|
||||
}
|
||||
|
||||
Vector getProductCompilerFlags() {
|
||||
Vector rv = new Vector();
|
||||
|
||||
getProductCompilerFlags_common(rv);
|
||||
// Set /Ob option. 1 is expandOnlyInline
|
||||
addAttr(rv, "InlineFunctionExpansion", "1");
|
||||
// Set /GF option.
|
||||
|
@ -670,6 +751,12 @@ class CompilerInterfaceVC7 extends CompilerInterface {
|
|||
addAttr(rv, "RuntimeLibrary", "2");
|
||||
// Set /Gy option
|
||||
addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
|
||||
}
|
||||
|
||||
Vector getProductCompilerFlags() {
|
||||
Vector rv = new Vector();
|
||||
|
||||
getProductCompilerFlags_common(rv);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -693,7 +780,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
|
|||
return "0";
|
||||
}
|
||||
|
||||
String makeCfgName(String flavourBuild) {
|
||||
return flavourBuild + "|" + Util.os;
|
||||
String makeCfgName(String flavourBuild, String platform) {
|
||||
return flavourBuild + "|" + platform;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue