changeset 4276:f8f262212aa4

Modified 'mx build' to update graal_paths.hpp (if necessary).
author Doug Simon <doug.simon@oracle.com>
date Thu, 12 Jan 2012 16:08:41 +0100
parents afe0c2480dfd
children 9a3a0cdb6e34 063ea022532c
files mx/commands.py src/share/vm/graal/graal_paths.hpp
diffstat 2 files changed, 42 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mx/commands.py	Thu Jan 12 14:56:18 2012 +0100
+++ b/mx/commands.py	Thu Jan 12 16:08:41 2012 +0100
@@ -26,7 +26,7 @@
 #
 # ----------------------------------------------------------------------------------------------------
 
-import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess
+import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, StringIO
 from os.path import join, exists, dirname, basename
 from argparse import ArgumentParser, REMAINDER
 import mx
@@ -36,6 +36,31 @@
 _vmSourcesAvailable = exists(join(_graal_home, 'make')) and exists(join(_graal_home, 'src')) 
 _vmbuild = 'product'
 
+_copyrightTemplate = """/*
+ * Copyright (c) {0}, 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.
+ */
+ 
+"""
+
 def clean(args):
     """cleans the GraalVM source tree"""
     opts = mx.clean(args, parser=ArgumentParser(prog='mx clean'))
@@ -304,6 +329,16 @@
             if not 'Xusage.txt' in line:
                 sys.stderr.write(line + os.linesep)
                 
+        # Update graal_paths.hpp
+        out = StringIO.StringIO()
+        out.write(_copyrightTemplate.format(time.strftime('%Y')))
+        for p in mx.project('com.oracle.max.graal.hotspot').all_deps([], False):
+            out.write('    prepend_to_graal_classpath(scp_compiler, graal_dir, "' + p.name + '");\n')
+        graalPaths = join(_graal_home, 'src', 'share', 'vm', 'graal', 'graal_paths.hpp')
+        assert exists(graalPaths), 'File does not exist: ' + graalPaths
+        mx.update_file(graalPaths, out.getvalue())
+        out.close()
+                
         if platform.system() == 'Windows':
             compilelogfile = _graal_home + '/graalCompile.log'
             mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin')
--- a/src/share/vm/graal/graal_paths.hpp	Thu Jan 12 14:56:18 2012 +0100
+++ b/src/share/vm/graal/graal_paths.hpp	Thu Jan 12 16:08:41 2012 +0100
@@ -20,17 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
+ 
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.cri");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.criutils");
-    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.base");
-    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.asmdis");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.asm");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.graph");
+    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.nodes");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.compiler");
-    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.nodes");
+    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.java");
+    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.printer");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.snippets");
+    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.base");
+    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.asmdis");
     prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.hotspot");
-    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.printer");
-    prepend_to_graal_classpath(scp_compiler, graal_dir, "com.oracle.max.graal.java");
-