python: add include guard for python-host.mk and include in Makefile
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Fri, 4 Nov 2016 08:35:03 +0000 (10:35 +0200)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 7 Nov 2016 07:27:20 +0000 (09:27 +0200)
So that it can be included twice.
python-package.mk include python-host.mk, but at some point
in time python-host.mk is not exported to staging_dir yet.

So, to have in python's Makefile, we need to include it
in the Makefile, and to prevent double inclusion (if
python-host.mk is exported from a previous build), the
include guard is added.

Also, moved the includes after some vars were set.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lang/python/Makefile
lang/python/files/python-host.mk

index c333f8e0855f3760504f6d80e9b1d1c2ca681f5d..336c3b0a680b2914034024fe72640dbac2469920 100644 (file)
@@ -7,6 +7,9 @@
 
 include $(TOPDIR)/rules.mk
 
+# This file provides the necsessary host build variables
+include ./files/python-host.mk
+
 # The file included below defines PYTHON_VERSION
 include ./files/python-package.mk
 
index 0a5eb4193eea752b337fdd266c349241255cdaa9..da24f3dc17f1bba2df2dc625e93878a4f4f65285 100644 (file)
@@ -5,6 +5,9 @@
 # See /LICENSE for more information.
 #
 
+ifneq ($(__python_host_mk_inc),1)
+__python_host_mk_inc=1
+
 # Compatibility fallback for older OpenWrt and LEDE versions
 ifeq ($(STAGING_DIR_HOSTPKG),)
   $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
@@ -71,3 +74,4 @@ define Build/Compile/HostPyMod
                $(3))
 endef
 
+endif # __python_host_mk_inc