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 # Get svn if we're going to use it to check the revision or do a local build. |
| 884 if (use_head_revision or args.llvm_force_head_revision or |
| 885 args.force_local_build): |
| 886 AddSvnToPathOnWin() |
| 887 |
884 global CLANG_REVISION, PACKAGE_VERSION | 888 global CLANG_REVISION, PACKAGE_VERSION |
885 if args.print_revision: | 889 if args.print_revision: |
886 if use_head_revision or args.llvm_force_head_revision: | 890 if use_head_revision or args.llvm_force_head_revision: |
887 print GetSvnRevision(LLVM_DIR) | 891 print GetSvnRevision(LLVM_DIR) |
888 else: | 892 else: |
889 print PACKAGE_VERSION | 893 print PACKAGE_VERSION |
890 return 0 | 894 return 0 |
891 | 895 |
892 if args.print_clang_version: | 896 if args.print_clang_version: |
893 sys.stdout.write(VERSION) | 897 sys.stdout.write(VERSION) |
(...skipping 13 matching lines...) Expand all Loading... |
907 args.force_local_build = True | 911 args.force_local_build = True |
908 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 912 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
909 # Only build the Android ASan rt on ToT bots when targetting Android. | 913 # Only build the Android ASan rt on ToT bots when targetting Android. |
910 args.with_android = False | 914 args.with_android = False |
911 | 915 |
912 return UpdateClang(args) | 916 return UpdateClang(args) |
913 | 917 |
914 | 918 |
915 if __name__ == '__main__': | 919 if __name__ == '__main__': |
916 sys.exit(main()) | 920 sys.exit(main()) |
OLD | NEW |