summaryrefslogtreecommitdiffstats
path: root/rules/python3.make
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-09-15 15:20:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-09-21 10:19:18 +0200
commit4c05998e7714a4f0e11f38b36934c81907df7736 (patch)
tree71f33e7b3456b0d7e86add374a91039f9a830d6b /rules/python3.make
parent95d4e223fde009ddf9e61d95fc82c85ecbacb0b1 (diff)
downloadptxdist-4c05998e7714a4f0e11f38b36934c81907df7736.tar.gz
ptxdist-4c05998e7714a4f0e11f38b36934c81907df7736.tar.xz
python3: generate cross python wrapper in the makefile
This avoids a patch and works correctly with devpks. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/python3.make')
-rw-r--r--rules/python3.make14
1 files changed, 12 insertions, 2 deletions
diff --git a/rules/python3.make b/rules/python3.make
index 0e1c46a7e..b616617d6 100644
--- a/rules/python3.make
+++ b/rules/python3.make
@@ -84,12 +84,22 @@ $(STATEDIR)/python3.install:
@$(call install, PYTHON3)
@$(call touch)
+PYTHON3_PLATFORM := $(call remove_quotes,$(PTXCONF_ARCH_STRING))
+ifdef PTXCONF_ARCH_ARM64
+PYTHON3_PLATFORM := arm
+endif
+
$(STATEDIR)/python3.install.post:
@$(call targetinfo)
@$(call world/install.post, PYTHON3)
- @cp "$(PYTHON3_DIR)/cross-python-wrapper" "$(PTXCONF_SYSROOT_CROSS)/bin/python$(PYTHON3_MAJORMINOR)"
- @chmod a+x "$(PTXCONF_SYSROOT_CROSS)/bin/python$(PYTHON3_MAJORMINOR)"
+ @rm -f "$(CROSS_PYTHON3)"
+ @echo '#!/bin/sh' >> "$(CROSS_PYTHON3)"
+ @echo '_PYTHON_PROJECT_BASE=$(PYTHON3_DIR)' >> "$(CROSS_PYTHON3)"
+ @echo '_PYTHON_HOST_PLATFORM=linux2-$(PYTHON3_PLATFORM)' >> "$(CROSS_PYTHON3)"
+ @echo 'export _PYTHON_PROJECT_BASE _PYTHON_HOST_PLATFORM' >> "$(CROSS_PYTHON3)"
+ @echo 'exec $(HOSTPYTHON3) "$${@}"' >> "$(CROSS_PYTHON3)"
+ @chmod a+x "$(CROSS_PYTHON3)"
@ln -sf "python$(PYTHON3_MAJORMINOR)" \
"$(PTXCONF_SYSROOT_CROSS)/bin/python3"