OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 29 matching lines...) Expand all Loading... |
40 v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) | 40 v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) |
41 | 41 |
42 if __name__ == '__main__': | 42 if __name__ == '__main__': |
43 os.chdir(v8_root) | 43 os.chdir(v8_root) |
44 script_dir = os.path.dirname(__file__) | 44 script_dir = os.path.dirname(__file__) |
45 v8_root = '.' | 45 v8_root = '.' |
46 | 46 |
47 sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) | 47 sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) |
48 import gyp | 48 import gyp |
49 | 49 |
| 50 # Add paths so that pymod_do_main(...) can import files. |
| 51 sys.path.insert( |
| 52 1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers'))) |
| 53 |
50 | 54 |
51 def apply_gyp_environment(file_path=None): | 55 def apply_gyp_environment(file_path=None): |
52 """ | 56 """ |
53 Reads in a *.gyp_env file and applies the valid keys to os.environ. | 57 Reads in a *.gyp_env file and applies the valid keys to os.environ. |
54 """ | 58 """ |
55 if not file_path or not os.path.exists(file_path): | 59 if not file_path or not os.path.exists(file_path): |
56 return | 60 return |
57 file_contents = open(file_path).read() | 61 file_contents = open(file_path).read() |
58 try: | 62 try: |
59 file_data = eval(file_contents, {'__builtins__': None}, None) | 63 file_data = eval(file_contents, {'__builtins__': None}, None) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 args.append('--check') | 162 args.append('--check') |
159 | 163 |
160 print 'Updating projects from gyp files...' | 164 print 'Updating projects from gyp files...' |
161 sys.stdout.flush() | 165 sys.stdout.flush() |
162 | 166 |
163 # Generate for the architectures supported on the given platform. | 167 # Generate for the architectures supported on the given platform. |
164 gyp_args = list(args) | 168 gyp_args = list(args) |
165 if platform.system() == 'Linux': | 169 if platform.system() == 'Linux': |
166 gyp_args.append('--generator-output=out') | 170 gyp_args.append('--generator-output=out') |
167 run_gyp(gyp_args) | 171 run_gyp(gyp_args) |
OLD | NEW |