From 4d0a44d31ad1a387e8b810283960b524e1136b2c Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 13 Aug 2017 22:06:08 +0300 Subject: python,python3: add host-flags/settings to host pip install rules The host pip install should have the host's CFLAGS, LDFLAGS, etc available. And not the target's flags. Otherwise, weird things can happen when installing packages (host-side) that need to build C code. Signed-off-by: Alexandru Ardelean --- lang/python/python3/files/python3-host.mk | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'lang/python/python3/files/python3-host.mk') diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3/files/python3-host.mk index 96bbc19cc..4990d33a0 100644 --- a/lang/python/python3/files/python3-host.mk +++ b/lang/python/python3/files/python3-host.mk @@ -37,21 +37,26 @@ define HostPython3 $(HOST_PYTHON3_BIN) $(2); endef +define host_python3_settings + ARCH="$(HOST_ARCH)" \ + CC="$(HOSTCC)" \ + CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ + CXX="$(HOSTCXX)" \ + LD="$(HOSTCC)" \ + LDSHARED="$(HOSTCC) -shared" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \ + LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ + _PYTHON_HOST_PLATFORM=linux2 +endef + # $(1) => commands to execute before running pythons script # $(2) => python script and its arguments # $(3) => additional variables define Build/Compile/HostPy3RunHost $(call HostPython3, \ $(if $(1),$(1);) \ - CC="$(HOSTCC)" \ - CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ - CXX="$(HOSTCXX)" \ - LD="$(HOSTCC)" \ - LDSHARED="$(HOSTCC) -shared" \ - CFLAGS="$(HOST_CFLAGS)" \ - CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \ - LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \ - _PYTHON_HOST_PLATFORM=linux2 \ + $(call host_python3_settings) \ $(3) \ , \ $(2) \ @@ -63,6 +68,7 @@ endef # Note: I shamelessly copied this from Yousong's logic (from python-packages); HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION) define host_python3_pip_install + $(call host_python3_settings) \ $(HOST_PYTHON3_PIP) install \ --root=$(1) \ --prefix=$(2) \ -- cgit