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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 (x86_runtime, x64_runtime)) | 111 (x86_runtime, x64_runtime)) |
112 | 112 |
113 if rc != 0: | 113 if rc != 0: |
114 print 'Error running GYP' | 114 print 'Error running GYP' |
115 sys.exit(rc) | 115 sys.exit(rc) |
116 | 116 |
117 | 117 |
118 if __name__ == '__main__': | 118 if __name__ == '__main__': |
119 args = sys.argv[1:] | 119 args = sys.argv[1:] |
120 | 120 |
121 if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): | 121 gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION') |
| 122 if gyp_chromium_no_action == '1': |
122 print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.' | 123 print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.' |
123 sys.exit(0) | 124 sys.exit(0) |
124 | 125 |
| 126 running_as_hook = '--running-as-hook' |
| 127 if running_as_hook in args and gyp_chromium_no_action != '0': |
| 128 print 'GYP is now disabled by default in runhooks.\n' |
| 129 print 'If you really want to run this, either run ' |
| 130 print '`python gypfiles/gyp_v8` explicitly by hand ' |
| 131 print 'or set the environment variable GYP_CHROMIUM_NO_ACTION=0.' |
| 132 sys.exit(0) |
| 133 |
| 134 if running_as_hook in args: |
| 135 args.remove(running_as_hook) |
| 136 |
125 gyp_environment.set_environment() | 137 gyp_environment.set_environment() |
126 | 138 |
127 # This could give false positives since it doesn't actually do real option | 139 # This could give false positives since it doesn't actually do real option |
128 # parsing. Oh well. | 140 # parsing. Oh well. |
129 gyp_file_specified = False | 141 gyp_file_specified = False |
130 for arg in args: | 142 for arg in args: |
131 if arg.endswith('.gyp'): | 143 if arg.endswith('.gyp'): |
132 gyp_file_specified = True | 144 gyp_file_specified = True |
133 break | 145 break |
134 | 146 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 188 |
177 gyp_defines = os.environ.get('GYP_DEFINES', '') | 189 gyp_defines = os.environ.get('GYP_DEFINES', '') |
178 | 190 |
179 # Automatically turn on crosscompile support for platforms that need it. | 191 # Automatically turn on crosscompile support for platforms that need it. |
180 if all(('ninja' in gyp_generators, | 192 if all(('ninja' in gyp_generators, |
181 'OS=android' in gyp_defines, | 193 'OS=android' in gyp_defines, |
182 'GYP_CROSSCOMPILE' not in os.environ)): | 194 'GYP_CROSSCOMPILE' not in os.environ)): |
183 os.environ['GYP_CROSSCOMPILE'] = '1' | 195 os.environ['GYP_CROSSCOMPILE'] = '1' |
184 | 196 |
185 run_gyp(gyp_args) | 197 run_gyp(gyp_args) |
OLD | NEW |