17 """Enumerates source files for consumption by various build systems."""
29 (
'ios',
'arm',
'ios32', [],
'S'),
30 (
'ios',
'aarch64',
'ios64', [],
'S'),
31 (
'linux',
'arm',
'linux32', [],
'S'),
32 (
'linux',
'aarch64',
'linux64', [],
'S'),
33 (
'linux',
'ppc64le',
'linux64le', [],
'S'),
34 (
'linux',
'x86',
'elf', [
'-fPIC',
'-DOPENSSL_IA32_SSE2'],
'S'),
35 (
'linux',
'x86_64',
'elf', [],
'S'),
36 (
'mac',
'x86',
'macosx', [
'-fPIC',
'-DOPENSSL_IA32_SSE2'],
'S'),
37 (
'mac',
'x86_64',
'macosx', [],
'S'),
38 (
'win',
'x86',
'win32n', [
'-DOPENSSL_IA32_SSE2'],
'asm'),
39 (
'win',
'x86_64',
'nasm', [],
'asm'),
40 (
'win',
'aarch64',
'win64', [],
'S'),
47 'src/crypto/curve25519/asm/x25519-asm-arm.S',
48 'src/crypto/poly1305/poly1305_arm_asm.S',
50 (
'linux',
'x86_64'): [
51 'src/crypto/hrss/asm/poly_rq_mul.S',
56 EMBED_TEST_DATA =
True
60 return x
if not PREFIX
else os.path.join(PREFIX, x)
67 """# Copyright (C) 2015 The Android Open Source Project
69 # Licensed under the Apache License, Version 2.0 (the "License");
70 # you may not use this file except in compliance with the License.
71 # You may obtain a copy of the License at
73 # http://www.apache.org/licenses/LICENSE-2.0
75 # Unless required by applicable law or agreed to in writing, software
76 # distributed under the License is distributed on an "AS IS" BASIS,
77 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78 # See the License for the specific language governing permissions and
79 # limitations under the License.
81 # This file is created by generate_build_files.py. Do not edit manually.
85 out.write(
'%s := \\\n' % name)
86 for f
in sorted(files):
87 out.write(
' %s\\\n' % f)
92 with open(
'sources.bp',
'w+')
as blueprint:
93 blueprint.write(self.
header.replace(
'#',
'//'))
96 bcm_c_files = files[
'bcm_crypto']
97 non_bcm_c_files = [file
for file
in files[
'crypto']
if file
not in bcm_c_files]
101 self.
PrintDefaults(blueprint,
'libcrypto_sources', non_bcm_c_files, non_bcm_asm)
102 self.
PrintDefaults(blueprint,
'libcrypto_bcm_sources', bcm_c_files, bcm_asm)
103 self.
PrintDefaults(blueprint,
'libssl_sources', files[
'ssl'])
105 self.
PrintDefaults(blueprint,
'boringssl_test_support_sources', files[
'test_support'])
106 self.
PrintDefaults(blueprint,
'boringssl_crypto_test_sources', files[
'crypto_test'])
107 self.
PrintDefaults(blueprint,
'boringssl_ssl_test_sources', files[
'ssl_test'])
110 with open(
'sources.mk',
'w+')
as makefile:
111 makefile.write(self.
header)
115 for ((osname, arch), asm_files)
in asm_outputs:
116 if osname !=
'linux':
119 makefile,
'%s_%s_sources' % (osname, arch), asm_files)
122 """Print a cc_defaults section from a list of C files and optionally assembly outputs"""
123 blueprint.write(
'\n')
124 blueprint.write(
'cc_defaults {\n')
125 blueprint.write(
' name: "%s",\n' % name)
126 blueprint.write(
' srcs: [\n')
127 for f
in sorted(files):
128 blueprint.write(
' "%s",\n' % f)
129 blueprint.write(
' ],\n')
132 blueprint.write(
' target: {\n')
133 for ((osname, arch), asm_files)
in asm_outputs:
134 if osname !=
'linux' or arch ==
'ppc64le':
136 if arch ==
'aarch64':
139 blueprint.write(
' linux_%s: {\n' % arch)
140 blueprint.write(
' srcs: [\n')
141 for f
in sorted(asm_files):
142 blueprint.write(
' "%s",\n' % f)
143 blueprint.write(
' ],\n')
144 blueprint.write(
' },\n')
145 blueprint.write(
' },\n')
147 blueprint.write(
'}\n')
150 """Filter a list of assembly outputs based on whether they belong in BCM
153 asm: Assembly file lists to filter
154 want_bcm: If true then include BCM files, otherwise do not
157 A copy of |asm| with files filtered according to |want_bcm|
159 return [(archinfo, filter(
lambda p: (
"/crypto/fipsmodule/" in p) == want_bcm, files))
160 for (archinfo, files)
in asm]
167 """# Copyright (C) 2019 The Android Open Source Project
169 # Licensed under the Apache License, Version 2.0 (the "License");
170 # you may not use this file except in compliance with the License.
171 # You may obtain a copy of the License at
173 # http://www.apache.org/licenses/LICENSE-2.0
175 # Unless required by applicable law or agreed to in writing, software
176 # distributed under the License is distributed on an "AS IS" BASIS,
177 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
178 # See the License for the specific language governing permissions and
179 # limitations under the License.
181 # This file is created by generate_build_files.py. Do not edit manually.
182 # To specify a custom path prefix, set BORINGSSL_ROOT before including this
183 # file, or use list(TRANSFORM ... PREPEND) from CMake 3.12.
188 out.write(
'set(%s\n' % name)
189 for f
in sorted(files):
194 out.write(
' ${BORINGSSL_ROOT}%s\n' % f)
202 with open(
'android-sources.cmake',
'w+')
as out:
209 files[
'test_support'])
211 files[
'crypto_test'])
214 for ((osname, arch), asm_files)
in asm_outputs:
216 out,
'crypto_sources_%s_%s' % (osname, arch), asm_files)
220 """Bazel outputs files suitable for including in Bazel files."""
225 """# This file is created by generate_build_files.py. Do not edit manually.
234 out.write(
'%s = [\n' % name)
235 for f
in sorted(files):
236 out.write(
' "%s",\n' %
PathOf(f))
240 with open(
'BUILD.generated.bzl',
'w+')
as out:
246 out,
'ssl_internal_headers', files[
'ssl_internal_headers'])
250 out,
'crypto_internal_headers', files[
'crypto_internal_headers'])
255 for ((osname, arch), asm_files)
in asm_outputs:
257 out,
'crypto_sources_%s_%s' % (osname, arch), asm_files)
259 with open(
'BUILD.generated_tests.bzl',
'w+')
as out:
262 out.write(
'test_support_sources = [\n')
263 for filename
in sorted(files[
'test_support'] +
264 files[
'test_support_headers'] +
265 files[
'crypto_internal_headers'] +
266 files[
'ssl_internal_headers']):
267 if os.path.basename(filename) ==
'malloc.cc':
269 out.write(
' "%s",\n' %
PathOf(filename))
274 files[
'crypto_test'])
277 files[
'crypto_test_data'])
279 files[
'urandom_test'])
286 """# Copyright (C) 2017 The Android Open Source Project
288 # Licensed under the Apache License, Version 2.0 (the "License");
289 # you may not use this file except in compliance with the License.
290 # You may obtain a copy of the License at
292 # http://www.apache.org/licenses/LICENSE-2.0
294 # Unless required by applicable law or agreed to in writing, software
295 # distributed under the License is distributed on an "AS IS" BASIS,
296 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
297 # See the License for the specific language governing permissions and
298 # limitations under the License.
300 # This file is created by generate_build_files.py. Do not edit manually.
305 out.write(
'%s := \\\n' % name)
306 for f
in sorted(files):
307 out.write(
' %s\\\n' % f)
312 with open(
'eureka.mk',
'w+')
as makefile:
313 makefile.write(self.
header)
319 for ((osname, arch), asm_files)
in asm_outputs:
320 if osname !=
'linux':
323 makefile,
'%s_%s_sources' % (osname, arch), asm_files)
331 """# Copyright (c) 2016 The Chromium Authors. All rights reserved.
332 # Use of this source code is governed by a BSD-style license that can be
333 # found in the LICENSE file.
335 # This file is created by generate_build_files.py. Do not edit manually.
344 out.write(
'%s = [\n' % name)
345 for f
in sorted(files):
346 out.write(
' "%s",\n' % f)
350 with open(
'BUILD.generated.gni',
'w+')
as out:
355 files[
'crypto_internal_headers'])
357 files[
'crypto_headers'])
359 files[
'ssl'] + files[
'ssl_internal_headers'])
362 files[
'tool'] + files[
'tool_headers'])
364 for ((osname, arch), asm_files)
in asm_outputs:
366 out,
'crypto_sources_%s_%s' % (osname, arch), asm_files)
368 fuzzers = [os.path.splitext(os.path.basename(fuzzer))[0]
369 for fuzzer
in files[
'fuzz']]
372 with open(
'BUILD.generated_tests.gni',
'w+')
as out:
377 files[
'test_support'] +
378 files[
'test_support_headers'])
380 files[
'crypto_test'])
382 files[
'crypto_test_data'])
390 """# Copyright (c) 2016 The Chromium Authors. All rights reserved.
391 # Use of this source code is governed by a BSD-style license that can be
392 # found in the LICENSE file.
394 # This file is created by generate_build_files.py. Do not edit manually.
399 out.write(
' \'%s\': [\n' % name)
400 for f
in sorted(files):
401 out.write(
' \'%s\',\n' % f)
405 with open(
'boringssl.gypi',
'w+')
as gypi:
406 gypi.write(self.
header +
'{\n \'variables\': {\n')
409 files[
'ssl'] + files[
'ssl_headers'] +
410 files[
'ssl_internal_headers'])
412 files[
'crypto'] + files[
'crypto_headers'] +
413 files[
'crypto_internal_headers'])
415 for ((osname, arch), asm_files)
in asm_outputs:
417 (osname, arch), asm_files)
419 gypi.write(
' }\n}\n')
425 R'''# Copyright (c) 2019 The Chromium Authors. All rights reserved.
426 # Use of this source code is governed by a BSD-style license that can be
427 # found in the LICENSE file.
429 # This file is created by generate_build_files.py. Do not edit manually.
431 cmake_minimum_required(VERSION 3.5)
433 project(BoringSSL LANGUAGES C CXX)
435 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
439 if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
440 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fvisibility=hidden -fno-common -fno-exceptions -fno-rtti")
442 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
445 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fno-common -std=c11")
448 # pthread_rwlock_t requires a feature flag.
450 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
454 add_definitions(-D_HAS_EXCEPTIONS=0)
455 add_definitions(-DWIN32_LEAN_AND_MEAN)
456 add_definitions(-DNOMINMAX)
457 # Allow use of fopen.
458 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
459 # VS 2017 and higher supports STL-only warning suppressions.
460 # A bug in CMake < 3.13.0 may cause the space in this value to
461 # cause issues when building with NASM. In that case, update CMake.
462 add_definitions("-D_STL_EXTRA_DISABLED_WARNINGS=4774 4987")
465 add_definitions(-DBORINGSSL_IMPLEMENTATION)
467 # CMake's iOS support uses Apple's multiple-architecture toolchain. It takes an
468 # architecture list from CMAKE_OSX_ARCHITECTURES, leaves CMAKE_SYSTEM_PROCESSOR
469 # alone, and expects all architecture-specific logic to be conditioned within
470 # the source files rather than the build. This does not work for our assembly
471 # files, so we fix CMAKE_SYSTEM_PROCESSOR and only support single-architecture
473 if(NOT OPENSSL_NO_ASM AND CMAKE_OSX_ARCHITECTURES)
474 list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHES)
475 if(NOT NUM_ARCHES EQUAL 1)
476 message(FATAL_ERROR "Universal binaries not supported.")
478 list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_SYSTEM_PROCESSOR)
482 add_definitions(-DOPENSSL_NO_ASM)
484 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
486 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
488 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
489 # cmake reports AMD64 on Windows, but we might be building for 32-bit.
490 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
495 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
497 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
499 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
501 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
503 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
505 # Apple A12 Bionic chipset which is added in iPhone XS/XS Max/XR uses arm64e architecture.
506 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64e")
508 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
510 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips")
511 # Just to avoid the “unknown processor” error.
513 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
516 message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
519 if(NOT OPENSSL_NO_ASM)
523 # Clang's integerated assembler does not support debug symbols.
524 if(NOT CMAKE_ASM_COMPILER_ID MATCHES "Clang")
525 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,-g")
528 # CMake does not add -isysroot and -arch flags to assembly.
530 if(CMAKE_OSX_SYSROOT)
531 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -isysroot \"${CMAKE_OSX_SYSROOT}\"")
533 foreach(arch ${CMAKE_OSX_ARCHITECTURES})
534 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -arch ${arch}")
538 set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -gcv8")
539 enable_language(ASM_NASM)
543 if(BUILD_SHARED_LIBS)
544 add_definitions(-DBORINGSSL_SHARED_LIBRARY)
545 # Enable position-independent code globally. This is needed because
546 # some library targets are OBJECT libraries.
547 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
550 include_directories(src/include)
555 out.write(
'add_library(\n')
556 out.write(
' %s\n\n' % name)
558 for f
in sorted(files):
559 out.write(
' %s\n' %
PathOf(f))
564 out.write(
'add_executable(\n')
565 out.write(
' %s\n\n' % name)
567 for f
in sorted(files):
568 out.write(
' %s\n' %
PathOf(f))
571 out.write(
'target_link_libraries(%s %s)\n\n' % (name,
' '.join(libs)))
575 out.write(
' %s\n\n' % name)
576 for f
in sorted(files):
577 out.write(
' %s\n' %
PathOf(f))
581 with open(
'CMakeLists.txt',
'w+')
as cmake:
584 for ((osname, arch), asm_files)
in asm_outputs:
585 self.
PrintSection(cmake,
'CRYPTO_%s_%s_SOURCES' % (osname, arch),
589 R'''if(APPLE AND ARCH STREQUAL "aarch64")
590 set(CRYPTO_ARCH_SOURCES ${CRYPTO_ios_aarch64_SOURCES})
591 elseif(APPLE AND ARCH STREQUAL "arm")
592 set(CRYPTO_ARCH_SOURCES ${CRYPTO_ios_arm_SOURCES})
594 set(CRYPTO_ARCH_SOURCES ${CRYPTO_mac_${ARCH}_SOURCES})
596 set(CRYPTO_ARCH_SOURCES ${CRYPTO_linux_${ARCH}_SOURCES})
598 set(CRYPTO_ARCH_SOURCES ${CRYPTO_win_${ARCH}_SOURCES})
604 files[
'crypto'] + [
'${CRYPTO_ARCH_SOURCES}'])
606 self.
PrintExe(cmake,
'bssl', files[
'tool'], [
'ssl',
'crypto'])
609 R'''if(NOT WIN32 AND NOT ANDROID)
610 target_link_libraries(crypto pthread)
614 target_link_libraries(bssl ws2_32)
621 sources = dict(files)
622 for ((osname, arch), asm_files)
in asm_outputs:
623 sources[
'crypto_%s_%s' % (osname, arch)] = asm_files
624 with open(
'sources.json',
'w+')
as f:
625 json.dump(sources, f, sort_keys=
True, indent=2)
628 """Returns list of all CMakeLists.txt files recursively in directory."""
631 for (path, _, filenames)
in os.walk(directory):
632 for filename
in filenames:
633 if filename ==
'CMakeLists.txt':
634 cmakefiles.append(os.path.join(path, filename))
639 return is_dir
or (path.startswith(
640 os.path.join(
'src',
'crypto',
'fipsmodule',
''))
and
641 NoTests(path, dent, is_dir))
644 return (NoTests(path, dent, is_dir)
and
648 """Filter function that can be passed to FindCFiles in order to remove test
651 return dent !=
'test'
652 return 'test.' not in dent
656 """Filter function that can be passed to FindCFiles in order to remove
659 return dent !=
'test'
660 return '_test.' in dent
664 """Filter function that can be passed to FindCFiles in order to include all
670 """Filter function that can be passed to FindCFiles or FindHeaderFiles in
671 order to exclude test runner files."""
674 return not is_dir
or dent !=
'runner'
678 return 'gtest' not in dent
and 'abi_test' not in dent
682 return dent
in [
'ssl.h',
'tls1.h',
'ssl23.h',
'ssl3.h',
'dtls1.h',
'srtp.h']
686 """Recurses through directory and returns a list of paths to all the C source
687 files that pass filter_func."""
690 for (path, dirnames, filenames)
in os.walk(directory):
691 for filename
in filenames:
692 if not filename.endswith(
'.c')
and not filename.endswith(
'.cc'):
694 if not filter_func(path, filename,
False):
696 cfiles.append(os.path.join(path, filename))
698 for (i, dirname)
in enumerate(dirnames):
699 if not filter_func(path, dirname,
True):
707 """Recurses through directory and returns a list of paths to all the header files that pass filter_func."""
710 for (path, dirnames, filenames)
in os.walk(directory):
711 for filename
in filenames:
712 if not filename.endswith(
'.h'):
714 if not filter_func(path, filename,
False):
716 hfiles.append(os.path.join(path, filename))
718 for (i, dirname)
in enumerate(dirnames):
719 if not filter_func(path, dirname,
True):
727 """Parses the contents of the CMakeLists.txt file passed as an argument and
728 returns a list of all the perlasm() directives found in the file."""
730 with open(cmakefile)
as f:
733 if not line.startswith(
'perlasm('):
735 if not line.endswith(
')'):
736 raise ValueError(
'Bad perlasm line in %s' % cmakefile)
738 params = line[8:-1].
split()
740 raise ValueError(
'Bad perlasm line in %s' % cmakefile)
742 'extra_args': params[2:],
743 'input': os.path.join(os.path.dirname(cmakefile), params[1]),
744 'output': os.path.join(os.path.dirname(cmakefile), params[0]),
751 """Returns a list of all perlasm() directives found in CMake config files in
756 for cmakefile
in cmakefiles:
762 def PerlAsm(output_filename, input_filename, perlasm_style, extra_args):
763 """Runs the a perlasm script and puts the output into output_filename."""
764 base_dir = os.path.dirname(output_filename)
765 if not os.path.isdir(base_dir):
766 os.makedirs(base_dir)
767 subprocess.check_call(
768 [
'perl', input_filename, perlasm_style] + extra_args + [output_filename])
772 """Returns the architectures that a given asm file should be compiled for
773 based on substrings in the filename."""
775 if 'x86_64' in filename
or 'avx2' in filename:
777 elif (
'x86' in filename
and 'x86_64' not in filename)
or '586' in filename:
779 elif 'armx' in filename:
780 return [
'arm',
'aarch64']
781 elif 'armv8' in filename:
783 elif 'arm' in filename:
785 elif 'ppc' in filename:
788 raise ValueError(
'Unknown arch for asm filename: ' + filename)
792 """Generates asm files from perlasm directives for each supported OS x
793 platform combination."""
796 for osarch
in OS_ARCH_COMBOS:
797 (osname, arch, perlasm_style, extra_args, asm_ext) = osarch
799 outDir =
'%s-%s' % key
801 for perlasm
in perlasms:
802 filename = os.path.basename(perlasm[
'input'])
803 output = perlasm[
'output']
804 if not output.startswith(
'src'):
805 raise ValueError(
'output missing src: %s' % output)
806 output = os.path.join(outDir, output[4:])
807 if output.endswith(
'-armx.${ASM_EXT}'):
808 output = output.replace(
'-armx',
809 '-armx64' if arch ==
'aarch64' else '-armx32')
810 output = output.replace(
'${ASM_EXT}', asm_ext)
813 PerlAsm(output, perlasm[
'input'], perlasm_style,
814 perlasm[
'extra_args'] + extra_args)
815 asmfiles.setdefault(key, []).append(output)
817 for (key, non_perl_asm_files)
in NON_PERL_FILES.items():
818 asmfiles.setdefault(key, []).extend(non_perl_asm_files)
820 for files
in asmfiles.values():
827 """Parses the contents of the CMakeLists.txt file passed as an argument and
828 returns a dictionary of exported source lists."""
830 in_set_command =
False
832 with open(cmakefile)
as f:
835 line = line[:line.index(
'#')]
838 if not in_set_command:
839 if line.startswith(
'set('):
840 in_set_command =
True
843 in_set_command =
False
845 raise ValueError(
'Empty set command')
846 variables[set_command[0]] = set_command[1:]
848 set_command.extend([c
for c
in line.split(
' ')
if c])
851 raise ValueError(
'Unfinished set command')
857 crypto_c_files = (
FindCFiles(os.path.join(
'src',
'crypto'), NoTestsNorFIPSFragments) +
858 FindCFiles(os.path.join(
'src',
'third_party',
'fiat'), NoTestsNorFIPSFragments))
859 fips_fragments =
FindCFiles(os.path.join(
'src',
'crypto',
'fipsmodule'), OnlyFIPSFragments)
860 ssl_source_files =
FindCFiles(os.path.join(
'src',
'ssl'), NoTests)
861 tool_c_files =
FindCFiles(os.path.join(
'src',
'tool'), NoTests)
865 bcm_crypto_c_files = [
866 os.path.join(
'src',
'crypto',
'fipsmodule',
'bcm.c')
870 with open(
'err_data.c',
'w+')
as err_data:
871 subprocess.check_call([
'go',
'run',
'err_data_generate.go'],
872 cwd=os.path.join(
'src',
'crypto',
'err'),
874 crypto_c_files.append(
'err_data.c')
875 crypto_c_files.sort()
877 test_support_c_files =
FindCFiles(os.path.join(
'src',
'crypto',
'test'),
879 test_support_h_files = (
881 FindHeaderFiles(os.path.join(
'src',
'ssl',
'test'), NoTestRunnerFiles))
883 crypto_test_files = []
886 with open(
'crypto_test_data.cc',
'w+')
as out:
887 subprocess.check_call(
888 [
'go',
'run',
'util/embed_test_data.go'] + cmake[
'CRYPTO_TEST_DATA'],
891 crypto_test_files += [
'crypto_test_data.cc']
893 crypto_test_files +=
FindCFiles(os.path.join(
'src',
'crypto'), OnlyTests)
894 crypto_test_files += [
895 'src/crypto/test/abi_test.cc',
896 'src/crypto/test/file_test_gtest.cc',
897 'src/crypto/test/gtest_main.cc',
901 crypto_test_files = [
902 file
for file
in crypto_test_files
903 if not file.endswith(
'/urandom_test.cc')
905 crypto_test_files.sort()
907 ssl_test_files =
FindCFiles(os.path.join(
'src',
'ssl'), OnlyTests)
909 'src/crypto/test/abi_test.cc',
910 'src/crypto/test/gtest_main.cc',
912 ssl_test_files.sort()
914 urandom_test_files = [
915 'src/crypto/fipsmodule/rand/urandom_test.cc',
918 fuzz_c_files =
FindCFiles(os.path.join(
'src',
'fuzz'), NoTests)
920 ssl_h_files =
FindHeaderFiles(os.path.join(
'src',
'include',
'openssl'),
923 def NotSSLHeaderFiles(path, filename, is_dir):
925 crypto_h_files =
FindHeaderFiles(os.path.join(
'src',
'include',
'openssl'),
928 ssl_internal_h_files =
FindHeaderFiles(os.path.join(
'src',
'ssl'), NoTests)
929 crypto_internal_h_files = (
934 'bcm_crypto': bcm_crypto_c_files,
935 'crypto': crypto_c_files,
936 'crypto_headers': crypto_h_files,
937 'crypto_internal_headers': crypto_internal_h_files,
938 'crypto_test': crypto_test_files,
939 'crypto_test_data': sorted(
'src/' + x
for x
in cmake[
'CRYPTO_TEST_DATA']),
940 'fips_fragments': fips_fragments,
941 'fuzz': fuzz_c_files,
942 'ssl': ssl_source_files,
943 'ssl_headers': ssl_h_files,
944 'ssl_internal_headers': ssl_internal_h_files,
945 'ssl_test': ssl_test_files,
946 'tool': tool_c_files,
947 'tool_headers': tool_h_files,
948 'test_support': test_support_c_files,
949 'test_support_headers': test_support_h_files,
950 'urandom_test': urandom_test_files,
955 for platform
in platforms:
956 platform.WriteFiles(files, asm_outputs)
962 'android-cmake': AndroidCMake,
971 if __name__ ==
'__main__':
972 parser = optparse.OptionParser(usage=
'Usage: %%prog [--prefix=<path>] [%s]' %
973 '|'.join(sorted(ALL_PLATFORMS.keys())))
974 parser.add_option(
'--prefix', dest=
'prefix',
975 help=
'For Bazel, prepend argument to all source files')
977 '--embed_test_data', type=
'choice', dest=
'embed_test_data',
978 action=
'store', default=
"true", choices=[
"true",
"false"],
979 help=
'For Bazel or GN, don\'t embed data files in crypto_test_data.cc')
980 options, args = parser.parse_args(sys.argv[1:])
981 PREFIX = options.prefix
982 EMBED_TEST_DATA = (options.embed_test_data ==
"true")
990 platform = ALL_PLATFORMS.get(s)
996 sys.exit(
main(platforms))