pkg-python: no longer use distutilscross for setuptools

Thanks to the bump of Python 2.x, distutilscross is no longer needed
to achieve cross-compilation for setuptools packages. The host Python
2.x interpreter can be tricked into using the target compiler thanks
to pointing it to a different sysconfigdata module, which is achieved
using PYTHON_PATH.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Thomas Petazzoni
2014-02-18 21:39:54 +01:00
committed by Peter Korsgaard
parent 8d3590d4b0
commit c7bf337ec5

View File

@@ -114,7 +114,7 @@ endif
else ifeq ($$($(2)_SETUP_TYPE),setuptools) else ifeq ($$($(2)_SETUP_TYPE),setuptools)
ifeq ($(4),target) ifeq ($(4),target)
$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
$(2)_BASE_BUILD_TGT = build -x $(2)_BASE_BUILD_TGT = build
$(2)_BASE_BUILD_OPT = $(2)_BASE_BUILD_OPT =
$(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_OPT) $(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_OPT)
else else
@@ -133,13 +133,12 @@ endif
# front of the dependencies. # front of the dependencies.
# #
# However it must be repeated from inner-generic-package, as we need # However it must be repeated from inner-generic-package, as we need
# to exclude the python, host-python, host-python-setuptools and # to exclude the python, host-python and host-python-setuptools
# host-distutilscross packages, which are added below in the list of # packages, which are added below in the list of dependencies
# dependencies depending on the package characteristics, and shouldn't # depending on the package characteristics, and shouldn't be derived
# be derived automatically from the dependencies of the corresponding # automatically from the dependencies of the corresponding target
# target package. For example, target packages need # package.
# host-python-distutilscross, but not host packages. $(2)_DEPENDENCIES ?= $(filter-out host-python host-python-setuptools host-toolchain $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
$(2)_DEPENDENCIES ?= $(filter-out host-python host-python-setuptools host-python-distutilscross host-toolchain $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
# Target packages need both the python interpreter on the target (for # Target packages need both the python interpreter on the target (for
# runtime) and the python interpreter on the host (for # runtime) and the python interpreter on the host (for
@@ -152,17 +151,13 @@ $(2)_DEPENDENCIES += host-python
endif endif
# Setuptools based packages will need host-python-setuptools (both # Setuptools based packages will need host-python-setuptools (both
# host and target) and host-python-distutilscross (only target # host and target). We need to have a special exclusion for the
# packages). We need to have a special exclusion for the
# host-setuptools package itself: it is setuptools-based, but # host-setuptools package itself: it is setuptools-based, but
# shouldn't depend on host-setuptools (because it would otherwise # shouldn't depend on host-setuptools (because it would otherwise
# depend on itself!). # depend on itself!).
ifeq ($$($(2)_SETUP_TYPE),setuptools) ifeq ($$($(2)_SETUP_TYPE),setuptools)
ifneq ($(2),HOST_PYTHON_SETUPTOOLS) ifneq ($(2),HOST_PYTHON_SETUPTOOLS)
$(2)_DEPENDENCIES += host-python-setuptools $(2)_DEPENDENCIES += host-python-setuptools
ifeq ($(4),target)
$(2)_DEPENDENCIES += host-python-distutilscross
endif
endif endif
endif endif