Chromium Code Reviews| 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 """NEXE building script | 6 """NEXE building script |
| 7 | 7 |
| 8 This module will take a set of source files, include paths, library paths, and | 8 This module will take a set of source files, include paths, library paths, and |
| 9 additional arguments, and use them to build. | 9 additional arguments, and use them to build. |
| 10 """ | 10 """ |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 self.is_pnacl_toolchain = True | 162 self.is_pnacl_toolchain = True |
| 163 | 163 |
| 164 if arch in ['x86-32', 'x86-64']: | 164 if arch in ['x86-32', 'x86-64']: |
| 165 mainarch = 'x86' | 165 mainarch = 'x86' |
| 166 self.subarch = arch.split('-')[1] | 166 self.subarch = arch.split('-')[1] |
| 167 self.tool_prefix = 'x86_64-nacl-' | 167 self.tool_prefix = 'x86_64-nacl-' |
| 168 elif arch == 'arm': | 168 elif arch == 'arm': |
| 169 self.subarch = '' | 169 self.subarch = '' |
| 170 self.tool_prefix = 'arm-nacl-' | 170 self.tool_prefix = 'arm-nacl-' |
| 171 mainarch = 'arm' | 171 mainarch = 'arm' |
| 172 elif arch == 'mips': | |
| 173 self.is_pnacl_toolchain = True | |
| 172 elif arch == 'pnacl': | 174 elif arch == 'pnacl': |
| 173 self.subarch = '' | 175 self.subarch = '' |
| 174 self.is_pnacl_toolchain = True | 176 self.is_pnacl_toolchain = True |
| 175 else: | 177 else: |
| 176 raise Error('Toolchain architecture %s not supported.' % arch) | 178 raise Error('Toolchain architecture %s not supported.' % arch) |
| 177 | 179 |
| 178 if toolname not in ['newlib', 'glibc']: | 180 if toolname not in ['newlib', 'glibc']: |
| 179 raise Error('Toolchain of type %s not supported.' % toolname) | 181 raise Error('Toolchain of type %s not supported.' % toolname) |
| 180 | 182 |
| 181 if arch == 'arm' and toolname == 'glibc': | 183 if arch == 'arm' and toolname == 'glibc': |
| 182 raise Error('arm glibc not yet supported.') | 184 raise Error('arm glibc not yet supported.') |
| 183 | 185 |
| 186 if arch == 'mips' and toolname == 'glibc': | |
| 187 ErrOut('mips glibc not supported.') | |
|
Mark Seaborn
2013/09/20 23:11:17
The surrounding code uses "raise Error"
petarj
2013/09/23 17:49:24
Done.
| |
| 188 | |
| 184 if arch == 'pnacl' and toolname == 'glibc': | 189 if arch == 'pnacl' and toolname == 'glibc': |
| 185 raise Error('pnacl glibc not yet supported.') | 190 raise Error('pnacl glibc not yet supported.') |
| 186 | 191 |
| 187 if self.is_pnacl_toolchain: | 192 if self.is_pnacl_toolchain: |
| 188 self.tool_prefix = 'pnacl-' | 193 self.tool_prefix = 'pnacl-' |
| 189 tooldir = '%s_pnacl' % self.osname | 194 tooldir = '%s_pnacl' % self.osname |
| 190 else: | 195 else: |
| 191 tooldir = '%s_%s_%s' % (self.osname, mainarch, toolname) | 196 tooldir = '%s_%s_%s' % (self.osname, mainarch, toolname) |
| 192 | 197 |
| 193 self.root_path = options.root | 198 self.root_path = options.root |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 749 shutil.copy(objs[0], options.name) | 754 shutil.copy(objs[0], options.name) |
| 750 else: | 755 else: |
| 751 build.Generate(objs) | 756 build.Generate(objs) |
| 752 return 0 | 757 return 0 |
| 753 except Error as e: | 758 except Error as e: |
| 754 sys.stderr.write('%s\n' % e) | 759 sys.stderr.write('%s\n' % e) |
| 755 return 1 | 760 return 1 |
| 756 | 761 |
| 757 if __name__ == '__main__': | 762 if __name__ == '__main__': |
| 758 sys.exit(Main(sys.argv)) | 763 sys.exit(Main(sys.argv)) |
| OLD | NEW |