| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 is used to download prebuilt clang binaries. | 6 """This script is used to download prebuilt clang binaries. |
| 7 | 7 |
| 8 It is also used by package.py to build the prebuilt clang binaries.""" | 8 It is also used by package.py to build the prebuilt clang binaries.""" |
| 9 | 9 |
| 10 import argparse | 10 import argparse |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 f.write('endif (CHROMIUM_TOOLS_SRC)\n') | 272 f.write('endif (CHROMIUM_TOOLS_SRC)\n') |
| 273 | 273 |
| 274 | 274 |
| 275 def MaybeDownloadHostGcc(args): | 275 def MaybeDownloadHostGcc(args): |
| 276 """Downloads gcc 4.8.2 if needed and makes sure args.gcc_toolchain is set.""" | 276 """Downloads gcc 4.8.2 if needed and makes sure args.gcc_toolchain is set.""" |
| 277 if not sys.platform.startswith('linux') or args.gcc_toolchain: | 277 if not sys.platform.startswith('linux') or args.gcc_toolchain: |
| 278 return | 278 return |
| 279 | 279 |
| 280 if subprocess.check_output(['gcc', '-dumpversion']).rstrip() < '4.7.0': | 280 if subprocess.check_output(['gcc', '-dumpversion']).rstrip() < '4.7.0': |
| 281 # We need a newer gcc version. | 281 # We need a newer gcc version. |
| 282 gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc482') | 282 gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc482precise') |
| 283 if not os.path.exists(gcc_dir): | 283 if not os.path.exists(gcc_dir): |
| 284 print 'Downloading pre-built GCC 4.8.2...' | 284 print 'Downloading pre-built GCC 4.8.2...' |
| 285 DownloadAndUnpack(CDS_URL + '/tools/gcc482.tgz', LLVM_BUILD_TOOLS_DIR) | 285 DownloadAndUnpack( |
| 286 CDS_URL + '/tools/gcc482precise.tgz', LLVM_BUILD_TOOLS_DIR) |
| 286 args.gcc_toolchain = gcc_dir | 287 args.gcc_toolchain = gcc_dir |
| 287 else: | 288 else: |
| 288 # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++. | 289 # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++. |
| 289 args.gcc_toolchain = \ | 290 args.gcc_toolchain = \ |
| 290 os.path.dirname(os.path.dirname(distutils.spawn.find_executable('gcc'))) | 291 os.path.dirname(os.path.dirname(distutils.spawn.find_executable('gcc'))) |
| 291 | 292 |
| 292 | 293 |
| 293 def AddCMakeToPath(): | 294 def AddCMakeToPath(): |
| 294 """Download CMake and add it to PATH.""" | 295 """Download CMake and add it to PATH.""" |
| 295 if sys.platform == 'win32': | 296 if sys.platform == 'win32': |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 args.force_local_build = True | 810 args.force_local_build = True |
| 810 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 811 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
| 811 # Only build the Android ASan rt on ToT bots when targetting Android. | 812 # Only build the Android ASan rt on ToT bots when targetting Android. |
| 812 args.with_android = False | 813 args.with_android = False |
| 813 | 814 |
| 814 return UpdateClang(args) | 815 return UpdateClang(args) |
| 815 | 816 |
| 816 | 817 |
| 817 if __name__ == '__main__': | 818 if __name__ == '__main__': |
| 818 sys.exit(main()) | 819 sys.exit(main()) |
| OLD | NEW |