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

@@ -7,11 +7,14 @@
HOST_PYTHON_INC_DIR:=$(STAGING_DIR_HOST)/include/python$(PYTHON_VERSION)
HOST_PYTHON_PKG_DIR:=/lib/python$(PYTHON_VERSION)/site-packages
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 HostHostPython
( export PYTHONPATH="$(HOST_PYTHONPATH)"; \
define HostPython
ifeq ($(3),)
$(3):=$(PYTHONPATH)
endif
( export PYTHONPATH="$(3)"; \
export PYTHONOPTIMIZE=""; \
export PYTHONDONTWRITEBYTECODE=1; \
export _python_sysroot="$(STAGING_DIR_HOST)"; \
@@ -25,15 +28,15 @@ endef
# These configure args are needed in detection of path to Python header files
# using autotools.
HOST_CONFIGURE_ARGS += \
_python_sysroot="$(STAGING_DIR_HOST)" \
_python_prefix="" \
_python_exec_prefix=""
_python_sysroot="$(STAGING_DIR_HOST)/usr" \
_python_prefix="/usr" \
_python_exec_prefix="/usr"
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
define Build/Compile/HostPyMod
$(call HostHostPython, \
$(call HostPython, \
cd $(HOST_BUILD_DIR)/$(strip $(1)); \
CC="$(HOSTCC)" \
CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
@@ -48,6 +51,8 @@ define Build/Compile/HostPyMod
$(3) \
, \
./setup.py $(2) \
, \
$(HOST_PYTHONPATH) \
)
endef