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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 return None | 94 return None |
95 | 95 |
96 | 96 |
97 def UsingSysroot(target_arch, gyp_defines): | 97 def UsingSysroot(target_arch, gyp_defines): |
98 # ChromeOS uses a chroot, so doesn't need a sysroot | 98 # ChromeOS uses a chroot, so doesn't need a sysroot |
99 if 'chromeos=1' in gyp_defines: | 99 if 'chromeos=1' in gyp_defines: |
100 return False | 100 return False |
101 | 101 |
102 # When cross-compiling we always use a sysroot | 102 # When cross-compiling we always use a sysroot |
103 if target_arch in ('arm', 'mips', 'i386'): | 103 if target_arch in ('arm', 'mips', 'ia32'): |
104 return True | 104 return True |
105 | 105 |
106 # Setting use_sysroot=1 GYP_DEFINES forces the use of the sysroot even | 106 # Setting use_sysroot=1 GYP_DEFINES forces the use of the sysroot even |
107 # when not cross compiling | 107 # when not cross compiling |
108 if 'use_sysroot=1' in gyp_defines: | 108 if 'use_sysroot=1' in gyp_defines: |
109 return True | 109 return True |
110 | 110 |
111 # Official builds always use the sysroot. | 111 # Official builds always use the sysroot. |
112 if 'branding=Chrome' in gyp_defines and 'buildtype=Official' in gyp_defines: | 112 if 'branding=Chrome' in gyp_defines and 'buildtype=Official' in gyp_defines: |
113 return True | 113 return True |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 parser = optparse.OptionParser('usage: %prog [OPTIONS]') | 196 parser = optparse.OptionParser('usage: %prog [OPTIONS]') |
197 parser.add_option('--running-as-hook', action='store_true', | 197 parser.add_option('--running-as-hook', action='store_true', |
198 default=False, help='Used when running from gclient hooks.' | 198 default=False, help='Used when running from gclient hooks.' |
199 ' In this mode the sysroot will only ' | 199 ' In this mode the sysroot will only ' |
200 'be installed for official Linux ' | 200 'be installed for official Linux ' |
201 'builds or ARM Linux builds') | 201 'builds or ARM Linux builds') |
202 parser.add_option('--arch', type='choice', choices=valid_archs, | 202 parser.add_option('--arch', type='choice', choices=valid_archs, |
203 help='Sysroot architecture: %s' % ', '.join(valid_archs)) | 203 help='Sysroot architecture: %s' % ', '.join(valid_archs)) |
204 options, _ = parser.parse_args() | 204 options, _ = parser.parse_args() |
205 sys.exit(main()) | 205 sys.exit(main()) |
OLD | NEW |