aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2016-11-01 12:41:16 +0100
committerJo-Philipp Wich <jo@mein.io>2016-11-01 12:57:36 +0100
commit73b7f55424de52d8179a9ad808252fe3bf8dcc9d (patch)
tree99b7fff135f459e3cde6823bda6efa85e9a28154
parente08d70d8aa6818bb4666db1305f1d327dad537c8 (diff)
python: avoid use of HOST_BUILD_PREFIX
Currently, the python-host.mk framework relies on HOST_BUILD_PREFIX to refer to the $(STAGING_DIR)/host directory but using the HOST_BUILD_PREFIX variable requires the use of include/host-build.mk which in turn includes python-host.mk, leading to target redefinition errors. In order to provide a global, uniform way to refer to the host staging directory, LEDE introduced a new variable STAGING_DIR_HOSTPKG which points to $(STAGING_DIR)/host for now with the purpose of eventually being able to relocate that directory in the future. This commit changes python-host.mk to ... - stop including include/host-build.mk (revert of #3423) - replace usages of $(HOST_BUILD_PREFIX) with $(STAGING_DIR_HOSTPKG) - warn and fallback to $(STAGING_DIR)/host if STAGING_DIR_HOSTPKG is unavailable The fallback code will ensure that the python host build infrastructure continues to work properly on older OpenWrt and LEDE versions until the STAGING_DIR_HOSTPKG is fully settled in and can be removed some time in the future. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--lang/python/files/python-host.mk13
1 files changed, 8 insertions, 5 deletions
diff --git a/lang/python/files/python-host.mk b/lang/python/files/python-host.mk
index 5b74d1006..0a5eb4193 100644
--- a/lang/python/files/python-host.mk
+++ b/lang/python/files/python-host.mk
@@ -5,10 +5,13 @@
# See /LICENSE for more information.
#
-# For HOST_BUILD_PREFIX
-include $(INCLUDE_DIR)/host-build.mk
+# Compatibility fallback for older OpenWrt and LEDE versions
+ifeq ($(STAGING_DIR_HOSTPKG),)
+ $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
+ STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
+endif
-HOST_PYTHON_DIR:=$(HOST_BUILD_PREFIX)
+HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
@@ -16,7 +19,7 @@ HOST_PYTHON_PKG_DIR:=/lib/python$(PYTHON_VERSION)/site-packages
HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
-HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_BUILD_PREFIX)/$(HOST_PYTHON_PKG_DIR)
+HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOSTPKG)/$(HOST_PYTHON_PKG_DIR)
define HostPython
if [ "$(strip $(3))" == "HOST" ]; then \
@@ -47,7 +50,7 @@ define Build/Compile/HostPyRunHost
LDSHARED="$(HOSTCC) -shared" \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(HOST_BUILD_PREFIX)/lib" \
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
_PYTHON_HOST_PLATFORM=linux2 \
$(3) \
, \