Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 # Script to install a Debian Wheezy sysroot for making official Google Chrome | 6 # Script to install a Debian Wheezy sysroot for making official Google Chrome |
| 7 # Linux builds. | 7 # Linux builds. |
| 8 # The sysroot is needed to make Chrome work for Debian Wheezy. | 8 # The sysroot is needed to make Chrome work for Debian Wheezy. |
| 9 # This script can be run manually but is more often run as part of gclient | 9 # This script can be run manually but is more often run as part of gclient |
| 10 # hooks. When run from hooks this script should be a no-op on non-linux | 10 # hooks. When run from hooks this script should be a no-op on non-linux |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 target_arch = options.arch | 125 target_arch = options.arch |
| 126 else: | 126 else: |
| 127 target_arch = DetectArch(gyp_defines) | 127 target_arch = DetectArch(gyp_defines) |
| 128 if not target_arch: | 128 if not target_arch: |
| 129 print 'Unable to detect host architecture' | 129 print 'Unable to detect host architecture' |
| 130 return 1 | 130 return 1 |
| 131 | 131 |
| 132 if options.running_as_hook and not UsingSysroot(target_arch, gyp_defines): | 132 if options.running_as_hook and not UsingSysroot(target_arch, gyp_defines): |
| 133 return 0 | 133 return 0 |
| 134 | 134 |
| 135 # Android requires both 32 and 64 bit sysroots (for v8 snapshots). | |
| 136 if target_arch == 'amd64': | |
|
Dirk Pranke
2015/11/05 22:49:38
I'm confused. I thought we established that you ne
agrieve
2015/11/06 03:25:22
Ah, okay, the build instructions I was following d
| |
| 137 ret = _InstallSysroot(target_arch) | |
| 138 if ret: | |
| 139 return ret | |
| 140 target_arch = 'i386' | |
| 141 | |
| 142 return _InstallSysroot(target_arch) | |
| 143 | |
| 144 | |
| 145 def _InstallSysroot(target_arch): | |
| 135 # The sysroot directory should match the one specified in build/common.gypi. | 146 # The sysroot directory should match the one specified in build/common.gypi. |
| 136 # TODO(thestig) Consider putting this else where to avoid having to recreate | 147 # TODO(thestig) Consider putting this else where to avoid having to recreate |
| 137 # it on every build. | 148 # it on every build. |
| 138 linux_dir = os.path.dirname(SCRIPT_DIR) | 149 linux_dir = os.path.dirname(SCRIPT_DIR) |
| 139 if target_arch == 'amd64': | 150 if target_arch == 'amd64': |
| 140 sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64) | 151 sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64) |
| 141 tarball_filename = TARBALL_AMD64 | 152 tarball_filename = TARBALL_AMD64 |
| 142 tarball_sha1sum = TARBALL_AMD64_SHA1SUM | 153 tarball_sha1sum = TARBALL_AMD64_SHA1SUM |
| 143 revision = REVISION_AMD64 | 154 revision = REVISION_AMD64 |
| 144 elif target_arch == 'arm': | 155 elif target_arch == 'arm': |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 parser = optparse.OptionParser('usage: %prog [OPTIONS]') | 207 parser = optparse.OptionParser('usage: %prog [OPTIONS]') |
| 197 parser.add_option('--running-as-hook', action='store_true', | 208 parser.add_option('--running-as-hook', action='store_true', |
| 198 default=False, help='Used when running from gclient hooks.' | 209 default=False, help='Used when running from gclient hooks.' |
| 199 ' In this mode the sysroot will only ' | 210 ' In this mode the sysroot will only ' |
| 200 'be installed for official Linux ' | 211 'be installed for official Linux ' |
| 201 'builds or ARM Linux builds') | 212 'builds or ARM Linux builds') |
| 202 parser.add_option('--arch', type='choice', choices=valid_archs, | 213 parser.add_option('--arch', type='choice', choices=valid_archs, |
| 203 help='Sysroot architecture: %s' % ', '.join(valid_archs)) | 214 help='Sysroot architecture: %s' % ', '.join(valid_archs)) |
| 204 options, _ = parser.parse_args() | 215 options, _ = parser.parse_args() |
| 205 sys.exit(main()) | 216 sys.exit(main()) |
| OLD | NEW |