summaryrefslogtreecommitdiff
path: root/lang/python/python3/Makefile
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2020-04-27 14:10:53 +0800
committerJeffery To <jeffery.to@gmail.com>2020-04-28 13:56:47 +0800
commit3d2dc69200f298c5a9679810134aa75f070c8bc4 (patch)
treeaed36145e3bb12f183f29bf4b3156e08a93d9f46 /lang/python/python3/Makefile
parent99abc1bd8974c9ebd8904901d5c49ba0de1db6a2 (diff)
python3: Fix host build tool names recorded in target files
Python will record the values of CC, CXX, AR, and READELF (and other configure options) used during compilation. pip will use these programs when asked to compile extension modules on the target device. * If ccache is used during build, CC and CXX will be ccache_cc and ccache_cxx, respectively, which are not available on-device (#11912). * If an external toolchain is used during build, the values of these variables will contain the external toolchain prefix, which may not be available on target. * If the normal toolchain is used during build, AR and READELF will contain the toolchain prefix, but the names of ar and readelf on-device do not contain the prefix; they are named "ar" and "readelf". This changes the values of these variables in Python's files to match the names available on-device, and without any toolchain prefix. Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit 9f81ab895eca0709d1a7b4804b36a5cd00b4f368)
Diffstat (limited to 'lang/python/python3/Makefile')
-rw-r--r--lang/python/python3/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index 12b1bc039..975d6a1e9 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
@@ -127,6 +127,9 @@ define Package/python3/description
It's python3-light + all other packages.
endef
+TARGET_CONFIGURE_OPTS+= \
+ READELF="$(TARGET_CROSS)readelf"
+
MAKE_FLAGS+=\
CROSS_COMPILE=yes \
LD="$(TARGET_CC)" \
@@ -284,6 +287,9 @@ define Py3Package/python3-base/install
$(INSTALL_DIR) $(1)/usr/bin
$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
+ # This depends on being called before filespec is processed
+ $(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py
endef
Py3Package/python3-light/install:=: