1.1 --- a/src/share/tools/ProjectCreator/BuildConfig.java Thu Feb 10 12:55:56 2011 +0100 1.2 +++ b/src/share/tools/ProjectCreator/BuildConfig.java Thu Feb 10 13:03:22 2011 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -51,12 +51,14 @@ 1.11 if (vars == null) vars = new Hashtable(); 1.12 1.13 String flavourBuild = flavour + "_" + build; 1.14 + String platformName = getFieldString(null, "PlatformName"); 1.15 System.out.println(); 1.16 System.out.println(flavourBuild); 1.17 1.18 - put("Name", getCI().makeCfgName(flavourBuild)); 1.19 + put("Name", getCI().makeCfgName(flavourBuild, platformName)); 1.20 put("Flavour", flavour); 1.21 put("Build", build); 1.22 + put("PlatformName", platformName); 1.23 1.24 // ones mentioned above were needed to expand format 1.25 String buildBase = expandFormat(getFieldString(null, "BuildBase")); 1.26 @@ -93,7 +95,7 @@ 1.27 protected void initDefaultLinkerFlags() { 1.28 Vector linkerFlags = new Vector(); 1.29 1.30 - linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"))); 1.31 + linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); 1.32 1.33 put("LinkerFlags", linkerFlags); 1.34 } 1.35 @@ -115,18 +117,15 @@ 1.36 } 1.37 1.38 1.39 - Vector getPreferredPaths(MacroDefinitions macros) { 1.40 + Vector getPreferredPaths() { 1.41 Vector preferredPaths = new Vector(); 1.42 + 1.43 // In the case of multiple files with the same name in 1.44 - // different subdirectories, prefer the versions specified in 1.45 - // the platform file as the "os_family" and "arch" macros. 1.46 - for (Iterator iter = macros.getMacros(); iter.hasNext(); ) { 1.47 - Macro macro = (Macro) iter.next(); 1.48 - if (macro.name.equals("os_family") || 1.49 - macro.name.equals("arch")) { 1.50 - preferredPaths.add(macro.contents); 1.51 - } 1.52 - } 1.53 + // different subdirectories, prefer these versions 1.54 + preferredPaths.add("windows"); 1.55 + preferredPaths.add("x86"); 1.56 + preferredPaths.add("closed"); 1.57 + 1.58 // Also prefer "opto" over "adlc" for adlcVMDeps.hpp 1.59 preferredPaths.add("opto"); 1.60 1.61 @@ -137,18 +136,7 @@ 1.62 void handleDB() { 1.63 WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); 1.64 1.65 - File incls = new File(get("OutputDir")+Util.sep+"incls"); 1.66 - 1.67 - incls.mkdirs(); 1.68 - 1.69 - MacroDefinitions macros = new MacroDefinitions(); 1.70 - try { 1.71 - macros.readFrom(getFieldString(null, "Platform"), false); 1.72 - } catch (Exception e) { 1.73 - throw new RuntimeException(e); 1.74 - } 1.75 - 1.76 - putSpecificField("AllFilesHash", computeAllFiles(platform, macros)); 1.77 + putSpecificField("AllFilesHash", computeAllFiles(platform)); 1.78 } 1.79 1.80 1.81 @@ -190,10 +178,10 @@ 1.82 ht.put(expandFormat(key), expandFormat(value)); 1.83 } 1.84 1.85 - Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) { 1.86 + Hashtable computeAllFiles(WinGammaPlatform platform) { 1.87 Hashtable rv = new Hashtable(); 1.88 DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); 1.89 - Vector preferredPaths = getPreferredPaths(macros); 1.90 + Vector preferredPaths = getPreferredPaths(); 1.91 1.92 // Hold errors until end 1.93 Vector filesNotFound = new Vector(); 1.94 @@ -228,8 +216,7 @@ 1.95 System.err.println("Error: some files were not found or " + 1.96 "appeared in multiple subdirectories of " + 1.97 "directory " + get("SourceBase") + " and could not " + 1.98 - "be resolved with the os_family and arch " + 1.99 - "macros in the platform file."); 1.100 + "be resolved with os_family and arch."); 1.101 if (filesNotFound.size() != 0) { 1.102 System.err.println("Files not found:"); 1.103 for (Iterator iter = filesNotFound.iterator(); 1.104 @@ -254,10 +241,14 @@ 1.105 Vector sysDefines = new Vector(); 1.106 sysDefines.add("WIN32"); 1.107 sysDefines.add("_WINDOWS"); 1.108 - sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name")); 1.109 + sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); 1.110 sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); 1.111 sysDefines.add("_JNI_IMPLEMENTATION_"); 1.112 - sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); 1.113 + if (vars.get("PlatformName").equals("Win32")) { 1.114 + sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); 1.115 + } else { 1.116 + sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); 1.117 + } 1.118 1.119 sysDefines.addAll(defines); 1.120 1.121 @@ -710,7 +701,7 @@ 1.122 } 1.123 abstract class CompilerInterface { 1.124 abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); 1.125 - abstract Vector getBaseLinkerFlags(String outDir, String outDll); 1.126 + abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); 1.127 abstract Vector getDebugCompilerFlags(String opt); 1.128 abstract Vector getDebugLinkerFlags(); 1.129 abstract void getAdditionalNonKernelLinkerFlags(Vector rv); 1.130 @@ -718,7 +709,7 @@ 1.131 abstract Vector getProductLinkerFlags(); 1.132 abstract String getOptFlag(); 1.133 abstract String getNoOptFlag(); 1.134 - abstract String makeCfgName(String flavourBuild); 1.135 + abstract String makeCfgName(String flavourBuild, String platformName); 1.136 1.137 void addAttr(Vector receiver, String attr, String value) { 1.138 receiver.add(attr); receiver.add(value);