| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can b | 2 # Use of this source code is governed by a BSD-style license that can b |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Enumerates the BoringSSL source in src/ and generates two gypi files: | 5 """Enumerates the BoringSSL source in src/ and generates two gypi files: |
| 6 boringssl.gypi and boringssl_tests.gypi.""" | 6 boringssl.gypi and boringssl_tests.gypi.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 out.write(' \'%s\': [\n' % name) | 186 out.write(' \'%s\': [\n' % name) |
| 187 for f in sorted(files): | 187 for f in sorted(files): |
| 188 out.write(' \'%s\',\n' % f) | 188 out.write(' \'%s\',\n' % f) |
| 189 out.write(' ],\n') | 189 out.write(' ],\n') |
| 190 | 190 |
| 191 | 191 |
| 192 def main(): | 192 def main(): |
| 193 crypto_c_files = FindCFiles(os.path.join('src', 'crypto'), NoTests) | 193 crypto_c_files = FindCFiles(os.path.join('src', 'crypto'), NoTests) |
| 194 ssl_c_files = FindCFiles(os.path.join('src', 'ssl'), NoTests) | 194 ssl_c_files = FindCFiles(os.path.join('src', 'ssl'), NoTests) |
| 195 | 195 |
| 196 # Generate err_data.c |
| 197 with open('err_data.c', 'w+') as err_data: |
| 198 subprocess.check_call(['go', 'run', 'err_data_generate.go'], |
| 199 cwd=os.path.join('src', 'crypto', 'err'), |
| 200 stdout=err_data) |
| 201 crypto_c_files.append('err_data.c') |
| 202 |
| 196 with open('boringssl.gypi', 'w+') as gypi: | 203 with open('boringssl.gypi', 'w+') as gypi: |
| 197 gypi.write(FILE_HEADER + '{\n \'variables\': {\n') | 204 gypi.write(FILE_HEADER + '{\n \'variables\': {\n') |
| 198 | 205 |
| 199 PrintVariableSection( | 206 PrintVariableSection( |
| 200 gypi, 'boringssl_lib_sources', crypto_c_files + ssl_c_files) | 207 gypi, 'boringssl_lib_sources', crypto_c_files + ssl_c_files) |
| 201 | 208 |
| 202 perlasms = ReadPerlAsmOperations() | 209 perlasms = ReadPerlAsmOperations() |
| 203 | 210 |
| 204 for ((osname, arch), asm_files) in sorted( | 211 for ((osname, arch), asm_files) in sorted( |
| 205 WriteAsmFiles(perlasms).iteritems()): | 212 WriteAsmFiles(perlasms).iteritems()): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 for test in test_names: | 248 for test in test_names: |
| 242 test_gypi.write(""" '%s',\n""" % test) | 249 test_gypi.write(""" '%s',\n""" % test) |
| 243 | 250 |
| 244 test_gypi.write(' ],\n }\n}\n') | 251 test_gypi.write(' ],\n }\n}\n') |
| 245 | 252 |
| 246 return 0 | 253 return 0 |
| 247 | 254 |
| 248 | 255 |
| 249 if __name__ == '__main__': | 256 if __name__ == '__main__': |
| 250 sys.exit(main()) | 257 sys.exit(main()) |
| OLD | NEW |