| 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 """Windows can't run .sh files, so this is a Python implementation of | 6 """Windows can't run .sh files, so this is a Python implementation of |
| 7 update.sh. This script should replace update.sh on all platforms eventually.""" | 7 update.sh. This script should replace update.sh on all platforms eventually.""" |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if not os.path.exists(asan_rt_lib_dst_dir): | 153 if not os.path.exists(asan_rt_lib_dst_dir): |
| 154 os.makedirs(asan_rt_lib_dst_dir) | 154 os.makedirs(asan_rt_lib_dst_dir) |
| 155 for root, _, files in os.walk(asan_rt_lib_src_dir): | 155 for root, _, files in os.walk(asan_rt_lib_src_dir): |
| 156 for f in files: | 156 for f in files: |
| 157 if re.match(r'^.*-i386\.lib$', f): | 157 if re.match(r'^.*-i386\.lib$', f): |
| 158 CopyFile(os.path.join(root, f), asan_rt_lib_dst_dir) | 158 CopyFile(os.path.join(root, f), asan_rt_lib_dst_dir) |
| 159 | 159 |
| 160 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), | 160 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), |
| 161 os.path.join(asan_rt_lib_dst_dir, '..', '..')) | 161 os.path.join(asan_rt_lib_dst_dir, '..', '..')) |
| 162 | 162 |
| 163 # Make an extra copy of the sanitizer headers, to be put on the include path |
| 164 # of the fallback compiler. |
| 165 sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '3.5.0', |
| 166 'include', 'sanitizer') |
| 167 aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
| 168 '3.5.0', 'include_sanitizer', |
| 169 'sanitizer') |
| 170 if not os.path.exists(aux_sanitizer_include_dir): |
| 171 os.makedirs(aux_sanitizer_include_dir) |
| 172 for _, _, files in os.walk(sanitizer_include_dir): |
| 173 for f in files: |
| 174 CopyFile(os.path.join(sanitizer_include_dir, f), |
| 175 aux_sanitizer_include_dir) |
| 176 |
| 163 WriteStampFile(LLVM_WIN_REVISION) | 177 WriteStampFile(LLVM_WIN_REVISION) |
| 164 print 'Clang update was successful.' | 178 print 'Clang update was successful.' |
| 165 return 0 | 179 return 0 |
| 166 | 180 |
| 167 | 181 |
| 168 def main(): | 182 def main(): |
| 169 if not sys.platform in ['win32', 'cygwin']: | 183 if not sys.platform in ['win32', 'cygwin']: |
| 170 # For non-Windows, fall back to update.sh. | 184 # For non-Windows, fall back to update.sh. |
| 171 # TODO(hans): Make update.py replace update.sh completely. | 185 # TODO(hans): Make update.py replace update.sh completely. |
| 172 | 186 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 189 | 203 |
| 190 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 204 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
| 191 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 205 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
| 192 return 0 | 206 return 0 |
| 193 | 207 |
| 194 return UpdateClang() | 208 return UpdateClang() |
| 195 | 209 |
| 196 | 210 |
| 197 if __name__ == '__main__': | 211 if __name__ == '__main__': |
| 198 sys.exit(main()) | 212 sys.exit(main()) |
| OLD | NEW |