mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 10:24:31 +04:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user