python: fix HostPython host/target selection 2109/head
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Fri, 11 Dec 2015 15:13:21 +0000 (17:13 +0200)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Fri, 11 Dec 2015 15:13:21 +0000 (17:13 +0200)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lang/python/files/python-host.mk
lang/python/files/python-package.mk

index d3b795e018325d2c07ba3fd036d69e7d09f9c8a2..f680c1c87e3498ea8bf2c18db71ae9317860c280 100644 (file)
@@ -11,15 +11,19 @@ HOST_PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
 
 HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOST)/$(HOST_PYTHON_PKG_DIR)
 define HostPython
-       ifeq ($(3),)
-               $(3):=$(PYTHONPATH)
+       ifeq ($(strip $(3)),HOST)
+               LOCAL_PYTHONPATH:=$(HOST_PYTHONPATH)
+               LOCAL_STAGING_DIR:=$(STAGING_DIR_HOST)
+       else
+               LOCAL_PYTHONPATH:=$(PYTHONPATH)
+               LOCAL_STAGING_DIR:=$(STAGING_DIR)
        endif
-       (       export PYTHONPATH="$(3)"; \
+       (       export PYTHONPATH="$(LOCAL_PYTHONPATH)"; \
                export PYTHONOPTIMIZE=""; \
                export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR_HOST)"; \
-               export _python_prefix=""; \
-               export _python_exec_prefix=""; \
+               export _python_sysroot="$(LOCAL_STAGING_DIR)/usr"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
                $(1) \
                $(HOST_PYTHON_BIN) $(2); \
        )
@@ -52,7 +56,7 @@ define Build/Compile/HostPyMod
                , \
                ./setup.py $(2) \
                , \
-               $(HOST_PYTHONPATH) \
+               HOST \
        )
 endef
 
index 058c232f08b84b92278e09a38df97c3a1d819bc1..92e8fdd3747cd86efccde5a984a4666b439104dd 100644 (file)
@@ -105,8 +105,6 @@ define Build/Compile/PyMod
                $(3) \
                , \
                ./setup.py $(2) \
-               , \
-               $(PYTHONPATH) \
        )
        find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
 endef