aboutsummaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-09-13 12:15:18 +0800
committerRosen Penev <rosenp@gmail.com>2023-09-27 16:40:55 -0700
commit4d43be8549c8240f5039040fd1efd44aa2eb61fa (patch)
tree3b5a334610bb84ca8a0268631a21a2effa70faca /lang/python
parentf467f47f0ca226e382356a8e3615b5c55655b692 (diff)
python: Add environment variables to build Rust extensions
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/python3-host.mk5
-rw-r--r--lang/python/python3-package.mk7
2 files changed, 10 insertions, 2 deletions
diff --git a/lang/python/python3-host.mk b/lang/python/python3-host.mk
index b272c28ca..ca5cb64ba 100644
--- a/lang/python/python3-host.mk
+++ b/lang/python/python3-host.mk
@@ -11,6 +11,7 @@
# For PYTHON3_VERSION
python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(python3_mk_path)python3-version.mk
+include $(python3_mk_path)../rust/rust-values.mk
# Unset environment variables
@@ -76,7 +77,9 @@ HOST_PYTHON3_VARS = \
LDSHARED="$(HOSTCC) -shared" \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib"
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib" \
+ CARGO_HOME="$(CARGO_HOME)" \
+ PATH="$(CARGO_HOME)/bin:$(PATH)"
# $(1) => directory of python script
# $(2) => python script and its arguments
diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk
index 268bca07f..0693d21ee 100644
--- a/lang/python/python3-package.mk
+++ b/lang/python/python3-package.mk
@@ -44,7 +44,12 @@ PYTHON3_VARS = \
PYTHONDONTWRITEBYTECODE=1 \
_python_sysroot="$(STAGING_DIR)" \
_python_prefix="/usr" \
- _python_exec_prefix="/usr"
+ _python_exec_prefix="/usr" \
+ CARGO_BUILD_TARGET="$(RUSTC_TARGET_ARCH)" \
+ CARGO_HOME="$(CARGO_HOME)" \
+ PATH="$(CARGO_HOME)/bin:$(PATH)" \
+ PYO3_CROSS_LIB_DIR="$(PYTHON3_LIB_DIR)" \
+ RUSTFLAGS="$(CARGO_RUSTFLAGS)"
# $(1) => directory of python script
# $(2) => python script and its arguments