| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
| 8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
| 9 | 9 |
| 10 import glob | 10 import glob |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 # Use the Psyco JIT if available. | 298 # Use the Psyco JIT if available. |
| 299 if psyco: | 299 if psyco: |
| 300 psyco.profile() | 300 psyco.profile() |
| 301 print "Enabled Psyco JIT." | 301 print "Enabled Psyco JIT." |
| 302 | 302 |
| 303 # Fall back on hermetic python if we happen to get run under cygwin. | 303 # Fall back on hermetic python if we happen to get run under cygwin. |
| 304 # TODO(bradnelson): take this out once this issue is fixed: | 304 # TODO(bradnelson): take this out once this issue is fixed: |
| 305 # http://code.google.com/p/gyp/issues/detail?id=177 | 305 # http://code.google.com/p/gyp/issues/detail?id=177 |
| 306 if sys.platform == 'cygwin': | 306 if sys.platform == 'cygwin': |
| 307 python_dir = os.path.join(chrome_src, 'third_party', 'python_26') | 307 depot_tools_path = find_depot_tools.add_depot_tools_to_path() |
| 308 python_dir = sorted(glob.glob(os.path.join(depot_tools_path, |
| 309 'python2*_bin')))[-1] |
| 308 env = os.environ.copy() | 310 env = os.environ.copy() |
| 309 env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') | 311 env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') |
| 310 p = subprocess.Popen( | 312 p = subprocess.Popen( |
| 311 [os.path.join(python_dir, 'python.exe')] + sys.argv, | 313 [os.path.join(python_dir, 'python.exe')] + sys.argv, |
| 312 env=env, shell=False) | 314 env=env, shell=False) |
| 313 p.communicate() | 315 p.communicate() |
| 314 sys.exit(p.returncode) | 316 sys.exit(p.returncode) |
| 315 | 317 |
| 316 gyp_helper.apply_chromium_gyp_env() | 318 gyp_helper.apply_chromium_gyp_env() |
| 317 | 319 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 if not RunGN(supplemental_includes): | 397 if not RunGN(supplemental_includes): |
| 396 sys.exit(1) | 398 sys.exit(1) |
| 397 args.extend( | 399 args.extend( |
| 398 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) | 400 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) |
| 399 | 401 |
| 400 print 'Updating projects from gyp files...' | 402 print 'Updating projects from gyp files...' |
| 401 sys.stdout.flush() | 403 sys.stdout.flush() |
| 402 | 404 |
| 403 # Off we go... | 405 # Off we go... |
| 404 sys.exit(gyp.main(args)) | 406 sys.exit(gyp.main(args)) |
| OLD | NEW |