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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 | 443 |
444 if args.with_android and not os.path.exists(ANDROID_NDK_DIR): | 444 if args.with_android and not os.path.exists(ANDROID_NDK_DIR): |
445 print 'Android NDK not found at ' + ANDROID_NDK_DIR | 445 print 'Android NDK not found at ' + ANDROID_NDK_DIR |
446 print 'The Android NDK is needed to build a Clang whose -fsanitize=address' | 446 print 'The Android NDK is needed to build a Clang whose -fsanitize=address' |
447 print 'works on Android. See ' | 447 print 'works on Android. See ' |
448 print 'https://www.chromium.org/developers/how-tos/android-build-instruction s' | 448 print 'https://www.chromium.org/developers/how-tos/android-build-instruction s' |
449 print 'for how to install the NDK, or pass --without-android.' | 449 print 'for how to install the NDK, or pass --without-android.' |
450 return 1 | 450 return 1 |
451 | 451 |
452 DownloadHostGcc(args) | 452 DownloadHostGcc(args) |
453 AddSvnToPathOnWin() | |
454 AddCMakeToPath() | 453 AddCMakeToPath() |
455 AddGnuWinToPath() | 454 AddGnuWinToPath() |
456 | 455 |
457 DeleteChromeToolsShim() | 456 DeleteChromeToolsShim() |
458 | 457 |
459 Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR) | 458 Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR) |
460 Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR) | 459 Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR) |
461 if sys.platform != 'darwin': | 460 if sys.platform != 'darwin': |
462 Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR) | 461 Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR) |
463 elif os.path.exists(LLD_DIR): | 462 elif os.path.exists(LLD_DIR): |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
874 if args.lto_gold_plugin and not sys.platform.startswith('linux'): | 873 if args.lto_gold_plugin and not sys.platform.startswith('linux'): |
875 print '--lto-gold-plugin is only effective on Linux. Ignoring the option.' | 874 print '--lto-gold-plugin is only effective on Linux. Ignoring the option.' |
876 args.lto_gold_plugin = False | 875 args.lto_gold_plugin = False |
877 | 876 |
878 if args.if_needed: | 877 if args.if_needed: |
879 # TODO(thakis): Can probably remove this and --if-needed altogether. | 878 # TODO(thakis): Can probably remove this and --if-needed altogether. |
880 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 879 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
881 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 880 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
882 return 0 | 881 return 0 |
883 | 882 |
883 if (use_head_revision or args.llvm_force_head_revision or | |
Reid Kleckner
2017/03/29 22:10:57
Do we need both the LLVM_USE_HEAD_REVISION environ
Nico
2017/03/29 23:16:41
Yes :-( This runs as a hook on bots, and there's n
| |
884 args.force_local_build): | |
885 AddSvnToPathOnWin() | |
886 | |
884 global CLANG_REVISION, PACKAGE_VERSION | 887 global CLANG_REVISION, PACKAGE_VERSION |
885 if args.print_revision: | 888 if args.print_revision: |
886 if use_head_revision or args.llvm_force_head_revision: | 889 if use_head_revision or args.llvm_force_head_revision: |
887 print GetSvnRevision(LLVM_DIR) | 890 print GetSvnRevision(LLVM_DIR) |
888 else: | 891 else: |
889 print PACKAGE_VERSION | 892 print PACKAGE_VERSION |
890 return 0 | 893 return 0 |
891 | 894 |
892 if args.print_clang_version: | 895 if args.print_clang_version: |
893 sys.stdout.write(VERSION) | 896 sys.stdout.write(VERSION) |
(...skipping 13 matching lines...) Expand all Loading... | |
907 args.force_local_build = True | 910 args.force_local_build = True |
908 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 911 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
909 # Only build the Android ASan rt on ToT bots when targetting Android. | 912 # Only build the Android ASan rt on ToT bots when targetting Android. |
910 args.with_android = False | 913 args.with_android = False |
911 | 914 |
912 return UpdateClang(args) | 915 return UpdateClang(args) |
913 | 916 |
914 | 917 |
915 if __name__ == '__main__': | 918 if __name__ == '__main__': |
916 sys.exit(main()) | 919 sys.exit(main()) |
OLD | NEW |