Mercurial > hg > truffle
comparison mx/mx_graal.py @ 21790:6db6070d30b9
Make jvmci.make stable; add header for building the jvmci.make; default to use the jvmci.make file when running mx.build
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 16:28:19 +0200 |
parents | c1610658bba0 |
children | cd36556e1b78 |
comparison
equal
deleted
inserted
replaced
21789:5b9adb645217 | 21790:6db6070d30b9 |
---|---|
837 """build the VM binary | 837 """build the VM binary |
838 | 838 |
839 The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" | 839 The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" |
840 | 840 |
841 # Turn all jdk distributions into non HotSpot; this is only necessary as long we support building/exporting JVMCI with make and mx | 841 # Turn all jdk distributions into non HotSpot; this is only necessary as long we support building/exporting JVMCI with make and mx |
842 if not ("-m" in args or "--use-make" in args): | 842 if "--avoid-make" not in args: |
843 for jdkDist in _jdkDeployedDists: | 843 for jdkDist in _jdkDeployedDists: |
844 if jdkDist.partOfHotSpot: | 844 if jdkDist.partOfHotSpot: |
845 jdkDist.partOfHotSpot = False | 845 jdkDist.partOfHotSpot = False |
846 | 846 |
847 # Override to fail quickly if extra arguments are given | 847 # Override to fail quickly if extra arguments are given |
860 | 860 |
861 # Call mx.build to compile the Java sources | 861 # Call mx.build to compile the Java sources |
862 parser = AP() | 862 parser = AP() |
863 parser.add_argument('--export-dir', help='directory to which JVMCI and Graal jars and jvmci.options will be copied', metavar='<path>') | 863 parser.add_argument('--export-dir', help='directory to which JVMCI and Graal jars and jvmci.options will be copied', metavar='<path>') |
864 parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value') | 864 parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value') |
865 parser.add_argument('-m', '--use-make', action='store_true', help='Use the jvmci.make file to build and export JVMCI') | 865 parser.add_argument('--avoid-make', action='store_true', help='Do not use jvmci.make file to build and export JVMCI') |
866 opts2 = mx.build(['--source', '1.7'] + args, parser=parser) | 866 opts2 = mx.build(['--source', '1.7'] + args, parser=parser) |
867 assert len(opts2.remainder) == 0 | 867 assert len(opts2.remainder) == 0 |
868 | 868 |
869 if opts2.export_dir is not None: | 869 if opts2.export_dir is not None: |
870 if not exists(opts2.export_dir): | 870 if not exists(opts2.export_dir): |
891 if defLine not in defs: | 891 if defLine not in defs: |
892 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) | 892 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) |
893 shutil.copy(dist.path, opts2.export_dir) | 893 shutil.copy(dist.path, opts2.export_dir) |
894 | 894 |
895 services, optionsFiles = _extractJVMCIFiles(jdkJars, jvmciJars, join(opts2.export_dir, 'services'), join(opts2.export_dir, 'options')) | 895 services, optionsFiles = _extractJVMCIFiles(jdkJars, jvmciJars, join(opts2.export_dir, 'services'), join(opts2.export_dir, 'options')) |
896 if not opts2.use_make: | 896 if opts2.avoid_make: |
897 for service in services: | 897 for service in services: |
898 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/' + service | 898 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/' + service |
899 if defLine not in defs: | 899 if defLine not in defs: |
900 mx.abort('Missing following line in ' + defsPath + ' for service from ' + dist.name + '\n' + defLine) | 900 mx.abort('Missing following line in ' + defsPath + ' for service from ' + dist.name + '\n' + defLine) |
901 for optionsFile in optionsFiles: | 901 for optionsFile in optionsFiles: |
1052 if build == 'jvmg': | 1052 if build == 'jvmg': |
1053 # We want ALL the symbols when debugging on Solaris | 1053 # We want ALL the symbols when debugging on Solaris |
1054 setMakeVar('STRIP_POLICY', 'no_strip') | 1054 setMakeVar('STRIP_POLICY', 'no_strip') |
1055 # This removes the need to unzip the *.diz files before debugging in gdb | 1055 # This removes the need to unzip the *.diz files before debugging in gdb |
1056 setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) | 1056 setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) |
1057 if opts2.use_make: | 1057 if not opts2.avoid_make: |
1058 setMakeVar('JVMCI_USE_MAKE', '1') | 1058 setMakeVar('JVMCI_USE_MAKE', '1') |
1059 # Clear this variable as having it set can cause very confusing build problems | 1059 # Clear this variable as having it set can cause very confusing build problems |
1060 env.pop('CLASSPATH', None) | 1060 env.pop('CLASSPATH', None) |
1061 | 1061 |
1062 # Issue an env prefix that can be used to run the make on the command line | 1062 # Issue an env prefix that can be used to run the make on the command line |
1064 mx.log('--------------- make command line ----------------------') | 1064 mx.log('--------------- make command line ----------------------') |
1065 | 1065 |
1066 envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) | 1066 envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) |
1067 if len(envPrefix): | 1067 if len(envPrefix): |
1068 mx.log('env ' + envPrefix + ' \\') | 1068 mx.log('env ' + envPrefix + ' \\') |
1069 makeTarget = "all_" + build + buildSuffix if opts2.use_make else build + buildSuffix | 1069 makeTarget = "all_" + build + buildSuffix if not opts2.avoid_make else build + buildSuffix |
1070 runCmd.append(makeTarget) | 1070 runCmd.append(makeTarget) |
1071 | 1071 |
1072 if not mx._opts.verbose: | 1072 if not mx._opts.verbose: |
1073 mx.log(' '.join(runCmd)) | 1073 mx.log(' '.join(runCmd)) |
1074 mx.log('--------------------------------------------------------') | 1074 mx.log('--------------------------------------------------------') |