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 import platform | 6 import platform |
7 import os | 7 import os |
8 import random | 8 import random |
9 import re | 9 import re |
10 import shlex | 10 import shlex |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 @env.register | 223 @env.register |
224 def FindBaseHost(tool): | 224 def FindBaseHost(tool): |
225 """ Find the base directory for host binaries (i.e. llvm/binutils) """ | 225 """ Find the base directory for host binaries (i.e. llvm/binutils) """ |
226 if env.has('BPREFIXES'): | 226 if env.has('BPREFIXES'): |
227 for prefix in env.get('BPREFIXES'): | 227 for prefix in env.get('BPREFIXES'): |
228 if os.path.exists(pathtools.join(prefix, 'bin', | 228 if os.path.exists(pathtools.join(prefix, 'bin', |
229 tool + env.getone('EXEC_EXT'))): | 229 tool + env.getone('EXEC_EXT'))): |
230 return prefix | 230 return prefix |
231 | 231 |
232 base_pnacl = FindBasePNaCl() | 232 base_pnacl = FindBasePNaCl() |
233 base_host = pathtools.join(base_pnacl, 'host_' + env.getone('HOST_ARCH')) | 233 if not pathtools.exists(pathtools.join(base_pnacl, 'bin', |
234 if not pathtools.exists(pathtools.join(base_host, 'bin', | |
235 tool + env.getone('EXEC_EXT'))): | 234 tool + env.getone('EXEC_EXT'))): |
236 Log.Fatal('Could not find PNaCl host directory for ' + tool) | 235 Log.Fatal('Could not find PNaCl host directory for ' + tool) |
237 return base_host | 236 return base_pnacl |
238 | 237 |
239 def ReadConfig(): | 238 def ReadConfig(): |
240 # Mock out ReadConfig if running unittests. Settings are applied directly | 239 # Mock out ReadConfig if running unittests. Settings are applied directly |
241 # by DriverTestEnv rather than reading this configuration file. | 240 # by DriverTestEnv rather than reading this configuration file. |
242 if env.has('PNACL_RUNNING_UNITTESTS'): | 241 if env.has('PNACL_RUNNING_UNITTESTS'): |
243 return | 242 return |
244 driver_bin = env.getone('DRIVER_BIN') | 243 driver_bin = env.getone('DRIVER_BIN') |
245 driver_conf = pathtools.join(driver_bin, 'driver.conf') | 244 driver_conf = pathtools.join(driver_bin, 'driver.conf') |
246 fp = DriverOpen(driver_conf, 'r') | 245 fp = DriverOpen(driver_conf, 'r') |
247 linecount = 0 | 246 linecount = 0 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 # Last step | 874 # Last step |
876 step_output = self.output | 875 step_output = self.output |
877 else: | 876 else: |
878 # Intermediate step | 877 # Intermediate step |
879 if self.use_names_for_input: | 878 if self.use_names_for_input: |
880 step_output = self.namegen.TempNameForInput(self.input, output_type) | 879 step_output = self.namegen.TempNameForInput(self.input, output_type) |
881 else: | 880 else: |
882 step_output = self.namegen.TempNameForOutput(output_type) | 881 step_output = self.namegen.TempNameForOutput(output_type) |
883 callback(step_input, step_output, **extra) | 882 callback(step_input, step_output, **extra) |
884 step_input = step_output | 883 step_input = step_output |
OLD | NEW |