OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """This script lays out the PNaCl translator files for a | 6 """This script lays out the PNaCl translator files for a |
7 normal Chrome installer, for one platform. Once run num-of-arches times, | 7 normal Chrome installer, for one platform. Once run num-of-arches times, |
8 the result can then be packed into a multi-CRX zip file. | 8 the result can then be packed into a multi-CRX zip file. |
9 | 9 |
10 This script depends on and pulls in the translator nexes and libraries | 10 This script depends on and pulls in the translator nexes and libraries |
(...skipping 20 matching lines...) Expand all Loading... |
31 # This is based on the machine "building" this extension. | 31 # This is based on the machine "building" this extension. |
32 # We also used this to identify the arch-specific different versions of | 32 # We also used this to identify the arch-specific different versions of |
33 # this extension. | 33 # this extension. |
34 | 34 |
35 def CanonicalArch(arch): | 35 def CanonicalArch(arch): |
36 if arch in ('x86_64', 'x86-64', 'x64', 'amd64'): | 36 if arch in ('x86_64', 'x86-64', 'x64', 'amd64'): |
37 return 'x86-64' | 37 return 'x86-64' |
38 # TODO(jvoung): be more specific about the arm architecture version? | 38 # TODO(jvoung): be more specific about the arm architecture version? |
39 if arch in ('arm', 'armv7'): | 39 if arch in ('arm', 'armv7'): |
40 return 'arm' | 40 return 'arm' |
| 41 if arch in ('mipsel'): |
| 42 return 'mips32' |
41 if re.match('^i.86$', arch) or arch in ('x86_32', 'x86-32', 'ia32', 'x86'): | 43 if re.match('^i.86$', arch) or arch in ('x86_32', 'x86-32', 'ia32', 'x86'): |
42 return 'x86-32' | 44 return 'x86-32' |
43 return None | 45 return None |
44 | 46 |
45 def GetBuildArch(): | 47 def GetBuildArch(): |
46 arch = platform.machine() | 48 arch = platform.machine() |
47 return CanonicalArch(arch) | 49 return CanonicalArch(arch) |
48 | 50 |
49 BUILD_ARCH = GetBuildArch() | 51 BUILD_ARCH = GetBuildArch() |
50 ARCHES = ['x86-32', 'x86-64', 'arm'] | 52 ARCHES = ['x86-32', 'x86-64', 'arm', 'mips32'] |
51 | 53 |
52 def IsValidArch(arch): | 54 def IsValidArch(arch): |
53 return arch in ARCHES | 55 return arch in ARCHES |
54 | 56 |
55 # The version of the arch used by configure and pnacl's build.sh. | 57 # The version of the arch used by configure and pnacl's build.sh. |
56 def StandardArch(arch): | 58 def StandardArch(arch): |
57 return {'x86-32': 'i686', | 59 return {'x86-32': 'i686', |
58 'x86-64': 'x86_64', | 60 'x86-64': 'x86_64', |
59 'arm' : 'armv7'}[arch] | 61 'arm' : 'armv7', |
| 62 'mips32': 'mips'}[arch] |
60 | 63 |
61 | 64 |
62 ###################################################################### | 65 ###################################################################### |
63 | 66 |
64 def GetNaClRoot(): | 67 def GetNaClRoot(): |
65 """ Find the native_client path, relative to this script. | 68 """ Find the native_client path, relative to this script. |
66 This script is in ppapi/... and native_client is a sibling of ppapi. | 69 This script is in ppapi/... and native_client is a sibling of ppapi. |
67 """ | 70 """ |
68 script_file = os.path.abspath(__file__) | 71 script_file = os.path.abspath(__file__) |
69 def SearchForNaCl(cur_dir): | 72 def SearchForNaCl(cur_dir): |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 375 |
373 abi_version = int(args[0]) | 376 abi_version = int(args[0]) |
374 | 377 |
375 arches = DetermineInstallerArches(options.target_arch) | 378 arches = DetermineInstallerArches(options.target_arch) |
376 BuildInstallerStyle(abi_version, lib_overrides, arches) | 379 BuildInstallerStyle(abi_version, lib_overrides, arches) |
377 return 0 | 380 return 0 |
378 | 381 |
379 | 382 |
380 if __name__ == '__main__': | 383 if __name__ == '__main__': |
381 sys.exit(Main()) | 384 sys.exit(Main()) |
OLD | NEW |