aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/toolchains/cpus/arm/arm_compiler_configure.bzl')
-rw-r--r--third_party/toolchains/cpus/arm/arm_compiler_configure.bzl11
1 files changed, 11 insertions, 0 deletions
diff --git a/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl b/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl
index 5eb3b7bb1c..ab6eac115c 100644
--- a/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl
+++ b/third_party/toolchains/cpus/arm/arm_compiler_configure.bzl
@@ -11,9 +11,20 @@ def _tpl(repository_ctx, tpl, substitutions={}, out=None):
def _arm_compiler_configure_impl(repository_ctx):
+ # We need to find a cross-compilation include directory for Python, so look
+ # for an environment variable. Be warned, this crosstool template is only
+ # regenerated on the first run of Bazel, so if you change the variable after
+ # it may not be reflected in later builds. Doing a shutdown and clean of Bazel
+ # doesn't fix this, you'll need to delete the generated file at something like:
+ # external/local_config_arm_compiler/CROSSTOOL in your Bazel install.
+ if "CROSSTOOL_PYTHON_INCLUDE_PATH" in repository_ctx.os.environ:
+ python_include_path = repository_ctx.os.environ["CROSSTOOL_PYTHON_INCLUDE_PATH"]
+ else:
+ python_include_path = "/usr/include/python2.7"
_tpl(repository_ctx, "CROSSTOOL", {
"%{ARM_COMPILER_PATH}%": str(repository_ctx.path(
repository_ctx.attr.remote_config_repo)),
+ "%{PYTHON_INCLUDE_PATH}%": python_include_path,
})
repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")