Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium 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 optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import subprocess | 10 import subprocess |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 devnull = open(os.devnull, 'r') | 156 devnull = open(os.devnull, 'r') |
| 157 else: | 157 else: |
| 158 devnull = None | 158 devnull = None |
| 159 p = subprocess.Popen(cmd, cwd=NACL_DIR, stdin=devnull) | 159 p = subprocess.Popen(cmd, cwd=NACL_DIR, stdin=devnull) |
| 160 p.wait() | 160 p.wait() |
| 161 if p.returncode != 0: | 161 if p.returncode != 0: |
| 162 sys.exit(3) | 162 sys.exit(3) |
| 163 # Copy out each platform after stripping. | 163 # Copy out each platform after stripping. |
| 164 for platform in platforms: | 164 for platform in platforms: |
| 165 uplatform = platform.replace('-', '_') | 165 uplatform = platform.replace('-', '_') |
| 166 platform2 = {'x86-32': 'i686', 'x86-64': 'x86_64'}.get(platform, platform) | 166 platform2 = {'arm': 'pnacl', 'x86-32': 'i686', 'x86-64': 'x86_64'}.get(platf orm, platform) |
|
noelallen_use_chromium
2011/10/21 00:16:51
Inconsistent checks of arm and arm-thumb2
jasonwkim
2011/10/21 20:16:56
fixed.
| |
| 167 cplatform = { | 167 cplatform = { |
| 168 'win32': 'win', | 168 'win32': 'win', |
| 169 'cygwin': 'win', | 169 'cygwin': 'win', |
| 170 'darwin': 'mac', | 170 'darwin': 'mac', |
| 171 }.get(sys.platform, 'linux') | 171 }.get(sys.platform, 'linux') |
| 172 nexe = os.path.join(out_dir, 'nacl_irt_' + uplatform + '.nexe') | 172 nexe = os.path.join(out_dir, 'nacl_irt_' + uplatform + '.nexe') |
| 173 cmd = [ | 173 if platform in ('arm', 'arm-thumb2'): |
|
noelallen_use_chromium
2011/10/21 00:16:51
nit: I think we typically use lists not tupples fo
noelallen_use_chromium
2011/10/21 00:16:51
and here.
jasonwkim
2011/10/21 20:16:56
fixed
jasonwkim
2011/10/21 20:16:56
fixed
| |
| 174 '../native_client/toolchain/' + cplatform + '_x86_newlib/bin/' + | 174 cmd = [ |
| 175 '../native_client/toolchain/pnacl_linux_x86_64_newlib/bin/' + | |
| 176 platform2 + '-strip', | |
| 177 '--strip-debug', | |
| 178 '../native_client/scons-out/nacl_irt-' + platform + '/staging/irt.nexe ', | |
| 179 '-o', nexe | |
| 180 ] | |
| 181 else: | |
| 182 cmd = [ | |
| 183 '../native_client/toolchain/' + cplatform + '_x86_newlib/bin/' + | |
| 175 platform2 + '-nacl-strip', | 184 platform2 + '-nacl-strip', |
| 176 '--strip-debug', | 185 '--strip-debug', |
| 177 '../native_client/scons-out/nacl_irt-' + platform + '/staging/irt.nexe', | 186 '../native_client/scons-out/nacl_irt-' + platform + '/staging/irt.nexe ', |
| 178 '-o', nexe | 187 '-o', nexe |
| 179 ] | 188 ] |
| 180 print 'Running: ' + ' '.join(cmd) | 189 print 'Running: ' + ' '.join(cmd) |
| 181 p = subprocess.Popen(cmd, cwd=SCRIPT_DIR) | 190 p = subprocess.Popen(cmd, cwd=SCRIPT_DIR) |
| 182 p.wait() | 191 p.wait() |
| 183 if p.returncode != 0: | 192 if p.returncode != 0: |
| 184 sys.exit(4) | 193 sys.exit(4) |
| 185 | 194 |
| 186 | 195 |
| 187 def Main(argv): | 196 def Main(argv): |
| 188 parser = optparse.OptionParser() | 197 parser = optparse.OptionParser() |
| 189 parser.add_option('--inputs', dest='inputs', default=False, | 198 parser.add_option('--inputs', dest='inputs', default=False, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 201 sys.exit(1) | 210 sys.exit(1) |
| 202 | 211 |
| 203 if options.inputs: | 212 if options.inputs: |
| 204 PrintInputs(options.platforms) | 213 PrintInputs(options.platforms) |
| 205 else: | 214 else: |
| 206 BuildIRT(options.platforms, options.outdir) | 215 BuildIRT(options.platforms, options.outdir) |
| 207 | 216 |
| 208 | 217 |
| 209 if __name__ == '__main__': | 218 if __name__ == '__main__': |
| 210 Main(sys.argv) | 219 Main(sys.argv) |
| OLD | NEW |