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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 print ('unexpected clang version %s (not %s), update VERSION in update.py' | 392 print ('unexpected clang version %s (not %s), update VERSION in update.py' |
393 % (version_out, VERSION)) | 393 % (version_out, VERSION)) |
394 sys.exit(1) | 394 sys.exit(1) |
395 | 395 |
396 | 396 |
397 def UpdateClang(args): | 397 def UpdateClang(args): |
398 print 'Updating Clang to %s...' % PACKAGE_VERSION | 398 print 'Updating Clang to %s...' % PACKAGE_VERSION |
399 | 399 |
400 need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or ( | 400 need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or ( |
401 sys.platform.startswith('linux') and | 401 sys.platform.startswith('linux') and |
402 'buildtype=Official' in os.environ.get('GYP_DEFINES', '') and | 402 'buildtype=Official' in os.environ.get('GYP_DEFINES', '')) |
403 'branding=Chrome' in os.environ.get('GYP_DEFINES', '')) | |
404 | 403 |
405 if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build: | 404 if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build: |
406 print 'Clang is already up to date.' | 405 print 'Clang is already up to date.' |
407 if not need_gold_plugin or os.path.exists( | 406 if not need_gold_plugin or os.path.exists( |
408 os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")): | 407 os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")): |
409 return 0 | 408 return 0 |
410 | 409 |
411 # Reset the stamp file in case the build is unsuccessful. | 410 # Reset the stamp file in case the build is unsuccessful. |
412 WriteStampFile('') | 411 WriteStampFile('') |
413 | 412 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 args.force_local_build = True | 906 args.force_local_build = True |
908 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 907 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
909 # Only build the Android ASan rt on ToT bots when targetting Android. | 908 # Only build the Android ASan rt on ToT bots when targetting Android. |
910 args.with_android = False | 909 args.with_android = False |
911 | 910 |
912 return UpdateClang(args) | 911 return UpdateClang(args) |
913 | 912 |
914 | 913 |
915 if __name__ == '__main__': | 914 if __name__ == '__main__': |
916 sys.exit(main()) | 915 sys.exit(main()) |
OLD | NEW |