aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/toolchains/cpus
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-20 06:15:01 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-20 06:18:46 -0700
commitdde378ae034784879d0d1a4ad16f2765fdd4a5fd (patch)
treec4da74129ade660c2e4700ce82db7bc5de2244f3 /third_party/toolchains/cpus
parent73af9bfa58dc1ff9df09fe9495e9658f778f6dc7 (diff)
Creating configuration artifacts to use Bazel remote execution service
PiperOrigin-RevId: 159552253
Diffstat (limited to 'third_party/toolchains/cpus')
-rw-r--r--third_party/toolchains/cpus/BUILD80
-rw-r--r--third_party/toolchains/cpus/CROSSTOOL922
-rw-r--r--third_party/toolchains/cpus/py/BUILD185
3 files changed, 1187 insertions, 0 deletions
diff --git a/third_party/toolchains/cpus/BUILD b/third_party/toolchains/cpus/BUILD
new file mode 100644
index 0000000000..c33dcd4e11
--- /dev/null
+++ b/third_party/toolchains/cpus/BUILD
@@ -0,0 +1,80 @@
+# A build file to configure cc toolchain for CPU build used with Bazel remote
+# execution service
+# DO NOT EDIT: automatically generated BUILD file
+
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+ name = "malloc",
+)
+
+cc_library(
+ name = "stl",
+)
+
+filegroup(
+ name = "empty",
+ srcs = [],
+)
+
+filegroup(
+ name = "cc_wrapper",
+ srcs = ["cc_wrapper.sh"],
+)
+
+# This is the entry point for --crosstool_top. Toolchains are found
+# by lopping off the name of --crosstool_top and searching for
+# the "${CPU}" entry in the toolchains attribute.
+cc_toolchain_suite(
+ name = "toolchain",
+ toolchains = {
+ "k8|clang": ":cc-compiler-k8",
+ "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
+ "ios_x86_64|compiler": ":cc-compiler-ios_x86_64",
+ },
+)
+
+cc_toolchain(
+ name = "cc-compiler-k8",
+ all_files = ":empty",
+ compiler_files = ":empty",
+ cpu = "k8",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ static_runtime_libs = [":empty"],
+ strip_files = ":empty",
+ supports_param_files = 1,
+)
+
+# Android tooling requires a default toolchain for the armeabi-v7a cpu.
+cc_toolchain(
+ name = "cc-compiler-armeabi-v7a",
+ all_files = ":empty",
+ compiler_files = ":empty",
+ cpu = "local",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ static_runtime_libs = [":empty"],
+ strip_files = ":empty",
+ supports_param_files = 1,
+)
+
+# ios crosstool configuration requires a default toolchain for the
+# ios_x86_64 cpu.
+cc_toolchain(
+ name = "cc-compiler-ios_x86_64",
+ all_files = ":empty",
+ compiler_files = ":empty",
+ cpu = "local",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ static_runtime_libs = [":empty"],
+ strip_files = ":empty",
+ supports_param_files = 1,
+)
diff --git a/third_party/toolchains/cpus/CROSSTOOL b/third_party/toolchains/cpus/CROSSTOOL
new file mode 100644
index 0000000000..0e2d0119af
--- /dev/null
+++ b/third_party/toolchains/cpus/CROSSTOOL
@@ -0,0 +1,922 @@
+# A crosstool configuration for CPU build used with Bazel remote
+# execution service
+# DO NOT EDIT: automatically generated file
+
+major_version: "local"
+minor_version: ""
+default_target_cpu: "same_as_host"
+
+default_toolchain {
+ cpu: "k8"
+ toolchain_identifier: "linux_gnu_x86"
+}
+
+default_toolchain {
+ cpu: "armeabi-v7a"
+ toolchain_identifier: "stub_armeabi-v7a"
+}
+
+default_toolchain {
+ cpu: "x64_windows_msvc"
+ toolchain_identifier: "msvc_x64"
+}
+
+default_toolchain {
+ cpu: "x64_windows_msys"
+ toolchain_identifier: "msys_x64"
+}
+
+default_toolchain {
+ cpu: "s390x"
+ toolchain_identifier: "linux_gnu_x86"
+}
+
+default_toolchain {
+ cpu: "ios_x86_64"
+ toolchain_identifier: "ios_x86_64"
+}
+
+# Android tooling requires a default toolchain for the armeabi-v7a cpu.
+toolchain {
+ abi_version: "armeabi-v7a"
+ abi_libc_version: "armeabi-v7a"
+ builtin_sysroot: ""
+ compiler: "compiler"
+ host_system_name: "armeabi-v7a"
+ needsPic: true
+ supports_gold_linker: false
+ supports_incremental_linker: false
+ supports_fission: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: false
+ supports_start_end_lib: false
+ target_libc: "armeabi-v7a"
+ target_cpu: "armeabi-v7a"
+ target_system_name: "armeabi-v7a"
+ toolchain_identifier: "stub_armeabi-v7a"
+
+ tool_path { name: "ar" path: "/bin/false" }
+ tool_path { name: "compat-ld" path: "/bin/false" }
+ tool_path { name: "cpp" path: "/bin/false" }
+ tool_path { name: "dwp" path: "/bin/false" }
+ tool_path { name: "gcc" path: "/bin/false" }
+ tool_path { name: "gcov" path: "/bin/false" }
+ tool_path { name: "ld" path: "/bin/false" }
+
+ tool_path { name: "nm" path: "/bin/false" }
+ tool_path { name: "objcopy" path: "/bin/false" }
+ tool_path { name: "objdump" path: "/bin/false" }
+ tool_path { name: "strip" path: "/bin/false" }
+ linking_mode_flags { mode: DYNAMIC }
+}
+
+toolchain {
+ toolchain_identifier: "ios_x86_64"
+ host_system_name: "x86_64-apple-macosx"
+ target_system_name: "x86_64-apple-ios"
+ target_cpu: "ios_x86_64"
+ target_libc: "ios"
+ compiler: "compiler"
+ abi_version: "local"
+ abi_libc_version: "local"
+ supports_gold_linker: false
+ supports_incremental_linker: false
+ supports_fission: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: false
+ supports_start_end_lib: false
+
+ tool_path { name: "ar" path: "/bin/false" }
+ tool_path { name: "compat-ld" path: "/bin/false" }
+ tool_path { name: "cpp" path: "/bin/false" }
+ tool_path { name: "dwp" path: "/bin/false" }
+ tool_path { name: "gcc" path: "/bin/false" }
+ tool_path { name: "gcov" path: "/bin/false" }
+ tool_path { name: "ld" path: "/bin/false" }
+
+ tool_path { name: "nm" path: "/bin/false" }
+ tool_path { name: "objcopy" path: "/bin/false" }
+ tool_path { name: "objdump" path: "/bin/false" }
+ tool_path { name: "strip" path: "/bin/false" }
+ linking_mode_flags { mode: DYNAMIC }
+}
+
+toolchain {
+ toolchain_identifier: "linux_gnu_x86"
+ abi_version: "clang"
+ abi_libc_version: "glibc_2.19"
+ builtin_sysroot: ""
+ compiler: "clang"
+ host_system_name: "i686-unknown-linux-gnu"
+ needsPic: true
+ supports_gold_linker: true
+ supports_incremental_linker: false
+ supports_fission: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: false
+ supports_start_end_lib: true
+ target_libc: "glibc_2.19"
+ target_cpu: "k8"
+ target_system_name: "x86_64-unknown-linux-gnu"
+ cxx_flag: "-std=c++0x"
+ linker_flag: "-lstdc++"
+ linker_flag: "-lm"
+ linker_flag: "-fuse-ld=gold"
+ linker_flag: "-B/usr/local/bin"
+ linker_flag: "-B/usr/bin"
+ cxx_builtin_include_directory: "/usr/include/c++/4.9"
+ cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu/c++/4.9"
+ cxx_builtin_include_directory: "/usr/include/c++/4.9/backward"
+ cxx_builtin_include_directory: "/usr/local/include"
+ cxx_builtin_include_directory: "/usr/local/lib/clang/5.0.0/include"
+ cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu"
+ cxx_builtin_include_directory: "/usr/include"
+ objcopy_embed_flag: "-I"
+ objcopy_embed_flag: "binary"
+ unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
+ unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
+ compiler_flag: "-U_FORTIFY_SOURCE"
+ compiler_flag: "-fstack-protector"
+ compiler_flag: "-Wall"
+ compiler_flag: "-B/usr/local/bin"
+ compiler_flag: "-B/usr/bin"
+ compiler_flag: "-fcolor-diagnostics"
+ compiler_flag: "-fno-omit-frame-pointer"
+ tool_path {name: "ld" path: "/usr/bin/ld" }
+ tool_path {name: "cpp" path: "/usr/bin/cpp" }
+ tool_path {name: "dwp" path: "/usr/bin/dwp" }
+ tool_path {name: "gcov" path: "/usr/bin/gcov" }
+ tool_path {name: "nm" path: "/usr/bin/nm" }
+ tool_path {name: "objcopy" path: "/usr/bin/objcopy" }
+ tool_path {name: "objdump" path: "/usr/bin/objdump" }
+ tool_path {name: "strip" path: "/usr/bin/strip" }
+ tool_path {name: "gcc" path: "/usr/local/bin/clang" }
+ tool_path {name: "ar" path: "/usr/bin/ar" }
+
+ compilation_mode_flags {
+ mode: DBG
+ compiler_flag: "-g"
+ }
+ compilation_mode_flags {
+ mode: OPT
+ compiler_flag: "-g0"
+ compiler_flag: "-O2"
+ compiler_flag: "-D_FORTIFY_SOURCE=1"
+ compiler_flag: "-DNDEBUG"
+ compiler_flag: "-ffunction-sections"
+ compiler_flag: "-fdata-sections"
+ linker_flag: "-Wl,--gc-sections"
+ }
+ linking_mode_flags { mode: DYNAMIC }
+
+
+ feature {
+ name: 'coverage'
+ provides: 'profile'
+ flag_set {
+ action: 'preprocess-assemble'
+ action: 'c-compile'
+ action: 'c++-compile'
+ action: 'c++-header-parsing'
+ action: 'c++-header-preprocessing'
+ action: 'c++-module-compile'
+ flag_group {
+ flag: '-fprofile-arcs'
+ flag: '-ftest-coverage'
+ }
+ }
+ flag_set {
+ action: 'c++-link-interface-dynamic-library'
+ action: 'c++-link-dynamic-library'
+ action: 'c++-link-executable'
+ flag_group {
+ flag: '-lgcov'
+ }
+ }
+ }
+
+}
+
+toolchain {
+ toolchain_identifier: "msvc_x64"
+ host_system_name: "local"
+ target_system_name: "local"
+
+ abi_version: "local"
+ abi_libc_version: "local"
+ target_cpu: "x64_windows"
+ compiler: "cl"
+ target_libc: "msvcrt140"
+ default_python_version: "python2.7"
+
+
+
+ tool_path {
+ name: "ar"
+ path: "wrapper/bin/msvc_link.bat"
+ }
+ tool_path {
+ name: "cpp"
+ path: "wrapper/bin/msvc_cl.bat"
+ }
+ tool_path {
+ name: "gcc"
+ path: "wrapper/bin/msvc_cl.bat"
+ }
+ tool_path {
+ name: "gcov"
+ path: "wrapper/bin/msvc_nop.bat"
+ }
+ tool_path {
+ name: "ld"
+ path: "wrapper/bin/msvc_link.bat"
+ }
+ tool_path {
+ name: "nm"
+ path: "wrapper/bin/msvc_nop.bat"
+ }
+ tool_path {
+ name: "objcopy"
+ path: "wrapper/bin/msvc_nop.bat"
+ }
+ tool_path {
+ name: "objdump"
+ path: "wrapper/bin/msvc_nop.bat"
+ }
+ tool_path {
+ name: "strip"
+ path: "wrapper/bin/msvc_nop.bat"
+ }
+ supports_gold_linker: false
+ supports_start_end_lib: false
+ supports_interface_shared_objects: false
+ supports_incremental_linker: false
+ supports_normalizing_ar: true
+ needsPic: false
+
+ # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
+ compiler_flag: "/DOS_WINDOWS=OS_WINDOWS"
+ compiler_flag: "/DCOMPILER_MSVC"
+
+ # Don't pollute with GDI macros in windows.h.
+ compiler_flag: "/DNOGDI"
+ # Don't define min/max macros in windows.h.
+ compiler_flag: "/DNOMINMAX"
+ compiler_flag: "/DPRAGMA_SUPPORTED"
+ # Platform defines.
+ compiler_flag: "/D_WIN32_WINNT=0x0600"
+ # Turn off warning messages.
+ compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
+ compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
+ compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
+ # Use math constants (M_PI, etc.) from the math library
+ compiler_flag: "/D_USE_MATH_DEFINES"
+
+ # Useful options to have on for compilation.
+ # Increase the capacity of object files to 2^32 sections.
+ compiler_flag: "/bigobj"
+ # Allocate 500MB for precomputed headers.
+ compiler_flag: "/Zm500"
+ # Use unsigned char by default.
+ compiler_flag: "/J"
+ # Use function level linking.
+ compiler_flag: "/Gy"
+ # Use string pooling.
+ compiler_flag: "/GF"
+ # Warning level 3 (could possibly go to 4 in the future).
+ compiler_flag: "/W3"
+ # Catch both asynchronous (structured) and synchronous (C++) exceptions.
+ compiler_flag: "/EHsc"
+
+ # Globally disabled warnings.
+ # Don't warn about elements of array being be default initialized.
+ compiler_flag: "/wd4351"
+ # Don't warn about no matching delete found.
+ compiler_flag: "/wd4291"
+ # Don't warn about diamond inheritance patterns.
+ compiler_flag: "/wd4250"
+ # Don't warn about insecure functions (e.g. non _s functions).
+ compiler_flag: "/wd4996"
+
+ linker_flag: "/MACHINE:X64"
+
+ linker_flag: "/SUBSYSTEM:CONSOLE"
+
+ # Suppress startup banner.
+ feature {
+ name: "nologo"
+ flag_set {
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-static-library"
+ action: "c++-link-alwayslink-static-library"
+ action: "c++-link-pic-static-library"
+ action: "c++-link-alwayslink-pic-static-library"
+ flag_group {
+ flag: "/nologo"
+ }
+ }
+ }
+
+ feature {
+ name: "msvc_env"
+ env_set {
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-static-library"
+ action: "c++-link-alwayslink-static-library"
+ action: "c++-link-pic-static-library"
+ action: "c++-link-alwayslink-pic-static-library"
+ env_entry {
+ key: "PATH"
+ value: ""
+ }
+ env_entry {
+ key: "INCLUDE"
+ value: ""
+ }
+ env_entry {
+ key: "LIB"
+ value: ""
+ }
+ env_entry {
+ key: "TMP"
+ value: ""
+ }
+ }
+ }
+
+ feature {
+ name: 'include_paths'
+ flag_set {
+ action: 'preprocess-assemble'
+ action: 'c-compile'
+ action: 'c++-compile'
+ action: 'c++-header-parsing'
+ action: 'c++-header-preprocessing'
+ action: 'c++-module-compile'
+ flag_group {
+ flag: '/I%{quote_include_paths}'
+ }
+ flag_group {
+ flag: '/I%{include_paths}'
+ }
+ flag_group {
+ flag: '/I%{system_include_paths}'
+ }
+ }
+ }
+
+ # Stop adding any flag for dotD file, Bazel knows how to parse the output of /showIncludes option
+ # TODO(bazel-team): Remove this empty feature. https://github.com/bazelbuild/bazel/issues/2868
+ feature {
+ name: 'dependency_file'
+ }
+
+ # Tell Bazel to parse the output of /showIncludes
+ feature {
+ name: 'parse_showincludes'
+ flag_set {
+ action: 'assemble'
+ action: 'preprocess-assemble'
+ action: 'c-compile'
+ action: 'c++-compile'
+ action: 'c++-module-compile'
+ action: 'c++-header-preprocessing'
+ action: 'c++-header-parsing'
+ flag_group {
+ flag: "/showIncludes"
+ }
+ }
+ }
+
+ # Stop passing -frandom-seed option
+ feature {
+ name: 'random_seed'
+ }
+
+ # This feature is just for enabling flag_set in action_config for -c and -o options during the transitional period
+ feature {
+ name: 'compile_action_flags_in_flag_set'
+ }
+
+ action_config {
+ config_name: 'c-compile'
+ action_name: 'c-compile'
+ tool {
+ tool_path: 'wrapper/bin/msvc_cl.bat'
+ }
+ flag_set {
+ flag_group {
+ flag: '/c'
+ flag: '%{source_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_object_file'
+ flag_group {
+ flag: '/Fo%{output_object_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_assembly_file'
+ flag_group {
+ flag: '/Fa%{output_assembly_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_preprocess_file'
+ flag_group {
+ flag: '/P'
+ flag: '/Fi%{output_preprocess_file}'
+ }
+ }
+ implies: 'nologo'
+ implies: 'msvc_env'
+ implies: 'parse_showincludes'
+ }
+
+ action_config {
+ config_name: 'c++-compile'
+ action_name: 'c++-compile'
+ tool {
+ tool_path: 'wrapper/bin/msvc_cl.bat'
+ }
+ flag_set {
+ flag_group {
+ flag: '/c'
+ flag: '%{source_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_object_file'
+ flag_group {
+ flag: '/Fo%{output_object_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_assembly_file'
+ flag_group {
+ flag: '/Fa%{output_assembly_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'output_preprocess_file'
+ flag_group {
+ flag: '/P'
+ flag: '/Fi%{output_preprocess_file}'
+ }
+ }
+ implies: 'nologo'
+ implies: 'msvc_env'
+ implies: 'parse_showincludes'
+ }
+
+ action_config {
+ config_name: 'c++-link-executable'
+ action_name: 'c++-link-executable'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'strip_debug_symbols'
+ implies: 'linkstamps'
+ implies: 'output_execpath_flags'
+ implies: 'input_param_flags'
+ implies: 'legacy_link_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ action_config {
+ config_name: 'c++-link-dynamic-library'
+ action_name: 'c++-link-dynamic-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'strip_debug_symbols'
+ implies: 'shared_flag'
+ implies: 'linkstamps'
+ implies: 'output_execpath_flags'
+ implies: 'input_param_flags'
+ implies: 'has_configured_linker_path'
+ implies: 'legacy_link_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ action_config {
+ config_name: 'c++-link-static-library'
+ action_name: 'c++-link-static-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'input_param_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ action_config {
+ config_name: 'c++-link-alwayslink-static-library'
+ action_name: 'c++-link-alwayslink-static-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'input_param_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ # TODO(pcloudy): The following action_config is listed in MANDATORY_LINK_TARGET_TYPES.
+ # But do we really need them on Windows?
+ action_config {
+ config_name: 'c++-link-pic-static-library'
+ action_name: 'c++-link-pic-static-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'input_param_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ action_config {
+ config_name: 'c++-link-alwayslink-pic-static-library'
+ action_name: 'c++-link-alwayslink-pic-static-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'input_param_flags'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ action_config {
+ config_name: 'c++-link-interface-dynamic-library'
+ action_name: 'c++-link-interface-dynamic-library'
+ tool {
+ tool_path: 'wrapper/bin/msvc_link.bat'
+ }
+ implies: 'nologo'
+ implies: 'strip_debug_symbols'
+ implies: 'linker_param_file'
+ implies: 'msvc_env'
+ }
+
+ feature {
+ name: 'generate_pdb_file'
+ requires: {
+ feature: 'dbg'
+ }
+ requires: {
+ feature: 'fastbuild'
+ }
+ }
+
+ feature {
+ name: 'has_configured_linker_path'
+ }
+
+ feature {
+ name: 'strip_debug_symbols'
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ action: 'c++-link-interface-dynamic-library'
+ flag_group {
+ expand_if_all_available: 'strip_debug_symbols'
+ flag: '-Wl,-S'
+ }
+ }
+ }
+
+ feature {
+ name: 'shared_flag'
+ flag_set {
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: '/DLL'
+ }
+ }
+ }
+
+ feature {
+ name: 'linkstamps'
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ expand_if_all_available: 'linkstamp_paths'
+ flag_group {
+ flag: '%{linkstamp_paths}'
+ }
+ }
+ }
+
+ feature {
+ name: 'output_execpath_flags'
+ flag_set {
+ expand_if_all_available: 'output_execpath'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: '/OUT:%{output_execpath}'
+ }
+ }
+ }
+
+ feature {
+ name: 'input_param_flags'
+ flag_set {
+ expand_if_all_available: 'library_search_directories'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
+ flag_group {
+ iterate_over: 'library_search_directories'
+ flag: "-L%{library_search_directories}"
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'libopts'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
+ flag_group {
+ flag: '%{libopts}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'libraries_to_link'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
+ flag_group {
+ iterate_over: 'libraries_to_link'
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'object_file_group'
+ }
+ iterate_over: 'libraries_to_link.object_files'
+ flag_group {
+ flag: '%{libraries_to_link.object_files}'
+ }
+ }
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'object_file'
+ }
+ flag_group {
+ flag: '%{libraries_to_link.name}'
+ }
+ }
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'interface_library'
+ }
+ flag_group {
+ expand_if_false: 'libraries_to_link.is_whole_archive'
+ flag: '%{libraries_to_link.name}'
+ }
+ flag_group {
+ expand_if_true: 'libraries_to_link.is_whole_archive'
+ flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
+ }
+ }
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'static_library'
+ }
+ flag_group {
+ expand_if_false: 'libraries_to_link.is_whole_archive'
+ flag: '%{libraries_to_link.name}'
+ }
+ flag_group {
+ expand_if_true: 'libraries_to_link.is_whole_archive'
+ flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
+ }
+ }
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'dynamic_library'
+ }
+ flag_group {
+ expand_if_false: 'libraries_to_link.is_whole_archive'
+ flag: '%{libraries_to_link.name}'
+ }
+ flag_group {
+ expand_if_true: 'libraries_to_link.is_whole_archive'
+ flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
+ }
+ }
+ flag_group {
+ expand_if_equal: {
+ variable: 'libraries_to_link.type'
+ value: 'versioned_dynamic_library'
+ }
+ flag_group {
+ expand_if_false: 'libraries_to_link.is_whole_archive'
+ flag: '%{libraries_to_link.name}'
+ }
+ flag_group {
+ expand_if_true: 'libraries_to_link.is_whole_archive'
+ flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
+ }
+ }
+ }
+ }
+ }
+
+ feature {
+ name: 'legacy_link_flags'
+ flag_set {
+ expand_if_all_available: 'legacy_link_flags'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: '%{legacy_link_flags}'
+ }
+ }
+ }
+
+ feature {
+ name: 'linker_param_file'
+ flag_set {
+ expand_if_all_available: 'linker_param_file'
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: '-Wl,@%{linker_param_file}'
+ }
+ }
+ flag_set {
+ expand_if_all_available: 'linker_param_file'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
+ flag_group {
+ flag: '@%{linker_param_file}'
+ }
+ }
+ }
+
+ feature {
+ name: 'link_crt_library'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ flag_group {
+ # The flag is filled by cc_configure.
+ # The default option is /MT, set USE_DYNAMIC_CRT=1 to change it to /MD
+ flag: ""
+ }
+ }
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ # The flag is filled by cc_configure.
+ # The default value is libcmt.lib, set USE_DYNAMIC_CRT=1 to change it to msvcrt.lib
+ flag: "/DEFAULTLIB:"
+ }
+ }
+ }
+
+ feature {
+ name: 'link_crt_debug_library'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ flag_group {
+ # The flag is filled by cc_configure.
+ # The default option is /MTd, set USE_DYNAMIC_CRT=1 to change it to /MDd
+ flag: ""
+ }
+ }
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ # The flag is filled by cc_configure.
+ # The default value is libcmtd.lib, set USE_DYNAMIC_CRT=1 to change it to msvcrtd.lib
+ flag: "/DEFAULTLIB:"
+ }
+ }
+ }
+
+ feature {
+ name: 'dbg'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ flag_group {
+ flag: "/Od"
+ flag: "/Z7"
+ # This will signal the wrapper that we are doing a debug build, which sets
+ # some internal state of the toolchain wrapper. It is intentionally a "-"
+ # flag to make this very obvious.
+ flag: "-g"
+ }
+ }
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: "/DEBUG:FULL"
+ flag: "/INCREMENTAL:NO"
+ }
+ }
+ implies: 'link_crt_debug_library'
+ implies: 'generate_pdb_file'
+ }
+
+ feature {
+ name: 'fastbuild'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ flag_group {
+ flag: "/Od"
+ flag: "/Z7"
+ }
+ }
+ flag_set {
+ action: 'c++-link-executable'
+ action: 'c++-link-dynamic-library'
+ flag_group {
+ flag: "/DEBUG:FASTLINK"
+ flag: "/INCREMENTAL:NO"
+ }
+ }
+ implies: 'link_crt_library'
+ implies: 'generate_pdb_file'
+ }
+
+ feature {
+ name: 'opt'
+ flag_set {
+ action: 'c-compile'
+ action: 'c++-compile'
+ flag_group {
+ flag: "/O2"
+ }
+ }
+ implies: 'link_crt_library'
+ }
+
+ compilation_mode_flags {
+ mode: DBG
+ compiler_flag: "-Xcompilation-mode=dbg"
+ linker_flag: "-Xcompilation-mode=dbg"
+ }
+
+ compilation_mode_flags {
+ mode: FASTBUILD
+ compiler_flag: "-Xcompilation-mode=fastbuild"
+ linker_flag: "-Xcompilation-mode=fastbuild"
+ }
+
+ compilation_mode_flags {
+ mode: OPT
+ compiler_flag: "-Xcompilation-mode=opt"
+ linker_flag: "-Xcompilation-mode=opt"
+ }
+
+}
diff --git a/third_party/toolchains/cpus/py/BUILD b/third_party/toolchains/cpus/py/BUILD
new file mode 100644
index 0000000000..d54eebb8e7
--- /dev/null
+++ b/third_party/toolchains/cpus/py/BUILD
@@ -0,0 +1,185 @@
+# A build file to configure python remote repository used with Bazel remote
+# execution service
+# DO NOT EDIT: automatically generated BUILD file
+
+licenses(["restricted"])
+
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+ name = "python_headers",
+ hdrs = [":python_include"],
+ includes = ["python_include"],
+)
+
+cc_library(
+ name = "numpy_headers",
+ hdrs = [":numpy_include"],
+ includes = ["numpy_include"],
+)
+
+config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+ visibility = ["//visibility:public"],
+)
+
+genrule(
+ name = "python_include",
+ outs = [
+ "python_include/code.h",
+ "python_include/dtoa.h",
+ "python_include/tupleobject.h",
+ "python_include/object.h",
+ "python_include/ast.h",
+ "python_include/pymacconfig.h",
+ "python_include/errcode.h",
+ "python_include/frameobject.h",
+ "python_include/pgenheaders.h",
+ "python_include/cellobject.h",
+ "python_include/intobject.h",
+ "python_include/pythread.h",
+ "python_include/cStringIO.h",
+ "python_include/boolobject.h",
+ "python_include/modsupport.h",
+ "python_include/import.h",
+ "python_include/pymath.h",
+ "python_include/node.h",
+ "python_include/funcobject.h",
+ "python_include/eval.h",
+ "python_include/longintrepr.h",
+ "python_include/floatobject.h",
+ "python_include/rangeobject.h",
+ "python_include/pyfpe.h",
+ "python_include/pystrcmp.h",
+ "python_include/dictobject.h",
+ "python_include/pyarena.h",
+ "python_include/objimpl.h",
+ "python_include/bitset.h",
+ "python_include/memoryobject.h",
+ "python_include/bytearrayobject.h",
+ "python_include/pydebug.h",
+ "python_include/pyerrors.h",
+ "python_include/weakrefobject.h",
+ "python_include/grammar.h",
+ "python_include/symtable.h",
+ "python_include/longobject.h",
+ "python_include/structmember.h",
+ "python_include/enumobject.h",
+ "python_include/classobject.h",
+ "python_include/unicodeobject.h",
+ "python_include/sliceobject.h",
+ "python_include/pystrtod.h",
+ "python_include/genobject.h",
+ "python_include/pymactoolbox.h",
+ "python_include/compile.h",
+ "python_include/pyexpat.h",
+ "python_include/asdl.h",
+ "python_include/codecs.h",
+ "python_include/pyctype.h",
+ "python_include/sysmodule.h",
+ "python_include/methodobject.h",
+ "python_include/graminit.h",
+ "python_include/cobject.h",
+ "python_include/intrcheck.h",
+ "python_include/pyport.h",
+ "python_include/warnings.h",
+ "python_include/osdefs.h",
+ "python_include/fileobject.h",
+ "python_include/stringobject.h",
+ "python_include/timefuncs.h",
+ "python_include/traceback.h",
+ "python_include/ceval.h",
+ "python_include/bytes_methods.h",
+ "python_include/pyconfig.h",
+ "python_include/Python.h",
+ "python_include/moduleobject.h",
+ "python_include/pystate.h",
+ "python_include/descrobject.h",
+ "python_include/ucnhash.h",
+ "python_include/pygetopt.h",
+ "python_include/pymem.h",
+ "python_include/complexobject.h",
+ "python_include/structseq.h",
+ "python_include/datetime.h",
+ "python_include/pythonrun.h",
+ "python_include/numpy/oldnumeric.h",
+ "python_include/numpy/npy_1_7_deprecated_api.h",
+ "python_include/numpy/ufunc_api.txt",
+ "python_include/numpy/multiarray_api.txt",
+ "python_include/numpy/halffloat.h",
+ "python_include/numpy/npy_common.h",
+ "python_include/numpy/utils.h",
+ "python_include/numpy/npy_interrupt.h",
+ "python_include/numpy/npy_endian.h",
+ "python_include/numpy/__ufunc_api.h",
+ "python_include/numpy/_neighborhood_iterator_imp.h",
+ "python_include/numpy/ufuncobject.h",
+ "python_include/numpy/ndarraytypes.h",
+ "python_include/numpy/npy_math.h",
+ "python_include/numpy/noprefix.h",
+ "python_include/numpy/npy_3kcompat.h",
+ "python_include/numpy/arrayscalars.h",
+ "python_include/numpy/npy_os.h",
+ "python_include/numpy/ndarrayobject.h",
+ "python_include/numpy/npy_no_deprecated_api.h",
+ "python_include/numpy/arrayobject.h",
+ "python_include/numpy/_numpyconfig.h",
+ "python_include/numpy/__multiarray_api.h",
+ "python_include/numpy/npy_cpu.h",
+ "python_include/numpy/old_defines.h",
+ "python_include/numpy/numpyconfig.h",
+ "python_include/pycapsule.h",
+ "python_include/setobject.h",
+ "python_include/listobject.h",
+ "python_include/bytesobject.h",
+ "python_include/pgen.h",
+ "python_include/patchlevel.h",
+ "python_include/opcode.h",
+ "python_include/parsetok.h",
+ "python_include/marshal.h",
+ "python_include/token.h",
+ "python_include/iterobject.h",
+ "python_include/abstract.h",
+ "python_include/py_curses.h",
+ "python_include/metagrammar.h",
+ "python_include/bufferobject.h",
+ "python_include/Python-ast.h",
+ ],
+ cmd = """
+cp "/usr/include/python2.7/code.h" "$(@D)/python_include/code.h" && cp "/usr/include/python2.7/dtoa.h" "$(@D)/python_include/dtoa.h" && cp "/usr/include/python2.7/tupleobject.h" "$(@D)/python_include/tupleobject.h" && cp "/usr/include/python2.7/object.h" "$(@D)/python_include/object.h" && cp "/usr/include/python2.7/ast.h" "$(@D)/python_include/ast.h" && cp "/usr/include/python2.7/pymacconfig.h" "$(@D)/python_include/pymacconfig.h" && cp "/usr/include/python2.7/errcode.h" "$(@D)/python_include/errcode.h" && cp "/usr/include/python2.7/frameobject.h" "$(@D)/python_include/frameobject.h" && cp "/usr/include/python2.7/pgenheaders.h" "$(@D)/python_include/pgenheaders.h" && cp "/usr/include/python2.7/cellobject.h" "$(@D)/python_include/cellobject.h" && cp "/usr/include/python2.7/intobject.h" "$(@D)/python_include/intobject.h" && cp "/usr/include/python2.7/pythread.h" "$(@D)/python_include/pythread.h" && cp "/usr/include/python2.7/cStringIO.h" "$(@D)/python_include/cStringIO.h" && cp "/usr/include/python2.7/boolobject.h" "$(@D)/python_include/boolobject.h" && cp "/usr/include/python2.7/modsupport.h" "$(@D)/python_include/modsupport.h" && cp "/usr/include/python2.7/import.h" "$(@D)/python_include/import.h" && cp "/usr/include/python2.7/pymath.h" "$(@D)/python_include/pymath.h" && cp "/usr/include/python2.7/node.h" "$(@D)/python_include/node.h" && cp "/usr/include/python2.7/funcobject.h" "$(@D)/python_include/funcobject.h" && cp "/usr/include/python2.7/eval.h" "$(@D)/python_include/eval.h" && cp "/usr/include/python2.7/longintrepr.h" "$(@D)/python_include/longintrepr.h" && cp "/usr/include/python2.7/floatobject.h" "$(@D)/python_include/floatobject.h" && cp "/usr/include/python2.7/rangeobject.h" "$(@D)/python_include/rangeobject.h" && cp "/usr/include/python2.7/pyfpe.h" "$(@D)/python_include/pyfpe.h" && cp "/usr/include/python2.7/pystrcmp.h" "$(@D)/python_include/pystrcmp.h" && cp "/usr/include/python2.7/dictobject.h" "$(@D)/python_include/dictobject.h" && cp "/usr/include/python2.7/pyarena.h" "$(@D)/python_include/pyarena.h" && cp "/usr/include/python2.7/objimpl.h" "$(@D)/python_include/objimpl.h" && cp "/usr/include/python2.7/bitset.h" "$(@D)/python_include/bitset.h" && cp "/usr/include/python2.7/memoryobject.h" "$(@D)/python_include/memoryobject.h" && cp "/usr/include/python2.7/bytearrayobject.h" "$(@D)/python_include/bytearrayobject.h" && cp "/usr/include/python2.7/pydebug.h" "$(@D)/python_include/pydebug.h" && cp "/usr/include/python2.7/pyerrors.h" "$(@D)/python_include/pyerrors.h" && cp "/usr/include/python2.7/weakrefobject.h" "$(@D)/python_include/weakrefobject.h" && cp "/usr/include/python2.7/grammar.h" "$(@D)/python_include/grammar.h" && cp "/usr/include/python2.7/symtable.h" "$(@D)/python_include/symtable.h" && cp "/usr/include/python2.7/longobject.h" "$(@D)/python_include/longobject.h" && cp "/usr/include/python2.7/structmember.h" "$(@D)/python_include/structmember.h" && cp "/usr/include/python2.7/enumobject.h" "$(@D)/python_include/enumobject.h" && cp "/usr/include/python2.7/classobject.h" "$(@D)/python_include/classobject.h" && cp "/usr/include/python2.7/unicodeobject.h" "$(@D)/python_include/unicodeobject.h" && cp "/usr/include/python2.7/sliceobject.h" "$(@D)/python_include/sliceobject.h" && cp "/usr/include/python2.7/pystrtod.h" "$(@D)/python_include/pystrtod.h" && cp "/usr/include/python2.7/genobject.h" "$(@D)/python_include/genobject.h" && cp "/usr/include/python2.7/pymactoolbox.h" "$(@D)/python_include/pymactoolbox.h" && cp "/usr/include/python2.7/compile.h" "$(@D)/python_include/compile.h" && cp "/usr/include/python2.7/pyexpat.h" "$(@D)/python_include/pyexpat.h" && cp "/usr/include/python2.7/asdl.h" "$(@D)/python_include/asdl.h" && cp "/usr/include/python2.7/codecs.h" "$(@D)/python_include/codecs.h" && cp "/usr/include/python2.7/pyctype.h" "$(@D)/python_include/pyctype.h" && cp "/usr/include/python2.7/sysmodule.h" "$(@D)/python_include/sysmodule.h" && cp "/usr/include/python2.7/methodobject.h" "$(@D)/python_include/methodobject.h" && cp "/usr/include/python2.7/graminit.h" "$(@D)/python_include/graminit.h" && cp "/usr/include/python2.7/cobject.h" "$(@D)/python_include/cobject.h" && cp "/usr/include/python2.7/intrcheck.h" "$(@D)/python_include/intrcheck.h" && cp "/usr/include/python2.7/pyport.h" "$(@D)/python_include/pyport.h" && cp "/usr/include/python2.7/warnings.h" "$(@D)/python_include/warnings.h" && cp "/usr/include/python2.7/osdefs.h" "$(@D)/python_include/osdefs.h" && cp "/usr/include/python2.7/fileobject.h" "$(@D)/python_include/fileobject.h" && cp "/usr/include/python2.7/stringobject.h" "$(@D)/python_include/stringobject.h" && cp "/usr/include/python2.7/timefuncs.h" "$(@D)/python_include/timefuncs.h" && cp "/usr/include/python2.7/traceback.h" "$(@D)/python_include/traceback.h" && cp "/usr/include/python2.7/ceval.h" "$(@D)/python_include/ceval.h" && cp "/usr/include/python2.7/bytes_methods.h" "$(@D)/python_include/bytes_methods.h" && cp "/usr/include/python2.7/pyconfig.h" "$(@D)/python_include/pyconfig.h" && cp "/usr/include/python2.7/Python.h" "$(@D)/python_include/Python.h" && cp "/usr/include/python2.7/moduleobject.h" "$(@D)/python_include/moduleobject.h" && cp "/usr/include/python2.7/pystate.h" "$(@D)/python_include/pystate.h" && cp "/usr/include/python2.7/descrobject.h" "$(@D)/python_include/descrobject.h" && cp "/usr/include/python2.7/ucnhash.h" "$(@D)/python_include/ucnhash.h" && cp "/usr/include/python2.7/pygetopt.h" "$(@D)/python_include/pygetopt.h" && cp "/usr/include/python2.7/pymem.h" "$(@D)/python_include/pymem.h" && cp "/usr/include/python2.7/complexobject.h" "$(@D)/python_include/complexobject.h" && cp "/usr/include/python2.7/structseq.h" "$(@D)/python_include/structseq.h" && cp "/usr/include/python2.7/datetime.h" "$(@D)/python_include/datetime.h" && cp "/usr/include/python2.7/pythonrun.h" "$(@D)/python_include/pythonrun.h" && cp "/usr/include/python2.7/numpy/oldnumeric.h" "$(@D)/python_include/numpy/oldnumeric.h" && cp "/usr/include/python2.7/numpy/npy_1_7_deprecated_api.h" "$(@D)/python_include/numpy/npy_1_7_deprecated_api.h" && cp "/usr/include/python2.7/numpy/ufunc_api.txt" "$(@D)/python_include/numpy/ufunc_api.txt" && cp "/usr/include/python2.7/numpy/multiarray_api.txt" "$(@D)/python_include/numpy/multiarray_api.txt" && cp "/usr/include/python2.7/numpy/halffloat.h" "$(@D)/python_include/numpy/halffloat.h" && cp "/usr/include/python2.7/numpy/npy_common.h" "$(@D)/python_include/numpy/npy_common.h" && cp "/usr/include/python2.7/numpy/utils.h" "$(@D)/python_include/numpy/utils.h" && cp "/usr/include/python2.7/numpy/npy_interrupt.h" "$(@D)/python_include/numpy/npy_interrupt.h" && cp "/usr/include/python2.7/numpy/npy_endian.h" "$(@D)/python_include/numpy/npy_endian.h" && cp "/usr/include/python2.7/numpy/__ufunc_api.h" "$(@D)/python_include/numpy/__ufunc_api.h" && cp "/usr/include/python2.7/numpy/_neighborhood_iterator_imp.h" "$(@D)/python_include/numpy/_neighborhood_iterator_imp.h" && cp "/usr/include/python2.7/numpy/ufuncobject.h" "$(@D)/python_include/numpy/ufuncobject.h" && cp "/usr/include/python2.7/numpy/ndarraytypes.h" "$(@D)/python_include/numpy/ndarraytypes.h" && cp "/usr/include/python2.7/numpy/npy_math.h" "$(@D)/python_include/numpy/npy_math.h" && cp "/usr/include/python2.7/numpy/noprefix.h" "$(@D)/python_include/numpy/noprefix.h" && cp "/usr/include/python2.7/numpy/npy_3kcompat.h" "$(@D)/python_include/numpy/npy_3kcompat.h" && cp "/usr/include/python2.7/numpy/arrayscalars.h" "$(@D)/python_include/numpy/arrayscalars.h" && cp "/usr/include/python2.7/numpy/npy_os.h" "$(@D)/python_include/numpy/npy_os.h" && cp "/usr/include/python2.7/numpy/ndarrayobject.h" "$(@D)/python_include/numpy/ndarrayobject.h" && cp "/usr/include/python2.7/numpy/npy_no_deprecated_api.h" "$(@D)/python_include/numpy/npy_no_deprecated_api.h" && cp "/usr/include/python2.7/numpy/arrayobject.h" "$(@D)/python_include/numpy/arrayobject.h" && cp "/usr/include/python2.7/numpy/_numpyconfig.h" "$(@D)/python_include/numpy/_numpyconfig.h" && cp "/usr/include/python2.7/numpy/__multiarray_api.h" "$(@D)/python_include/numpy/__multiarray_api.h" && cp "/usr/include/python2.7/numpy/npy_cpu.h" "$(@D)/python_include/numpy/npy_cpu.h" && cp "/usr/include/python2.7/numpy/old_defines.h" "$(@D)/python_include/numpy/old_defines.h" && cp "/usr/include/python2.7/numpy/numpyconfig.h" "$(@D)/python_include/numpy/numpyconfig.h" && cp "/usr/include/python2.7/pycapsule.h" "$(@D)/python_include/pycapsule.h" && cp "/usr/include/python2.7/setobject.h" "$(@D)/python_include/setobject.h" && cp "/usr/include/python2.7/listobject.h" "$(@D)/python_include/listobject.h" && cp "/usr/include/python2.7/bytesobject.h" "$(@D)/python_include/bytesobject.h" && cp "/usr/include/python2.7/pgen.h" "$(@D)/python_include/pgen.h" && cp "/usr/include/python2.7/patchlevel.h" "$(@D)/python_include/patchlevel.h" && cp "/usr/include/python2.7/opcode.h" "$(@D)/python_include/opcode.h" && cp "/usr/include/python2.7/parsetok.h" "$(@D)/python_include/parsetok.h" && cp "/usr/include/python2.7/marshal.h" "$(@D)/python_include/marshal.h" && cp "/usr/include/python2.7/token.h" "$(@D)/python_include/token.h" && cp "/usr/include/python2.7/iterobject.h" "$(@D)/python_include/iterobject.h" && cp "/usr/include/python2.7/abstract.h" "$(@D)/python_include/abstract.h" && cp "/usr/include/python2.7/py_curses.h" "$(@D)/python_include/py_curses.h" && cp "/usr/include/python2.7/metagrammar.h" "$(@D)/python_include/metagrammar.h" && cp "/usr/include/python2.7/bufferobject.h" "$(@D)/python_include/bufferobject.h" && cp "/usr/include/python2.7/Python-ast.h" "$(@D)/python_include/Python-ast.h" """,
+)
+
+genrule(
+ name = "numpy_include",
+ outs = [
+ "numpy_include/numpy/oldnumeric.h",
+ "numpy_include/numpy/npy_1_7_deprecated_api.h",
+ "numpy_include/numpy/ufunc_api.txt",
+ "numpy_include/numpy/multiarray_api.txt",
+ "numpy_include/numpy/halffloat.h",
+ "numpy_include/numpy/npy_common.h",
+ "numpy_include/numpy/utils.h",
+ "numpy_include/numpy/npy_interrupt.h",
+ "numpy_include/numpy/npy_endian.h",
+ "numpy_include/numpy/__ufunc_api.h",
+ "numpy_include/numpy/_neighborhood_iterator_imp.h",
+ "numpy_include/numpy/ufuncobject.h",
+ "numpy_include/numpy/ndarraytypes.h",
+ "numpy_include/numpy/npy_math.h",
+ "numpy_include/numpy/noprefix.h",
+ "numpy_include/numpy/npy_3kcompat.h",
+ "numpy_include/numpy/arrayscalars.h",
+ "numpy_include/numpy/npy_os.h",
+ "numpy_include/numpy/ndarrayobject.h",
+ "numpy_include/numpy/npy_no_deprecated_api.h",
+ "numpy_include/numpy/arrayobject.h",
+ "numpy_include/numpy/_numpyconfig.h",
+ "numpy_include/numpy/__multiarray_api.h",
+ "numpy_include/numpy/npy_cpu.h",
+ "numpy_include/numpy/old_defines.h",
+ "numpy_include/numpy/numpyconfig.h",
+ ],
+ cmd = """
+cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/oldnumeric.h" "$(@D)/numpy_include/numpy/oldnumeric.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h" "$(@D)/numpy_include/numpy/npy_1_7_deprecated_api.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufunc_api.txt" "$(@D)/numpy_include/numpy/ufunc_api.txt" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/multiarray_api.txt" "$(@D)/numpy_include/numpy/multiarray_api.txt" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/halffloat.h" "$(@D)/numpy_include/numpy/halffloat.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_common.h" "$(@D)/numpy_include/numpy/npy_common.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/utils.h" "$(@D)/numpy_include/numpy/utils.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_interrupt.h" "$(@D)/numpy_include/numpy/npy_interrupt.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_endian.h" "$(@D)/numpy_include/numpy/npy_endian.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__ufunc_api.h" "$(@D)/numpy_include/numpy/__ufunc_api.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/_neighborhood_iterator_imp.h" "$(@D)/numpy_include/numpy/_neighborhood_iterator_imp.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h" "$(@D)/numpy_include/numpy/ufuncobject.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h" "$(@D)/numpy_include/numpy/ndarraytypes.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_math.h" "$(@D)/numpy_include/numpy/npy_math.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/noprefix.h" "$(@D)/numpy_include/numpy/noprefix.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_3kcompat.h" "$(@D)/numpy_include/numpy/npy_3kcompat.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayscalars.h" "$(@D)/numpy_include/numpy/arrayscalars.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_os.h" "$(@D)/numpy_include/numpy/npy_os.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h" "$(@D)/numpy_include/numpy/ndarrayobject.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_no_deprecated_api.h" "$(@D)/numpy_include/numpy/npy_no_deprecated_api.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h" "$(@D)/numpy_include/numpy/arrayobject.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/_numpyconfig.h" "$(@D)/numpy_include/numpy/_numpyconfig.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__multiarray_api.h" "$(@D)/numpy_include/numpy/__multiarray_api.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_cpu.h" "$(@D)/numpy_include/numpy/npy_cpu.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/old_defines.h" "$(@D)/numpy_include/numpy/old_defines.h" && cp "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/numpyconfig.h" "$(@D)/numpy_include/numpy/numpyconfig.h" """,
+)