python: unify HostPython and HostHostPython functions

That means basically moving the host Python from $(STAGING_DIR_HOST)
to $(STAGING_DIR_HOST)/usr and making the PYTHONPATH var
as an argument.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
Alexandru Ardelean
2015-12-11 12:01:21 +02:00
parent 8054747a49
commit c55641331e
3 changed files with 22 additions and 24 deletions

View File

@@ -17,21 +17,10 @@ PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
PYTHON:=python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/usr/lib/python$(PYTHON_VERSION)
HOST_PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/python2
PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
define HostPython
( export PYTHONPATH="$(PYTHONPATH)"; \
export PYTHONOPTIMIZE=""; \
export PYTHONDONTWRITEBYTECODE=1; \
export _python_sysroot="$(STAGING_DIR)"; \
export _python_prefix="/usr"; \
export _python_exec_prefix="/usr"; \
$(1) \
$(HOST_PYTHON_BIN) $(2); \
)
endef
# These configure args are needed in detection of path to Python header files
# using autotools.
@@ -94,6 +83,8 @@ define PyPackage
endef
endef
$(call include_mk, python-host.mk)
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
@@ -114,6 +105,8 @@ define Build/Compile/PyMod
$(3) \
, \
./setup.py $(2) \
, \
$(PYTHONPATH) \
)
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef