summaryrefslogtreecommitdiff
path: root/lang/python3/files/python3-package.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python3/files/python3-package.mk')
-rw-r--r--lang/python3/files/python3-package.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk
index e85b64819..e2e71d3e0 100644
--- a/lang/python3/files/python3-package.mk
+++ b/lang/python3/files/python3-package.mk
@@ -32,10 +32,15 @@ define Py3Package
$(call shexport,Py3Package/$(1)/filespec)
define Package/$(1)/install
+ find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
@$(SH_FUNC) getvar $$(call shvar,Py3Package/$(1)/filespec) | ( \
IFS='|'; \
while read fop fspec fperm; do \
if [ "$$$$$$$$fop" = "+" ]; then \
+ if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
+ echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
+ exit 1; \
+ fi; \
dpath=`dirname "$$$$$$$$fspec"`; \
if [ -n "$$$$$$$$fperm" ]; then \
dperm="-m$$$$$$$$fperm"; \
@@ -67,9 +72,14 @@ endef
define Build/Compile/Py3Mod
$(call HostPython3, \
cd $(PKG_BUILD_DIR)/$(strip $(1)); \
+ CC="$(TARGET_CC)" \
+ CCSHARED="$(TARGET_CC) $(FPIC)" \
+ LD="$(TARGET_CC)" \
+ LDSHARED="$(TARGET_CC) -shared" \
CFLAGS="$(TARGET_CFLAGS)" \
- CPPFLAGS="$(TARGET_CPPFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
+ _PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
$(3) \
, \
./setup.py $(2) \