OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # IMPORTANT NOTE: If you make local mods to this file, you must run: | 6 # IMPORTANT NOTE: If you make local mods to this file, you must run: |
7 # % pnacl/build.sh driver | 7 # % pnacl/build.sh driver |
8 # in order for them to take effect in the scons build. This command | 8 # in order for them to take effect in the scons build. This command |
9 # updates the copy in the toolchain/ tree. | 9 # updates the copy in the toolchain/ tree. |
10 # | 10 # |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 msg = "%s: Skipping incompatible object file (%s != %s)" | 1067 msg = "%s: Skipping incompatible object file (%s != %s)" |
1068 logfunc = Log.Warning | 1068 logfunc = Log.Warning |
1069 logfunc(msg, filename, new_arch, existing_arch) | 1069 logfunc(msg, filename, new_arch, existing_arch) |
1070 return False | 1070 return False |
1071 else: # existing_arch and new_arch == existing_arch | 1071 else: # existing_arch and new_arch == existing_arch |
1072 return True | 1072 return True |
1073 | 1073 |
1074 def CheckTranslatorPrerequisites(): | 1074 def CheckTranslatorPrerequisites(): |
1075 """ Assert that the scons artifacts for running the sandboxed translator | 1075 """ Assert that the scons artifacts for running the sandboxed translator |
1076 exist: sel_universal, and sel_ldr. """ | 1076 exist: sel_universal, and sel_ldr. """ |
1077 for var in ['SEL_UNIVERSAL', 'SEL_LDR', 'BOOTSTRAP_LDR']: | 1077 reqs = ['SEL_UNIVERSAL', 'SEL_LDR'] |
| 1078 # Linux also requires the nacl bootstrap helper. |
| 1079 if GetBuildOS() == 'linux': |
| 1080 reqs.append('BOOTSTRAP_LDR') |
| 1081 for var in reqs: |
1078 needed_file = env.getone(var) | 1082 needed_file = env.getone(var) |
1079 if not pathtools.exists(needed_file): | 1083 if not pathtools.exists(needed_file): |
1080 Log.Fatal('Could not find %s [%s]', var, needed_file) | 1084 Log.Fatal('Could not find %s [%s]', var, needed_file) |
1081 | 1085 |
1082 class DriverChain(object): | 1086 class DriverChain(object): |
1083 """ The DriverChain class takes one or more input files, | 1087 """ The DriverChain class takes one or more input files, |
1084 an output file, and a sequence of steps. It executes | 1088 an output file, and a sequence of steps. It executes |
1085 those steps, using intermediate files in between, | 1089 those steps, using intermediate files in between, |
1086 to generate the final outpu. | 1090 to generate the final outpu. |
1087 """ | 1091 """ |
(...skipping 21 matching lines...) Expand all Loading... |
1109 # Last step | 1113 # Last step |
1110 step_output = self.output | 1114 step_output = self.output |
1111 else: | 1115 else: |
1112 # Intermediate step | 1116 # Intermediate step |
1113 if self.use_names_for_input: | 1117 if self.use_names_for_input: |
1114 step_output = self.namegen.TempNameForInput(self.input, output_type) | 1118 step_output = self.namegen.TempNameForInput(self.input, output_type) |
1115 else: | 1119 else: |
1116 step_output = self.namegen.TempNameForOutput(output_type) | 1120 step_output = self.namegen.TempNameForOutput(output_type) |
1117 callback(step_input, step_output, **extra) | 1121 callback(step_input, step_output, **extra) |
1118 step_input = step_output | 1122 step_input = step_output |
OLD | NEW |