aboutsummaryrefslogtreecommitdiff
path: root/src/share/tools
diff options
context:
space:
mode:
authorstefank <none@none>2010-11-23 13:22:55 -0800
committerstefank <none@none>2010-11-23 13:22:55 -0800
commit957babe3873e55a43e5e31914c6555956243dec9 (patch)
treecd2f2252bf37499ed57b7bcbf68329e4250c462d /src/share/tools
parent4760cb2376099596852af8c70a671705077c8624 (diff)
downloadjdk8u_hotspot-957babe3873e55a43e5e31914c6555956243dec9.tar.gz
6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
Diffstat (limited to 'src/share/tools')
-rw-r--r--src/share/tools/MakeDeps/Database.java552
-rw-r--r--src/share/tools/MakeDeps/FileList.java263
-rw-r--r--src/share/tools/MakeDeps/FileName.java119
-rw-r--r--src/share/tools/MakeDeps/MakeDeps.java236
-rw-r--r--src/share/tools/MakeDeps/MetroWerksMacPlatform.java70
-rw-r--r--src/share/tools/MakeDeps/Platform.java185
-rw-r--r--src/share/tools/MakeDeps/UnixPlatform.java80
-rw-r--r--src/share/tools/ProjectCreator/ArgsParser.java (renamed from src/share/tools/MakeDeps/ArgsParser.java)2
-rw-r--r--src/share/tools/ProjectCreator/BuildConfig.java (renamed from src/share/tools/MakeDeps/BuildConfig.java)101
-rw-r--r--src/share/tools/ProjectCreator/DirectoryTree.java (renamed from src/share/tools/MakeDeps/DirectoryTree.java)50
-rw-r--r--src/share/tools/ProjectCreator/DirectoryTreeNode.java (renamed from src/share/tools/MakeDeps/DirectoryTreeNode.java)2
-rw-r--r--src/share/tools/ProjectCreator/FileFormatException.java (renamed from src/share/tools/MakeDeps/FileFormatException.java)2
-rw-r--r--src/share/tools/ProjectCreator/Macro.java (renamed from src/share/tools/MakeDeps/Macro.java)2
-rw-r--r--src/share/tools/ProjectCreator/MacroDefinitions.java (renamed from src/share/tools/MakeDeps/MacroDefinitions.java)104
-rw-r--r--src/share/tools/ProjectCreator/ProjectCreator.java98
-rw-r--r--src/share/tools/ProjectCreator/Util.java (renamed from src/share/tools/MakeDeps/Util.java)2
-rw-r--r--src/share/tools/ProjectCreator/WinGammaPlatform.java (renamed from src/share/tools/MakeDeps/WinGammaPlatform.java)98
-rw-r--r--src/share/tools/ProjectCreator/WinGammaPlatformVC6.java (renamed from src/share/tools/MakeDeps/WinGammaPlatformVC6.java)2
-rw-r--r--src/share/tools/ProjectCreator/WinGammaPlatformVC7.java (renamed from src/share/tools/MakeDeps/WinGammaPlatformVC7.java)68
-rw-r--r--src/share/tools/ProjectCreator/WinGammaPlatformVC8.java (renamed from src/share/tools/MakeDeps/WinGammaPlatformVC8.java)3
-rw-r--r--src/share/tools/ProjectCreator/WinGammaPlatformVC9.java (renamed from src/share/tools/MakeDeps/WinGammaPlatformVC9.java)5
-rw-r--r--src/share/tools/hsdis/hsdis-demo.c4
-rw-r--r--src/share/tools/hsdis/hsdis.c4
-rw-r--r--src/share/tools/hsdis/hsdis.h2
24 files changed, 272 insertions, 1782 deletions
diff --git a/src/share/tools/MakeDeps/Database.java b/src/share/tools/MakeDeps/Database.java
deleted file mode 100644
index 2a19c29f0..000000000
--- a/src/share/tools/MakeDeps/Database.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 1999, 2009, 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 Database {
- private MacroDefinitions macros;
- // allFiles is kept in lexicographically sorted order. See get().
- private FileList allFiles;
- // files that have implicit dependency on platform files
- // e.g. os.hpp: os_<os_family>.hpp os_<os_arch>.hpp but only
- // recorded if the platform file was seen.
- private FileList platformFiles;
- private FileList outerFiles;
- private FileList indivIncludes;
- private FileList grandInclude; // the results for the grand include file
- private HashMap<String,String> platformDepFiles;
- private long threshold;
- private int nOuterFiles;
- private boolean missingOk;
- private Platform plat;
- /** These allow you to specify files not in the include database
- which are prepended and appended to the file list, allowing
- you to have well-known functions at the start and end of the
- text segment (allows us to find out in a portable fashion
- whether the current PC is in VM code or not upon a crash) */
- private String firstFile;
- private String lastFile;
-
- public Database(Platform plat, long t) {
- this.plat = plat;
- macros = new MacroDefinitions();
- allFiles = new FileList("allFiles", plat);
- platformFiles = new FileList("platformFiles", plat);
- outerFiles = new FileList("outerFiles", plat);
- indivIncludes = new FileList("IndivIncludes", plat);
- grandInclude = new FileList(plat.getGIFileTemplate().nameOfList(), plat);
- platformDepFiles = new HashMap<String,String>();
-
- threshold = t;
- nOuterFiles = 0;
- missingOk = false;
- firstFile = null;
- lastFile = null;
- };
-
- public FileList getAllFiles() {
- return allFiles;
- }
-
- public Iterator getMacros() {
- return macros.getMacros();
- }
-
- public void canBeMissing() {
- missingOk = true;
- }
-
- public boolean hfileIsInGrandInclude(FileList hfile, FileList cfile) {
- return ((hfile.getCount() >= threshold) && (cfile.getUseGrandInclude()));
- }
-
- /** These allow you to specify files not in the include database
- which are prepended and appended to the file list, allowing
- you to have well-known functions at the start and end of the
- text segment (allows us to find out in a portable fashion
- whether the current PC is in VM code or not upon a crash) */
- public void setFirstFile(String fileName) {
- firstFile = fileName;
- }
-
- public void setLastFile(String fileName) {
- lastFile = fileName;
- }
-
- public void get(String platFileName, String dbFileName)
- throws FileFormatException, IOException, FileNotFoundException {
- macros.readFrom(platFileName, missingOk);
-
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(dbFileName));
- } catch (FileNotFoundException e) {
- if (missingOk) {
- return;
- } else {
- throw(e);
- }
- }
- System.out.println("\treading database: " + dbFileName);
- String line;
- int lineNo = 0;
- do {
- line = reader.readLine();
- lineNo++;
- if (line != null) {
- StreamTokenizer tokenizer =
- new StreamTokenizer(new StringReader(line));
- tokenizer.slashSlashComments(true);
- tokenizer.wordChars('_', '_');
- tokenizer.wordChars('<', '>');
- // NOTE: if we didn't have to do this line by line,
- // we could trivially recognize C-style comments as
- // well.
- // tokenizer.slashStarComments(true);
- int numTok = 0;
- int res;
- String unexpandedIncluder = null;
- String unexpandedIncludee = null;
- do {
- res = tokenizer.nextToken();
- if (res != StreamTokenizer.TT_EOF) {
- if (numTok == 0) {
- unexpandedIncluder = tokenizer.sval;
- } else if (numTok == 1) {
- unexpandedIncludee = tokenizer.sval;
- } else {
- throw new FileFormatException(
- "invalid line: \"" + line +
- "\". Error position: line " + lineNo
- );
- }
- numTok++;
- }
- } while (res != StreamTokenizer.TT_EOF);
-
- if ((numTok != 0) && (numTok != 2)) {
- throw new FileFormatException(
- "invalid line: \"" + line +
- "\". Error position: line " + lineNo
- );
- }
-
- if (numTok == 2) {
- // Non-empty line
- String includer = macros.expand(unexpandedIncluder);
- String includee = macros.expand(unexpandedIncludee);
-
- if (includee.equals(plat.generatePlatformDependentInclude())) {
- MacroDefinitions localExpander = macros.copy();
- MacroDefinitions localExpander2 = macros.copy();
- localExpander.setAllMacroBodiesTo("pd");
- localExpander2.setAllMacroBodiesTo("");
-
- // unexpanded_includer e.g. thread_<os_arch>.hpp
- // thread_solaris_i486.hpp -> _thread_pd.hpp.incl
-
- FileName pdName =
- plat.getInclFileTemplate().copyStem(
- localExpander.expand(unexpandedIncluder)
- );
-
- // derive generic name from platform specific name
- // e.g. os_<arch_os>.hpp => os.hpp. We enforce the
- // restriction (imperfectly) noted in includeDB_core
- // that platform specific files will have an underscore
- // preceding the macro invocation.
-
- // First expand macro as null string.
-
- String newIncluder_temp =
- localExpander2.expand(unexpandedIncluder);
-
- // Now find "_." and remove the underscore.
-
- String newIncluder = "";
-
- int len = newIncluder_temp.length();
- int count = 0;
-
- for ( int i = 0; i < len - 1 ; i++ ) {
- if (newIncluder_temp.charAt(i) == '_' && newIncluder_temp.charAt(i+1) == '.') {
- count++;
- } else {
- newIncluder += newIncluder_temp.charAt(i);
- }
- }
- newIncluder += newIncluder_temp.charAt(len-1);
-
- if (count != 1) {
- throw new FileFormatException(
- "Unexpected filename format for platform dependent file.\nline: \"" + line +
- "\".\nError position: line " + lineNo
- );
- }
-
- FileList p = allFiles.listForFile(includer);
- p.setPlatformDependentInclude(pdName.dirPreStemSuff());
-
- // Record the implicit include of this file so that the
- // dependencies for precompiled headers can mention it.
- platformDepFiles.put(newIncluder, includer);
-
- // Add an implicit dependency on platform
- // specific file for the generic file
-
- p = platformFiles.listForFile(newIncluder);
-
- // if this list is empty then this is 1st
- // occurance of a platform dependent file and
- // we need a new version of the include file.
- // Otherwise we just append to the current
- // file.
-
- PrintWriter pdFile =
- new PrintWriter(
- new FileWriter(pdName.dirPreStemSuff(),
- !p.isEmpty())
- );
- pdFile.println("# include \"" + includer + "\"");
- pdFile.close();
-
- // Add the platform specific file to the list
- // for this generic file.
-
- FileList q = allFiles.listForFile(includer);
- p.addIfAbsent(q);
- } else {
- FileList p = allFiles.listForFile(includer);
- if (isOuterFile(includer))
- outerFiles.addIfAbsent(p);
-
- if (includee.equals(plat.noGrandInclude())) {
- p.setUseGrandInclude(false);
- } else {
- FileList q = allFiles.listForFile(includee);
- p.addIfAbsent(q);
- }
- }
- }
- }
- } while (line != null);
- reader.close();
-
- // Keep allFiles in well-known order so we can easily determine
- // whether the known files are the same
- allFiles.sortByName();
-
- // Add first and last files differently to prevent a mistake
- // in ordering in the include databases from breaking the
- // error reporting in the VM.
- if (firstFile != null) {
- FileList p = allFiles.listForFile(firstFile);
- allFiles.setFirstFile(p);
- outerFiles.setFirstFile(p);
- }
-
- if (lastFile != null) {
- FileList p = allFiles.listForFile(lastFile);
- allFiles.setLastFile(p);
- outerFiles.setLastFile(p);
- }
- }
-
- public void compute() {
- System.out.println("\tcomputing closures\n");
- // build both indiv and grand results
- for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
- indivIncludes.add(((FileList) iter.next()).doCFile());
- ++nOuterFiles;
- }
-
- if (!plat.haveGrandInclude())
- return; // nothing in grand include
-
- // count how many times each include is included & add em to grand
- for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
- FileList indivInclude = (FileList) iter.next();
- if (!indivInclude.getUseGrandInclude()) {
- continue; // do not bump count if my files cannot be
- // in grand include
- }
- indivInclude.doFiles(grandInclude); // put em on
- // grand_include list
- for (Iterator incListIter = indivInclude.iterator();
- incListIter.hasNext(); ) {
- ((FileList) incListIter.next()).incrementCount();
- }
- }
- }
-
- // Not sure this is necessary in Java
- public void verify() {
- for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
- if (iter.next() == null) {
- plat.abort();
- }
- }
- }
-
- public void put() throws IOException {
- writeIndividualIncludes();
-
- if (plat.haveGrandInclude())
- writeGrandInclude();
-
- writeGrandUnixMakefile();
- }
-
- private void writeIndividualIncludes() throws IOException {
- System.out.println("\twriting individual include files\n");
-
- for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
- FileList list = (FileList) iter.next();
- System.out.println("\tcreating " + list.getName());
- list.putInclFile(this);
- }
- }
-
- private void writeGrandInclude() throws IOException {
- System.out.println("\twriting grand include file\n");
- PrintWriter inclFile =
- new PrintWriter(new FileWriter(plat.getGIFileTemplate().dirPreStemSuff()));
- plat.writeGIPragma(inclFile);
- for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) {
- FileList list = (FileList) iter.next();
- if (list.getCount() >= threshold) {
- inclFile.println("# include \"" +
- plat.getGIFileTemplate().getInvDir() +
- list.getName() +
- "\"");
- }
- }
- inclFile.println();
- inclFile.close();
- }
-
- private void writeGrandUnixMakefile() throws IOException {
- if (!plat.writeDeps())
- return;
-
- System.out.println("\twriting dependencies file\n");
- PrintWriter gd =
- new PrintWriter(new FileWriter(
- plat.getGDFileTemplate().dirPreStemSuff())
- );
- gd.println("# generated by makeDeps");
- gd.println();
-
-
- // HACK ALERT. The compilation of ad_<arch> files is very slow.
- // We want to start compiling them as early as possible. The compilation
- // order on unix is dependent on the order we emit files here.
- // By sorting the output before emitting it, we expect
- // that ad_<arch> will be compiled early.
- boolean shouldSortObjFiles = true;
-
- if (shouldSortObjFiles) {
- ArrayList sortList = new ArrayList();
-
- // We need to preserve the ordering of the first and last items
- // in outerFiles.
- int size = outerFiles.size() - 1;
- String firstName = removeSuffixFrom(((FileList)outerFiles.get(0)).getName());
- String lastName = removeSuffixFrom(((FileList)outerFiles.get(size)).getName());
-
- for (int i=1; i<size; i++) {
- FileList anOuterFile = (FileList)outerFiles.get(i);
- String stemName = removeSuffixFrom(anOuterFile.getName());
- sortList.add(stemName);
- }
- Collections.sort(sortList);
-
- // write Obj_Files = ...
- gd.println("Obj_Files = \\");
- gd.println(firstName + plat.objFileSuffix() + " \\");
- for (Iterator iter = sortList.iterator(); iter.hasNext(); ) {
- gd.println(iter.next() + plat.objFileSuffix() + " \\");
- }
- gd.println(lastName + plat.objFileSuffix() + " \\");
- gd.println();
- gd.println();
- } else {
- // write Obj_Files = ...
- gd.println("Obj_Files = \\");
- for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
- FileList anOuterFile = (FileList) iter.next();
-
- String stemName = removeSuffixFrom(anOuterFile.getName());
- gd.println(stemName + plat.objFileSuffix() + " \\");
- }
- gd.println();
- gd.println();
- }
-
- // write Precompiled_Files = ...
- gd.println("Precompiled_Files = \\");
- for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) {
- FileList list = (FileList) iter.next();
- if (list.getCount() >= threshold) {
- gd.println(list.getName() + " \\");
- String platformDep = platformDepFiles.get(list.getName());
- if (platformDep != null) {
- // make sure changes to the platform dependent file will
- // cause regeneration of the pch file.
- gd.println(platformDep + " \\");
- }
- }
- }
- gd.println();
- gd.println();
-
- gd.println("DTraced_Files = \\");
- for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) {
- FileList anOuterFile = (FileList) iter.next();
-
- if (anOuterFile.hasListForFile("dtrace.hpp")) {
- String stemName = removeSuffixFrom(anOuterFile.getName());
- gd.println(stemName + plat.objFileSuffix() + " \\");
- }
- }
- gd.println();
- gd.println();
-
- {
- // write each dependency
-
- for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) {
-
- FileList anII = (FileList) iter.next();
-
- String stemName = removeSuffixFrom(anII.getName());
- String inclFileName =
- plat.getInclFileTemplate().copyStem(anII.getName()).
- preStemSuff();
-
- gd.println(stemName + plat.objFileSuffix() + " " +
- stemName + plat.asmFileSuffix() + ": \\");
-
- printDependentOn(gd, anII.getName());
- // this gets the include file that includes all that
- // this file needs (first level) since nested includes
- // are skipped to avoid cycles.
- printDependentOn(gd, inclFileName);
-
- if ( plat.haveGrandInclude() ) {
- printDependentOn(gd,
- plat.getGIFileTemplate().preStemSuff());
- }
-
- for (Iterator iiIter = anII.iterator(); iiIter.hasNext(); ) {
- FileList hfile = (FileList) iiIter.next();
- if (!hfileIsInGrandInclude(hfile, anII) ||
- plat.writeDependenciesOnHFilesFromGI()) {
- printDependentOn(gd, hfile.getName());
- }
- if (platformFiles.hasListForFile(hfile.getName())) {
- FileList p =
- platformFiles.listForFile(hfile.getName());;
- for (Iterator hiIter = p.iterator();
- hiIter.hasNext(); ) {
- FileList hi2 = (FileList) hiIter.next();
- if (!hfileIsInGrandInclude(hi2, p)) {
- printDependentOn(gd, hi2.getName());
- }
- }
- }
- }
-
- if (plat.includeGIDependencies()
- && anII.getUseGrandInclude()) {
- gd.println(" $(Precompiled_Files) \\");
- }
- gd.println();
- gd.println();
- }
- }
-
- gd.close();
- }
-
- public void putDiffs(Database previous) throws IOException {
- System.out.println("\tupdating output files\n");
-
- if (!indivIncludes.compareLists(previous.indivIncludes)
- || !grandInclude.compareLists(previous.grandInclude)) {
- System.out.println("The order of .c or .s has changed, or " +
- "the grand include file has changed.");
- put();
- return;
- }
-
- Iterator curIter = indivIncludes.iterator();
- Iterator prevIter = previous.indivIncludes.iterator();
-
- try {
- while (curIter.hasNext()) {
- FileList newCFileList = (FileList) curIter.next();
- FileList prevCFileList = (FileList) prevIter.next();
- if (!newCFileList.compareLists(prevCFileList)) {
- System.out.println("\tupdating " + newCFileList.getName());
- newCFileList.putInclFile(this);
- }
- }
- }
- catch (Exception e) {
- throw new InternalError("assertion failure: cur and prev " +
- "database lists changed unexpectedly.");
- }
-
- writeGrandUnixMakefile();
- }
-
- private void printDependentOn(PrintWriter gd, String name) {
- gd.print(" ");
- gd.print(plat.dependentPrefix() + name);
- }
-
- private boolean isOuterFile(String s) {
- int len = s.length();
- String[] suffixes = plat.outerSuffixes();
- for (int i = 0; i < suffixes.length; i++) {
- String suffix = suffixes[i];
- int suffLen = suffix.length();
- if ((len >= suffLen) &&
- (plat.fileNameStringEquality(s.substring(len - suffLen),
- suffix))) {
- return true;
- }
- }
- return false;
- }
-
- private String removeSuffixFrom(String s) {
- int idx = s.lastIndexOf('.');
- if (idx <= 0)
- plat.abort();
- return s.substring(0, idx);
- }
-}
diff --git a/src/share/tools/MakeDeps/FileList.java b/src/share/tools/MakeDeps/FileList.java
deleted file mode 100644
index 633d9bf18..000000000
--- a/src/share/tools/MakeDeps/FileList.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1999, 2000, 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.*;
-
-/** This class implements the java.util.List interface as well as
- providing functionality specific to keeping track of lists of
- files. See the documentation for the Database class to see how
- these are used. Each FileList must only contain other FileLists
- (although that is not currently enforced in the mutators). */
-
-public class FileList extends Vector {
- private String name; // (also the file name)
- private boolean beenHere;
- private boolean mayBeCycle;
- private boolean isCycle;
- /** Put in list because a file can refuse to */
- private boolean useGrandInclude;
- private String platformDependentInclude;
- private int count;
- private Platform plat;
-
- public FileList(String n, Platform plat) {
- super();
- this.plat = plat;
- beenHere = mayBeCycle = isCycle = false;
- platformDependentInclude = null;
- name = n;
- count = 0;
- useGrandInclude = plat.haveGrandInclude();
- }
-
- // Change definition of equality from AbstractList so remove() works properly
- public boolean equals(Object o) {
- return ((Object) this) == o;
- }
-
- // Necessary accessors
- public String getName() {
- return name;
- }
-
- public void setPlatformDependentInclude(String arg) {
- platformDependentInclude = arg;
- }
-
- public String getPlatformDependentInclude() {
- return platformDependentInclude;
- }
-
- public boolean getUseGrandInclude() {
- return useGrandInclude;
- }
-
- public void setUseGrandInclude(boolean arg) {
- useGrandInclude = arg;
- }
-
- public void incrementCount() {
- count++;
- }
-
- public int getCount() {
- return count;
- }
-
- public FileList listForFile(String fileName) {
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- FileList fl = (FileList) iter.next();
- if (plat.fileNameStringEquality(fl.name, fileName)) {
- plat.fileNamePortabilityCheck(fl.name, fileName);
- return fl;
- }
- }
- plat.fileNamePortabilityCheck(fileName);
- FileList newList = new FileList(fileName, plat);
- add(newList);
- return newList;
- }
-
- public boolean hasListForFile(String fileName) {
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- FileList fl = (FileList) iter.next();
- if (plat.fileNameStringEquality(fl.name, fileName)) {
- plat.fileNamePortabilityCheck(fl.name, fileName);
- return true;
- }
- }
- return false;
- }
-
- public boolean compareLists(FileList s) {
- Iterator myIter = iterator();
- Iterator hisIter = s.iterator();
-
- while (myIter.hasNext() &&
- hisIter.hasNext()) {
- // crude: order dependent
- FileList myElement = (FileList) myIter.next();
- FileList hisElement = (FileList) hisIter.next();
- if (!plat.fileNameStringEquality(myElement.name,
- hisElement.name)) {
- return false;
- }
- }
-
- if (myIter.hasNext() != hisIter.hasNext()) {
- // One ended earlier
- return false;
- }
-
- return true;
- }
-
- public void addIfAbsent(FileList s) {
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- if (iter.next() == s) {
- return;
- }
- }
- add(s);
- }
-
- public void sortByName() {
- Collections.sort(this, new Comparator() {
- public int compare(Object o1, Object o2) {
- FileList fl1 = (FileList) o1;
- FileList fl2 = (FileList) o2;
- return fl1.getName().compareTo(fl2.getName());
- }
- });
- }
-
- public void setFirstFile(FileList s) {
- // Remove the file list if it's already here
- remove(s);
- add(0, s);
- }
-
- public void setLastFile(FileList s) {
- // Remove the file list if it's already here
- remove(s);
- add(s);
- }
-
- public boolean doFiles(FileList s) {
- boolean result = true;
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- FileList h = (FileList) iter.next();
- if (h.platformDependentInclude != null) {
- System.err.println("Error: the source for " +
- h.platformDependentInclude +
- " is " + h.name + ".");
- System.err.println("\tIt shouldn't be included directly by " +
- name + ".");
- h.platformDependentInclude = null; // report once per file
- result = false;
- }
- h.doHFile(s);
- }
- return result;
- }
-
- public void traceCycle(FileList s) {
- if (isCycle) // already traced
- return;
- isCycle = true;
- System.err.println("\ttracing cycle for " + name);
- // FIXME: must return status in caller routine
- // exitCode = 1;
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- FileList q = (FileList) iter.next();
- if (q.mayBeCycle) {
- if (s == q) {
- plat.fatalError("\tend of cycle for " + s.getName());
- } else {
- q.traceCycle(s);
- }
- }
- }
- }
-
- public void doHFile(FileList s) {
- if (beenHere) {
- if (mayBeCycle) {
- traceCycle(this);
- }
- return;
- }
- beenHere = true;
- mayBeCycle = true;
- doFiles(s);
- mayBeCycle = false;
- s.add(this);
- }
-
- public FileList doCFile() {
- FileList s = new FileList(name, plat);
- s.useGrandInclude = useGrandInclude; // propagate this
- doFiles(s);
- for (Iterator iter = s.iterator(); iter.hasNext(); ) {
- FileList l = (FileList) iter.next();
- l.beenHere = false;
- }
- return s;
- }
-
- /** if .h file is included thresh times, put it in the grand
- include file */
- public void putInclFile(Database db)
- throws IOException {
- boolean needline = true;
- FileName inclName = plat.getInclFileTemplate().copyStem(name);
- PrintWriter inclFile =
- new PrintWriter(new FileWriter(inclName.dirPreStemSuff()));
- if (plat.haveGrandInclude() && plat.includeGIInEachIncl()) {
- inclFile.println("# include \"" +
- plat.getGIFileTemplate().dirPreStemAltSuff() +
- "\"");
- needline = false;
- }
- for (Iterator iter = iterator(); iter.hasNext(); ) {
- FileList hfile = (FileList) iter.next();
- if (!db.hfileIsInGrandInclude(hfile, this)) {
- inclFile.println("# include \"" +
- plat.getInclFileTemplate().getInvDir() +
- hfile.name +
- "\"");
- needline = false;
- }
- }
-
- // Solaris C++ in strict mode warns about empty files
-
- if(needline) {
- inclFile.println();
- }
-
- inclFile.close();
- }
-}
diff --git a/src/share/tools/MakeDeps/FileName.java b/src/share/tools/MakeDeps/FileName.java
deleted file mode 100644
index eebda0e05..000000000
--- a/src/share/tools/MakeDeps/FileName.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1999, 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 FileName {
- private String dir;
- private String prefix;
- private String stem;
- private String suffix;
- private String inverseDir;
- private String altSuffix;
-
- private String dpss;
- private String psa;
- private String dpsa;
- private String pss;
-
- private Platform plat;
-
- /** None of the passed strings may be null. */
-
- public FileName(Platform plat, String dir, String prefix,
- String stem, String suffix,
- String inverseDir, String altSuffix) {
- if ((dir == null) ||
- (prefix == null) ||
- (stem == null) ||
- (suffix == null) ||
- (inverseDir == null) ||
- (altSuffix == null)) {
- throw new NullPointerException("All arguments must be non-null");
- }
-
- this.plat = plat;
-
- this.dir = dir;
- this.prefix = prefix;
- this.stem = stem;
- this.suffix = suffix;
- this.inverseDir = inverseDir;
- this.altSuffix = altSuffix;
-
- pss = prefix + stem + suffix;
- dpss = dir + prefix + stem + suffix;
- psa = prefix + stem + altSuffix;
- dpsa = dir + prefix + stem + altSuffix;
-
- checkLength(plat);
- }
-
- public void checkLength(Platform p) {
- int len;
- String s;
- int suffLen = suffix.length();
- int altSuffLen = altSuffix.length();
- if (suffLen >= altSuffLen) {
- len = suffLen;
- s = suffix;
- } else {
- len = altSuffLen;
- s = altSuffix;
- }
- len += prefix.length() + stem.length();
- int lim = p.fileNameLengthLimit();
- if (len > lim) {
- p.fatalError(prefix + stem + s + " is too long: " +
- len + " >= " + lim);
- }
- }
-
- public String dirPreStemSuff() {
- return dpss;
- }
-
- public String preStemSuff() {
- return pss;
- }
-
- public String dirPreStemAltSuff() {
- return dpsa;
- }
-
- public String preStemAltSuff() {
- return psa;
- }
-
- public FileName copyStem(String newStem) {
- return new FileName(plat, dir, prefix, newStem,
- suffix, inverseDir, altSuffix);
- }
-
- String nameOfList() {
- return stem;
- }
-
- String getInvDir() {
- return inverseDir;
- }
-}
diff --git a/src/share/tools/MakeDeps/MakeDeps.java b/src/share/tools/MakeDeps/MakeDeps.java
deleted file mode 100644
index c18edcf14..000000000
--- a/src/share/tools/MakeDeps/MakeDeps.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 1999, 2001, 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.
- *
- */
-
-// This program reads an include file database.
-// The database should cover each self .c and .h file,
-// but not files in /usr/include
-// The database consists of pairs of nonblank words, where the first word is
-// the filename that needs to include the file named by the second word.
-// For each .c file, this program generates a fooIncludes.h file that
-// the .c file may include to include all the needed files in the right order.
-// It also generates a foo.dep file to include in the makefile.
-// Finally it detects cycles, and can work with two files, an old and a new one.
-// To incrementally write out only needed files after a small change.
-//
-// Based on a suggestion by Roland Conybeare, algorithm suggested by Craig
-// Chambers, written by David Ungar, 3/1/89.
-// Added PREFIX, {DEP/INC}_DIR, smaller dep output 10/92 -Urs
-
-// Add something for precompiled headers
-
-// To handle different platforms, I am introducing a platform file.
-// The platform file contains lines like:
-// os = svr4
-//
-// Then, when processing the includeDB file, a token such as <os>
-// gets replaced by svr4. -- dmu 3/25/97
-
-// Modified to centralize Dependencies to speed up make -- dmu 5/97
-
-public class MakeDeps {
-
- public static void usage() {
- System.out.println("usage:");
- System.out.println("\tmakeDeps platform-name platform-file database-file [MakeDeps args] [platform args]");
- System.out.println("\tmakeDeps diffs platform-name old-platform-file old-database-file new-platform-file new-database-file [MakeDeps args] [platform args]");
- System.out.println("where platform-name is the name of a platform MakeDeps supports");
- System.out.println("(currently \"WinGammaPlatform\" or \"UnixPlatform\")");
- System.out.println("MakeDeps options:");
- System.out.println(" -firstFile [filename]: Specify the first file in link order (i.e.,");
- System.out.println(" to have a well-known function at the start of the output file)");
- System.out.println(" -lastFile [filename]: Specify the last file in link order (i.e.,");
- System.out.println(" to have a well-known function at the end of the output file)");
- System.err.println("WinGammaPlatform platform-specific options:");
- System.err.println(" -sourceBase <path to directory (workspace) " +
- "containing source files; no trailing slash>");
- System.err.println(" -dspFileName <full pathname to which .dsp file " +
- "will be written; all parent directories must " +
- "already exist>");
- System.err.println(" -envVar <environment variable to be inserted " +
- "into .dsp file, substituting for path given in " +
- "-sourceBase. Example: HotSpotWorkSpace>");
- System.err.println(" -dllLoc <path to directory in which to put " +
- "jvm.dll and jvm_g.dll; no trailing slash>");
- System.err.println(" If any of the above are specified, "+
- "they must all be.");
- System.err.println(" Additional, optional arguments, which can be " +
- "specified multiple times:");
- System.err.println(" -absoluteInclude <string containing absolute " +
- "path to include directory>");
- System.err.println(" -relativeInclude <string containing include " +
- "directory relative to -envVar>");
- System.err.println(" -define <preprocessor flag to be #defined " +
- "(note: doesn't yet support " +
- "#define (flag) (value))>");
- System.err.println(" -perFileLine <file> <line>");
- System.err.println(" -conditionalPerFileLine <file> <line for " +
- "release build> <line for debug build>");
- System.err.println(" (NOTE: To work around a bug in nmake, where " +
- "you can't have a '#' character in a quoted " +
- "string, all of the lines outputted have \"#\"" +
- "prepended)");
- System.err.println(" -startAt <subdir of sourceBase>");
- System.err.println(" -ignoreFile <file which won't be able to be " +
- "found in the sourceBase because it's generated " +
- "later>");
- System.err.println(" -additionalFile <file not in database but " +
- "which should show up in .dsp file, like " +
- "includeDB_core>");
- System.err.println(" -additionalGeneratedFile <environment variable of " +
- "generated file's location> <relative path to " +
- "directory containing file; no trailing slash> " +
- "<name of file generated later in the build process>");
- System.err.println(" -prelink <build> <desc> <cmds>:");
- System.err.println(" Generate a set of prelink commands for the given BUILD");
- System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
- System.err.println(" are both quoted strings.");
- System.err.println(" Default includes: \".\"");
- System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
- }
-
- public static void main(String[] args) {
- try {
- if (args.length < 3) {
- usage();
- System.exit(1);
- }
-
- int argc = 0;
- boolean diffMode = false;
- if (args[argc].equals("diffs")) {
- diffMode = true;
- ++argc;
- }
-
- String platformName = args[argc++];
- Class platformClass = Class.forName(platformName);
-
- String plat1 = null;
- String db1 = null;
- String plat2 = null;
- String db2 = null;
-
- String firstFile = null;
- String lastFile = null;
-
- int numOptionalArgs =
- (diffMode ? (args.length - 6) : (args.length - 3));
- if (numOptionalArgs < 0) {
- usage();
- System.exit(1);
- }
-
- plat1 = args[argc++];
- db1 = args[argc++];
-
- if (diffMode) {
- plat2 = args[argc++];
- db2 = args[argc++];
- }
-
- // argc now points at start of optional arguments, if any
-
- try {
- boolean gotOne = true;
- while (gotOne && (argc < args.length - 1)) {
- gotOne = false;
- String arg = args[argc];
- if (arg.equals("-firstFile")) {
- firstFile = args[argc + 1];
- argc += 2;
- gotOne = true;
- } else if (arg.equals("-lastFile")) {
- lastFile = args[argc + 1];
- argc += 2;
- gotOne = true;
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- usage();
- System.exit(1);
- }
-
- Platform platform = (Platform) platformClass.newInstance();
- platform.setupFileTemplates();
- long t = platform.defaultGrandIncludeThreshold();
-
- String[] platformArgs = null;
- int numPlatformArgs = args.length - argc;
- if (numPlatformArgs > 0) {
- platformArgs = new String[numPlatformArgs];
- int offset = argc;
- while (argc < args.length) {
- platformArgs[argc - offset] = args[argc];
- ++argc;
- }
- }
-
- // If you want to change the threshold, change the default
- // "grand include" threshold in Platform.java, or override
- // it in the platform-specific file like UnixPlatform.java
-
- Database previous = new Database(platform, t);
- Database current = new Database(platform, t);
-
- previous.canBeMissing();
-
- if (firstFile != null) {
- previous.setFirstFile(firstFile);
- current.setFirstFile(firstFile);
- }
- if (lastFile != null) {
- previous.setLastFile(lastFile);
- current.setLastFile(lastFile);
- }
-
- if (diffMode) {
- System.out.println("Old database:");
- previous.get(plat1, db1);
- previous.compute();
- System.out.println("New database:");
- current.get(plat2, db2);
- current.compute();
- System.out.println("Deltas:");
- current.putDiffs(previous);
- } else {
- System.out.println("New database:");
- current.get(plat1, db1);
- current.compute();
- current.put();
- }
-
- if (platformArgs != null) {
- // Allow the platform to write platform-specific files
- platform.writePlatformSpecificFiles(previous, current,
- platformArgs);
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/share/tools/MakeDeps/MetroWerksMacPlatform.java b/src/share/tools/MakeDeps/MetroWerksMacPlatform.java
deleted file mode 100644
index 72e1dd0de..000000000
--- a/src/share/tools/MakeDeps/MetroWerksMacPlatform.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1999, 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.*;
-
-public class MetroWerksMacPlatform extends Platform {
- public void setupFileTemplates() {
- inclFileTemplate = new FileName(this,
- ":incls:", "_", "", ".incl", "", ""
- );
- giFileTemplate = new FileName(this,
- "", "", "precompiledHeader", ".pch", "", ""
- );
- gdFileTemplate = dummyFileTemplate;
- }
-
- private static String[] suffixes = { ".cpp", ".c", ".s" };
-
- public String[] outerSuffixes() {
- return suffixes;
- }
-
- public boolean includeGIInEachIncl() {
- return true;
- }
-
- public int defaultGrandIncludeThreshold() {
- return 150;
- }
-
- public void writeGIPragma(PrintWriter out) {
- out.println("#pragma precompile_target \"" +
- giFileTemplate.preStemAltSuff() +
- "\"");
- out.println();
- }
-
- public String objFileSuffix() {
- throw new RuntimeException("Unimplemented in original makeDeps");
- }
-
- public String asmFileSuffix() {
- throw new RuntimeException("Unimplemented in original makeDeps");
- }
-
- public String dependentPrefix() {
- throw new RuntimeException("Unimplemented in original makeDeps");
- }
-}
diff --git a/src/share/tools/MakeDeps/Platform.java b/src/share/tools/MakeDeps/Platform.java
deleted file mode 100644
index dce85a766..000000000
--- a/src/share/tools/MakeDeps/Platform.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, 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.
- *
- */
-
-/** Defines what must be specified for each platform. This class must
- have a no-arg constructor. */
-
-import java.io.*;
-
-public abstract class Platform {
- /** file name templates capture naming conventions */
- protected FileName dummyFileTemplate =
- new FileName(this, "", "", "", "", "", "");
-
- // The next three must be instantiated in subclasses' constructors
-
- /** An incl file is produced per .c file and contains all the
- includes it needs */
- protected FileName inclFileTemplate;
-
- /** A GI (grand-include) file has any file used more than N times
- for precompiled headers */
- protected FileName giFileTemplate;
-
- /** A GD (grand-dependencies) file that tells Unix make all the
- .o's needed for linking and the include dependencies */
- protected FileName gdFileTemplate;
-
- // Accessors
- public FileName getInclFileTemplate() {
- return inclFileTemplate;
- }
-
- public FileName getGIFileTemplate() {
- return giFileTemplate;
- }
-
- public FileName getGDFileTemplate() {
- return gdFileTemplate;
- }
-
- // an incl file is the file included by each.c file that includes
- // all needed header files
-
- public abstract void setupFileTemplates();
- public abstract String[] outerSuffixes();
-
- /** empty file name -> no grand include file */
- public boolean haveGrandInclude() {
- return (giFileTemplate.nameOfList().length() > 0);
- }
-
- public boolean writeDeps() {
- return (gdFileTemplate.nameOfList().length() > 0);
- }
-
- /** <p> A gi file is the grand-include file. It includes in one
- file any file that is included more than a certain number of
- times. </p>
-
- <p> It is used for precompiled header files. </p>
-
- <p> It has a source name, that is the file that this program
- generates, and a compiled name; that is the file that is
- included by other files. </p>
-
- <p> Some platforms have this program actually explictly
- include the preprocessed gi file-- see includeGIInEachIncl().
- </p>
-
- <p> Also, some platforms need a pragma in the GI file. </p> */
- public boolean includeGIInEachIncl() {
- return false;
- }
-
- /** For some platforms, e.g. Solaris, include the grand-include
- dependencies in the makefile. For others, e.g. Windows, do
- not. */
- public boolean includeGIDependencies() {
- return false;
- }
-
- /** Should C/C++ source file be dependent on a file included
- into the grand-include file. */
- public boolean writeDependenciesOnHFilesFromGI() {
- return false;
- }
-
- /** Default implementation does nothing */
- public void writeGIPragma(PrintWriter out) {
- }
-
- /** A line with a filename and the noGrandInclude string means
- that this file cannot use the precompiled header. */
- public String noGrandInclude() {
- return "no_precompiled_headers";
- }
-
- /** A line with a filename and the
- generatePlatformDependentInclude means that an include file
- for the header file must be generated. This file generated include
- file is directly included by the non-platform dependent include file
- (e.g os.hpp includes _os_pd.hpp.incl. So while we notice files that
- are directly dependent on non-platform dependent files from the database
- we must infer the dependence on platform specific files to generate correct
- dependences on the platform specific files. */
- public String generatePlatformDependentInclude() {
- return "generate_platform_dependent_include";
- }
-
- /** Prefix and suffix strings for emitting Makefile rules */
- public abstract String objFileSuffix();
- public abstract String asmFileSuffix();
- public abstract String dependentPrefix();
-
- // Exit routines:
-
- /** Abort means an internal error */
- public void abort() {
- throw new RuntimeException("Internal error");
- }
-
- /** fatalError is used by clients to stop the system */
- public void fatalError(String msg) {
- System.err.println(msg);
- System.exit(1);
- }
-
- /** Default implementation performs case-sensitive comparison */
- public boolean fileNameStringEquality(String s1, String s2) {
- return s1.equals(s2);
- }
-
- public void fileNamePortabilityCheck(String name) {
- if (Character.isUpperCase(name.charAt(0))) {
- fatalError("Error: for the sake of portability we have chosen\n" +
- "to avoid files starting with an uppercase letter.\n" +
- "Please rename " + name + ".");
- }
- }
-
- public void fileNamePortabilityCheck(String name, String matchingName) {
- if (!name.equals(matchingName)) {
- fatalError("Error: file " + name + " also appears as " +
- matchingName + ". Case must be consistent for " +
- "portability.");
- }
- }
-
- /** max is 31 on mac, so warn */
- public int fileNameLengthLimit() {
- return 45;
- }
-
- public int defaultGrandIncludeThreshold() {
- return 30;
- }
-
- /** Not very general, but this is a way to get platform-specific
- files to be written. Default implementation does nothing. */
- public void writePlatformSpecificFiles(Database previousDB,
- Database currentDB, String[] args)
- throws IllegalArgumentException, IOException {
- }
-}
diff --git a/src/share/tools/MakeDeps/UnixPlatform.java b/src/share/tools/MakeDeps/UnixPlatform.java
deleted file mode 100644
index 3b449cc0b..000000000
--- a/src/share/tools/MakeDeps/UnixPlatform.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1999, 2005, 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 UnixPlatform extends Platform {
- public void setupFileTemplates() {
- inclFileTemplate = new FileName(this,
- "incls/", "_", "", ".incl", "", ""
- );
- giFileTemplate = new FileName(this,
- "incls/", "", "_precompiled", ".incl", "", ""
- );
- gdFileTemplate = new FileName(this,
- "", "", "Dependencies", "", "", ""
- );
- }
-
- private static String[] suffixes = { ".cpp", ".c", ".s" };
-
- public String[] outerSuffixes() {
- return suffixes;
- }
-
- public String objFileSuffix() {
- return ".o";
- }
-
- public String asmFileSuffix() {
- return ".i";
- }
-
- public String dependentPrefix() {
- return "";
- }
-
- /** Do not change this; unless you fix things so precompiled
- header files get translated into make dependencies. - Ungar */
- public int defaultGrandIncludeThreshold() {
- if (System.getProperty("USE_PRECOMPILED_HEADER") != null)
- return 30;
- else
- return 1 << 30;
- }
-
- /** For Unix make, include the dependencies for precompiled header
- files. */
- public boolean includeGIDependencies() {
- return false;
- }
-
- /** Should C/C++ source file be dependent on a file included
- into the grand-include file.
- On Unix with precompiled headers we don't want each file to be
- dependent on grand-include file. Instead each C/C++ source file
- is depended on each own set of files, and recompiled only when
- files from this set are changed. */
- public boolean writeDependenciesOnHFilesFromGI() {
- return System.getProperty("USE_PRECOMPILED_HEADER") != null;
- }
-}
diff --git a/src/share/tools/MakeDeps/ArgsParser.java b/src/share/tools/ProjectCreator/ArgsParser.java
index 167a6cacc..ca5d0a337 100644
--- a/src/share/tools/MakeDeps/ArgsParser.java
+++ b/src/share/tools/ProjectCreator/ArgsParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
diff --git a/src/share/tools/MakeDeps/BuildConfig.java b/src/share/tools/ProjectCreator/BuildConfig.java
index b68d41030..7a2a03c78 100644
--- a/src/share/tools/MakeDeps/BuildConfig.java
+++ b/src/share/tools/ProjectCreator/BuildConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -48,6 +48,9 @@ class BuildConfig {
if (vars == null) vars = new Hashtable();
String flavourBuild = flavour + "_" + build;
+ System.out.println();
+ System.out.println(flavourBuild);
+
put("Name", getCI().makeCfgName(flavourBuild));
put("Flavour", flavour);
put("Build", build);
@@ -71,7 +74,7 @@ class BuildConfig {
initDefaultDefines(defines);
initDefaultCompilerFlags(includes);
initDefaultLinkerFlags();
- handleDB((String)getFieldInContext("IncludeDB"));
+ handleDB();
}
@@ -110,12 +113,12 @@ class BuildConfig {
}
- Vector getPreferredPaths(Database currentDB) {
+ Vector getPreferredPaths(MacroDefinitions macros) {
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 = currentDB.getMacros(); iter.hasNext(); ) {
+ for (Iterator iter = macros.getMacros(); iter.hasNext(); ) {
Macro macro = (Macro) iter.next();
if (macro.name.equals("os_family") ||
macro.name.equals("arch")) {
@@ -129,39 +132,36 @@ class BuildConfig {
}
- void handleDB(String dbFile) {
+ void handleDB() {
WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
- Database db = new Database(platform, platform.defaultGrandIncludeThreshold());
-
- try {
- File incls = new File(get("OutputDir")+Util.sep+"incls");
- FileName oldInclTempl = platform.getInclFileTemplate();
- FileName oldGITempl = platform.getGIFileTemplate();
- FileName oldGDTempl = platform.getGDFileTemplate();
- platform.setInclFileTemplate(new FileName(platform, incls.getPath()+Util.sep,
- "_", "", ".incl", "", ""));
- platform.setGIFileTemplate(new FileName(platform, incls.getPath()+Util.sep,
- "", "_precompiled", ".incl", "", ""));
+ File incls = new File(get("OutputDir")+Util.sep+"incls");
- incls.mkdirs();
+ incls.mkdirs();
- db.get(getFieldString(null, "Platform"), dbFile);
- db.compute();
-
- db.put();
-
- //platform.setInclFileTemplate(oldInclTempl);
- //platform.setGIFileTemplate(oldInclTempl);
+ MacroDefinitions macros = new MacroDefinitions();
+ try {
+ macros.readFrom(getFieldString(null, "Platform"), false);
} catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException("cannot do db: "+e);
+ throw new RuntimeException(e);
}
- putSpecificField("AllFilesHash", computeAllFiles(platform, db));
+ putSpecificField("AllFilesHash", computeAllFiles(platform, macros));
}
+ private boolean matchesIgnoredPath(String prefixedName) {
+ Vector rv = new Vector();
+ collectRelevantVectors(rv, "IgnorePath");
+ for (Iterator i = rv.iterator(); i.hasNext(); ) {
+ String pathPart = (String) i.next();
+ if (prefixedName.contains(Util.normalize(pathPart))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
void addAll(Iterator i, Hashtable hash,
WinGammaPlatform platform, DirectoryTree tree,
Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) {
@@ -175,7 +175,10 @@ class BuildConfig {
filesNotFound,
filesDuplicate);
if (prefixedName != null) {
- addTo(hash, Util.normalize(prefixedName), fileName);
+ prefixedName = Util.normalize(prefixedName);
+ if (!matchesIgnoredPath(prefixedName)) {
+ addTo(hash, prefixedName, fileName);
+ }
}
}
}
@@ -185,23 +188,28 @@ class BuildConfig {
ht.put(expandFormat(key), expandFormat(value));
}
- Hashtable computeAllFiles(WinGammaPlatform platform, Database db) {
+ Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) {
Hashtable rv = new Hashtable();
DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
- Vector preferredPaths = getPreferredPaths(db);
+ Vector preferredPaths = getPreferredPaths(macros);
// Hold errors until end
Vector filesNotFound = new Vector();
Vector filesDuplicate = new Vector();
+ Vector includedFiles = new Vector();
// find all files
- Vector dbFiles = new Vector();
- for (Iterator i=db.getAllFiles().iterator(); i.hasNext(); ) {
- FileList fl = (FileList) i.next();
- dbFiles.add(fl.getName());
+ Vector dirs = getSourceIncludes();
+ for (Iterator i = dirs.iterator(); i.hasNext(); ) {
+ String dir = (String)i.next();
+ DirectoryTree subtree = getSourceTree(dir, null);
+ for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) {
+ String name = ((File)fi.next()).getName();
+ includedFiles.add(name);
+ }
}
- addAll(dbFiles.iterator(), rv,
+ addAll(includedFiles.iterator(), rv,
platform, tree,
preferredPaths, filesNotFound, filesDuplicate);
@@ -356,11 +364,15 @@ class BuildConfig {
Vector getIncludes() {
Vector rv = new Vector();
- // for generated includes
- rv.add(get("OutputDir"));
-
collectRelevantVectors(rv, "AbsoluteInclude");
+ rv.addAll(getSourceIncludes());
+
+ return rv;
+ }
+
+ private Vector getSourceIncludes() {
+ Vector rv = new Vector();
Vector ri = new Vector();
String sourceBase = getFieldString(null, "SourceBase");
collectRelevantVectors(ri, "RelativeInclude");
@@ -368,7 +380,6 @@ class BuildConfig {
String f = (String)i.next();
rv.add(sourceBase + Util.sep + f);
}
-
return rv;
}
@@ -381,12 +392,10 @@ class BuildConfig {
cfg.startsWith("compiler2")));
}
- // Filters out the IncludeDB statement, which is the only command-
- // line argument we explicitly specialize for the tiered build
+ // Filters out the IgnoreFile and IgnorePaths since they are
+ // handled specially for tiered builds.
static boolean appliesToTieredBuild(String cfg, String key) {
- return (appliesToTieredBuild(cfg) &&
- (key != null &&
- !key.equals("IncludeDB")));
+ return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
}
static String getTieredBuildCfg(String cfg) {
@@ -441,7 +450,7 @@ class BuildConfig {
static void putFieldHash(String cfg, String field, String name, Object val) {
putFieldHashImpl(cfg, field, name, val);
- if (appliesToTieredBuild(cfg)) {
+ if (appliesToTieredBuild(cfg, field)) {
putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
}
}
@@ -459,7 +468,7 @@ class BuildConfig {
static void addFieldVector(String cfg, String field, String element) {
addFieldVectorImpl(cfg, field, element);
- if (appliesToTieredBuild(cfg)) {
+ if (appliesToTieredBuild(cfg, field)) {
addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
}
}
diff --git a/src/share/tools/MakeDeps/DirectoryTree.java b/src/share/tools/ProjectCreator/DirectoryTree.java
index acdc08da7..7bfbc6a8e 100644
--- a/src/share/tools/MakeDeps/DirectoryTree.java
+++ b/src/share/tools/ProjectCreator/DirectoryTree.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -47,17 +47,47 @@ public class DirectoryTree {
verbose = false;
}
- /** Takes an absolute path to the root directory of this
- DirectoryTree. Throws IllegalArgumentException if the given
- string represents a plain file or nonexistent directory. */
+ public void addSubdirToIgnore(String subdir) {
+ subdirsToIgnore.add(subdir);
+ }
+
+ private class FileIterator implements Iterator {
+ private Vector nodes = new Vector();
- public DirectoryTree(String baseDirectory) {
- this();
- readDirectory(baseDirectory);
+ public FileIterator(Node rootNode) {
+ nodes.add(rootNode);
+ prune();
+ }
+ public boolean hasNext() {
+ return nodes.size() > 0;
+ }
+ public Object next() {
+ Node last = (Node)nodes.remove(nodes.size() - 1);
+ prune();
+ return new File(last.getName());
+ }
+
+ public void remove() {
+ throw new RuntimeException();
+ }
+
+ private void prune() {
+ while (nodes.size() > 0) {
+ Node last = (Node)nodes.get(nodes.size() - 1);
+
+ if (last.isDirectory()) {
+ nodes.remove(nodes.size() - 1);
+ nodes.addAll(last.children);
+ } else {
+ // Is at file
+ return;
+ }
+ }
+ }
}
- public void addSubdirToIgnore(String subdir) {
- subdirsToIgnore.add(subdir);
+ public Iterator getFileIterator() {
+ return new FileIterator(rootNode);
}
/** Output "."'s to System.out as directories are read. Defaults
@@ -80,7 +110,7 @@ public class DirectoryTree {
public void readDirectory(String baseDirectory)
throws IllegalArgumentException {
- File root = new File(baseDirectory);
+ File root = new File(Util.normalize(baseDirectory));
if (!root.isDirectory()) {
throw new IllegalArgumentException("baseDirectory \"" +
baseDirectory +
diff --git a/src/share/tools/MakeDeps/DirectoryTreeNode.java b/src/share/tools/ProjectCreator/DirectoryTreeNode.java
index f540e1287..f198dc24b 100644
--- a/src/share/tools/MakeDeps/DirectoryTreeNode.java
+++ b/src/share/tools/ProjectCreator/DirectoryTreeNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/tools/MakeDeps/FileFormatException.java b/src/share/tools/ProjectCreator/FileFormatException.java
index 1ce8b9e6d..f16f0b2ad 100644
--- a/src/share/tools/MakeDeps/FileFormatException.java
+++ b/src/share/tools/ProjectCreator/FileFormatException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/tools/MakeDeps/Macro.java b/src/share/tools/ProjectCreator/Macro.java
index 2b9ed67c7..43309ab24 100644
--- a/src/share/tools/MakeDeps/Macro.java
+++ b/src/share/tools/ProjectCreator/Macro.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/tools/MakeDeps/MacroDefinitions.java b/src/share/tools/ProjectCreator/MacroDefinitions.java
index 727a0c4a9..9ed801ac9 100644
--- a/src/share/tools/MakeDeps/MacroDefinitions.java
+++ b/src/share/tools/ProjectCreator/MacroDefinitions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -32,16 +32,6 @@ public class MacroDefinitions {
macros = new Vector();
}
- private String lookup(String name) throws NoSuchElementException {
- for (Iterator iter = macros.iterator(); iter.hasNext(); ) {
- Macro macro = (Macro) iter.next();
- if (macro.name.equals(name)) {
- return macro.contents;
- }
- }
- throw new NoSuchElementException(name);
- }
-
public void addMacro(String name, String contents) {
Macro macro = new Macro();
macro.name = name;
@@ -155,102 +145,10 @@ public class MacroDefinitions {
reader.close();
}
- /** Throws IllegalArgumentException if passed token is illegally
- formatted */
- public String expand(String token)
- throws IllegalArgumentException {
- // the token may contain one or more <macroName>'s
-
- String out = "";
-
- // emacs lingo
- int mark = 0;
- int point = 0;
-
- int len = token.length();
-
- if (len == 0)
- return out;
-
- do {
- // Scan "point" forward until hitting either the end of
- // the string or the beginning of a macro
- if (token.charAt(point) == '<') {
- // Append (point - mark) to out
- if ((point - mark) != 0) {
- out += token.substring(mark, point);
- }
- mark = point + 1;
- // Scan forward from point for right bracket
- point++;
- while ((point < len) &&
- (token.charAt(point) != '>')) {
- point++;
- }
- if (point == len) {
- throw new IllegalArgumentException(
- "Could not find right angle-bracket in token " + token
- );
- }
- String name = token.substring(mark, point);
- if (name == null) {
- throw new IllegalArgumentException(
- "Empty macro in token " + token
- );
- }
- try {
- String contents = lookup(name);
- out += contents;
- point++;
- mark = point;
- } catch (NoSuchElementException e) {
- throw new IllegalArgumentException(
- "Unknown macro " + name + " in token " + token
- );
- }
- } else {
- point++;
- }
- } while (point != len);
-
- if (mark != point) {
- out += token.substring(mark, point);
- }
-
- return out;
- }
-
- public MacroDefinitions copy() {
- MacroDefinitions ret = new MacroDefinitions();
- for (Iterator iter = macros.iterator();
- iter.hasNext(); ) {
- Macro orig = (Macro) iter.next();
- Macro macro = new Macro();
- macro.name = orig.name;
- macro.contents = orig.contents;
- ret.macros.add(macro);
- }
- return ret;
- }
-
- public void setAllMacroBodiesTo(String s) {
- for (Iterator iter = macros.iterator();
- iter.hasNext(); ) {
- Macro macro = (Macro) iter.next();
- macro.contents = s;
- }
- }
-
/** 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();
}
-
- private void error(String text) throws FileFormatException {
- throw new FileFormatException(
- "Expected \"macroname = value\", but found: " + text
- );
- }
}
diff --git a/src/share/tools/ProjectCreator/ProjectCreator.java b/src/share/tools/ProjectCreator/ProjectCreator.java
new file mode 100644
index 000000000..5203c5a36
--- /dev/null
+++ b/src/share/tools/ProjectCreator/ProjectCreator.java
@@ -0,0 +1,98 @@
+/*
+ * 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 ProjectCreator {
+
+ public static void usage() {
+ System.out.println("ProjectCreator options:");
+ System.err.println("WinGammaPlatform platform-specific options:");
+ System.err.println(" -sourceBase <path to directory (workspace) " +
+ "containing source files; no trailing slash>");
+ System.err.println(" -dspFileName <full pathname to which .dsp file " +
+ "will be written; all parent directories must " +
+ "already exist>");
+ System.err.println(" -envVar <environment variable to be inserted " +
+ "into .dsp file, substituting for path given in " +
+ "-sourceBase. Example: HotSpotWorkSpace>");
+ System.err.println(" -dllLoc <path to directory in which to put " +
+ "jvm.dll and jvm_g.dll; no trailing slash>");
+ System.err.println(" If any of the above are specified, "+
+ "they must all be.");
+ System.err.println(" Additional, optional arguments, which can be " +
+ "specified multiple times:");
+ System.err.println(" -absoluteInclude <string containing absolute " +
+ "path to include directory>");
+ System.err.println(" -relativeInclude <string containing include " +
+ "directory relative to -envVar>");
+ System.err.println(" -define <preprocessor flag to be #defined " +
+ "(note: doesn't yet support " +
+ "#define (flag) (value))>");
+ System.err.println(" -perFileLine <file> <line>");
+ System.err.println(" -conditionalPerFileLine <file> <line for " +
+ "release build> <line for debug build>");
+ System.err.println(" (NOTE: To work around a bug in nmake, where " +
+ "you can't have a '#' character in a quoted " +
+ "string, all of the lines outputted have \"#\"" +
+ "prepended)");
+ System.err.println(" -startAt <subdir of sourceBase>");
+ System.err.println(" -ignoreFile <file which won't be able to be " +
+ "found in the sourceBase because it's generated " +
+ "later>");
+ System.err.println(" -additionalFile <file not in database but " +
+ "which should show up in .dsp file>");
+ System.err.println(" -additionalGeneratedFile <environment variable of " +
+ "generated file's location> <relative path to " +
+ "directory containing file; no trailing slash> " +
+ "<name of file generated later in the build process>");
+ System.err.println(" -prelink <build> <desc> <cmds>:");
+ System.err.println(" Generate a set of prelink commands for the given BUILD");
+ System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
+ System.err.println(" are both quoted strings.");
+ System.err.println(" Default includes: \".\"");
+ System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
+ }
+
+ public static void main(String[] args) {
+ try {
+ if (args.length < 3) {
+ usage();
+ System.exit(1);
+ }
+
+ String platformName = args[0];
+ Class platformClass = Class.forName(platformName);
+ WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance();
+
+ String[] platformArgs = new String[args.length - 1];
+ System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
+
+ // Allow the platform to write platform-specific files
+ platform.createVcproj(platformArgs);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/src/share/tools/MakeDeps/Util.java b/src/share/tools/ProjectCreator/Util.java
index e9a44d8d3..e44b4f09c 100644
--- a/src/share/tools/MakeDeps/Util.java
+++ b/src/share/tools/ProjectCreator/Util.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
diff --git a/src/share/tools/MakeDeps/WinGammaPlatform.java b/src/share/tools/ProjectCreator/WinGammaPlatform.java
index 1c136bdbf..ece6b1252 100644
--- a/src/share/tools/MakeDeps/WinGammaPlatform.java
+++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -117,40 +117,7 @@ class HsArgRule extends ArgRuleSpecific {
}
-public abstract class WinGammaPlatform extends Platform {
- public void setupFileTemplates() {
- inclFileTemplate = new FileName(this,
- "incls\\", "_", "", ".incl", "", ""
- );
- giFileTemplate = new FileName(this,
- "incls\\", "", "_precompiled", ".incl", "", ""
- );
- gdFileTemplate = new FileName(this,
- "", "", "Dependencies", "", "", ""
- );
- }
-
- private static String[] suffixes = { ".cpp", ".c" };
-
- public String[] outerSuffixes() {
- return suffixes;
- }
-
- public String objFileSuffix() {
- return ".obj";
- }
-
- public String asmFileSuffix() {
- return ".i";
- }
-
- public String dependentPrefix() {
- return "$(VM_PATH)";
- }
-
- public boolean includeGIInEachIncl() {
- return false;
- }
+public abstract class WinGammaPlatform {
public boolean fileNameStringEquality(String s1, String s2) {
return s1.equalsIgnoreCase(s2);
@@ -176,8 +143,7 @@ public abstract class WinGammaPlatform extends Platform {
"#define (flag) (value))>");
System.err.println(" -startAt <subdir of sourceBase>");
System.err.println(" -additionalFile <file not in database but " +
- "which should show up in project file, like " +
- "includeDB_core>");
+ "which should show up in project file>");
System.err.println(" -additionalGeneratedFile <absolute path to " +
"directory containing file; no trailing slash> " +
"<name of file generated later in the build process>");
@@ -301,27 +267,6 @@ public abstract class WinGammaPlatform extends Platform {
return name;
}
- protected boolean databaseAllFilesEqual(Database previousDB,
- Database currentDB) {
- Iterator i1 = previousDB.getAllFiles().iterator();
- Iterator i2 = currentDB.getAllFiles().iterator();
-
- while (i1.hasNext() && i2.hasNext()) {
- FileList fl1 = (FileList) i1.next();
- FileList fl2 = (FileList) i2.next();
- if (!fl1.getName().equals(fl2.getName())) {
- return false;
- }
- }
-
- if (i1.hasNext() != i2.hasNext()) {
- // Different lengths
- return false;
- }
-
- return true;
- }
-
protected String envVarPrefixedFileName(String fileName,
int sourceBaseLen,
DirectoryTree tree,
@@ -374,8 +319,7 @@ public abstract class WinGammaPlatform extends Platform {
protected abstract String getProjectExt();
- public void writePlatformSpecificFiles(Database previousDB,
- Database currentDB, String[] args)
+ public void createVcproj(String[] args)
throws IllegalArgumentException, IOException {
parseArguments(args);
@@ -383,16 +327,6 @@ public abstract class WinGammaPlatform extends Platform {
String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
String ext = getProjectExt();
- // Compare contents of allFiles of previousDB and includeDB.
- // If these haven't changed, then skip writing the .vcproj file.
- if (false && databaseAllFilesEqual(previousDB, currentDB) &&
- new File(projectFileName).exists()) {
- System.out.println(
- " Databases unchanged; skipping overwrite of "+ext+" file."
- );
- return;
- }
-
String projectName = getProjectName(projectFileName, ext);
writeProjectFile(projectFileName, projectName, createAllConfigs());
@@ -407,15 +341,6 @@ public abstract class WinGammaPlatform extends Platform {
}
- void setInclFileTemplate(FileName val) {
- this.inclFileTemplate = val;
- }
-
- void setGIFileTemplate(FileName val) {
- this.giFileTemplate = val;
- }
-
-
void parseArguments(String[] args) {
new ArgsParser(args,
new ArgRule[]
@@ -551,6 +476,12 @@ public abstract class WinGammaPlatform extends Platform {
HsArgHandler.HASH
),
+ new HsArgRule("-ignorePath",
+ "IgnorePath",
+ null,
+ HsArgHandler.VECTOR
+ ),
+
new HsArgRule("-additionalFile",
"AdditionalFile",
null,
@@ -565,9 +496,6 @@ public abstract class WinGammaPlatform extends Platform {
String dir = it.get();
if (nextNotKey(it)) {
String fileName = it.get();
- // we ignore files that we know are generated, so we coudn't
- // find them in sources
- BuildConfig.putFieldHash(cfg, "IgnoreFile", fileName, "1");
BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
Util.normalize(dir + Util.sep + fileName),
fileName);
@@ -580,12 +508,6 @@ public abstract class WinGammaPlatform extends Platform {
}
),
- new HsArgRule("-includeDB",
- "IncludeDB",
- null,
- HsArgHandler.STRING
- ),
-
new ArgRule("-prelink",
new HsArgHandler() {
public void handle(ArgIterator it) {
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC6.java b/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java
index f394b3c50..fb64f7b92 100644
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC6.java
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC7.java b/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
index fffff8bd9..e0545228f 100644
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC7.java
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -160,6 +160,25 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
}
+ class SpecificPathFilter extends NameFilter {
+ String pats[];
+
+ SpecificPathFilter(String fname, String[] pats) {
+ this.fname = fname;
+ this.pats = pats;
+ }
+
+ boolean match(FileInfo fi) {
+ for (int i=0; i<pats.length; i++) {
+ if (fi.full.matches(pats[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
+
class ContainerFilter extends NameFilter {
Vector children;
@@ -232,11 +251,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase));
- ContainerFilter c2 = new ContainerFilter("C2");
- //c2.add(new DirectoryFilter("share/vm/adlc", sbase));
- c2.add(new DirectoryFilter("share/vm/opto", sbase));
- c2.add(new SpecificNameFilter("Generated", new String[] {"^ad_.+", "^dfa_.+", "^adGlobals.+"}));
- rv.add(c2);
+ rv.add(new DirectoryFilter("C2", "share/vm/opto", sbase));
ContainerFilter comp = new ContainerFilter("Compiler Common");
comp.add(new DirectoryFilter("share/vm/asm", sbase));
@@ -250,10 +265,10 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
sbase));
ContainerFilter misc = new ContainerFilter("Misc");
- //misc.add(new DirectoryFilter("share/vm/launch", sbase));
misc.add(new DirectoryFilter("share/vm/libadt", sbase));
misc.add(new DirectoryFilter("share/vm/services", sbase));
misc.add(new DirectoryFilter("share/vm/utilities", sbase));
+ misc.add(new DirectoryFilter("share/vm/classfile", sbase));
rv.add(misc);
rv.add(new DirectoryFilter("os_cpu", sbase));
@@ -262,11 +277,32 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
rv.add(new DirectoryFilter("os", sbase));
- rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"}));
-
- rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"}));
-
- rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"}));
+ ContainerFilter generated = new ContainerFilter("Generated");
+ ContainerFilter c1Generated = new ContainerFilter("C1");
+ c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+ c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"}));
+ generated.add(c1Generated);
+ ContainerFilter c2Generated = new ContainerFilter("C2");
+ c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+ c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"}));
+ c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"}));
+ generated.add(c2Generated);
+ ContainerFilter coreGenerated = new ContainerFilter("Core");
+ coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+ coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"}));
+ generated.add(coreGenerated);
+ ContainerFilter tieredGenerated = new ContainerFilter("Tiered");
+ tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+ tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"}));
+ tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"}));
+ generated.add(tieredGenerated);
+ ContainerFilter kernelGenerated = new ContainerFilter("Kernel");
+ kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
+ kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"}));
+ generated.add(kernelGenerated);
+ rv.add(generated);
+
+ rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"}));
// this one is to catch files not caught by other filters
//rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
@@ -489,7 +525,10 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
printWriter.println();
for (int i=0; i<attrs.length; i+=2) {
doIndent();
- printWriter.println(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
+ printWriter.print(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
+ if (i < attrs.length - 2) {
+ printWriter.println();
+ }
}
}
@@ -554,8 +593,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
addAttr(rv, "PreprocessorDefinitions",
Util.join(";", defines).replace("\"","&quot;"));
- addAttr(rv, "PrecompiledHeaderThrough",
- "incls"+Util.sep+"_precompiled.incl");
+ addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp");
addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
addAttr(rv, "AssemblerListingLocation", outDir);
addAttr(rv, "ObjectFile", outDir+Util.sep);
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC8.java b/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java
index d83edb959..21926357a 100644
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC8.java
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-import java.io.*;
import java.util.*;
public class WinGammaPlatformVC8 extends WinGammaPlatformVC7 {
diff --git a/src/share/tools/MakeDeps/WinGammaPlatformVC9.java b/src/share/tools/ProjectCreator/WinGammaPlatformVC9.java
index 0f1420992..273ea7ace 100644
--- a/src/share/tools/MakeDeps/WinGammaPlatformVC9.java
+++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,9 +22,6 @@
*
*/
-import java.io.*;
-import java.util.*;
-
public class WinGammaPlatformVC9 extends WinGammaPlatformVC8 {
String projectVersion() {return "9.00";};
diff --git a/src/share/tools/hsdis/hsdis-demo.c b/src/share/tools/hsdis/hsdis-demo.c
index 782bd1cfa..a86ea66f3 100644
--- a/src/share/tools/hsdis/hsdis-demo.c
+++ b/src/share/tools/hsdis/hsdis-demo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,6 +22,8 @@
*
*/
+#include "precompiled.hpp"
+
/* hsdis-demo.c -- dump a range of addresses as native instructions
This demonstrates the protocol required by the HotSpot PrintAssembly option.
*/
diff --git a/src/share/tools/hsdis/hsdis.c b/src/share/tools/hsdis/hsdis.c
index f4ec99d70..7736a8057 100644
--- a/src/share/tools/hsdis/hsdis.c
+++ b/src/share/tools/hsdis/hsdis.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,6 +22,8 @@
*
*/
+#include "precompiled.hpp"
+
/* hsdis.c -- dump a range of addresses as native instructions
This implements the plugin protocol required by the
HotSpot PrintAssembly option.
diff --git a/src/share/tools/hsdis/hsdis.h b/src/share/tools/hsdis/hsdis.h
index cee8102f6..d1b2dd964 100644
--- a/src/share/tools/hsdis/hsdis.h
+++ b/src/share/tools/hsdis/hsdis.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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