From c55641331e892b8bf4a7a8ae4883a85c713704af Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Fri, 11 Dec 2015 12:01:21 +0200 Subject: 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 --- lang/python/files/python-host.mk | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'lang/python/files/python-host.mk') diff --git a/lang/python/files/python-host.mk b/lang/python/files/python-host.mk index ed0ef4159..d3b795e01 100644 --- a/lang/python/files/python-host.mk +++ b/lang/python/files/python-host.mk @@ -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 -- cgit