# HG changeset patch # User Doug Simon # Date 1326380921 -3600 # Node ID f8f262212aa40cb5bea50e5f96cdbc590257d030 # Parent afe0c2480dfd55c3809f2b53ca646d016a9d63d8 Modified 'mx build' to update graal_paths.hpp (if necessary). diff -r afe0c2480dfd -r f8f262212aa4 mx/commands.py --- 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') diff -r afe0c2480dfd -r f8f262212aa4 src/share/vm/graal/graal_paths.hpp --- 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"); -