python: fix invalid library paths leaking into the build, and other improvements

This commit improves the cross-compilation patches we have on top of
Python, to fix the problem of host library paths leaking into the
build of target modules, as seen at:

 http://autobuild.buildroot.org/results/fcc/fccd7e08cd9d4713eb4208097dd48c5ab25749bc/build-end.log
 http://autobuild.buildroot.org/results/0bd/0bda780bf4b759b12edec26ac20b88cde617db4d/build-end.log

To do so, it ensures that the right python2.7/config/Makefile is used
when building target modules, and adjusts at runtime the paths read
from this Makefile if we are cross-compiling.

In addition, it installs the pgen program into the host directory, and
points the target python build to use python and pgen from $(HOST_DIR)
instead of from the host python source directory, which looks cleaner.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Thomas Petazzoni
2013-12-22 18:02:10 +01:00
parent d9ddd28bb1
commit b07b9d181d
3 changed files with 75 additions and 33 deletions

View File

@@ -29,7 +29,6 @@ PKG_PYTHON_DISTUTILS_ENV = \
LDSHARED="$(TARGET_CROSS)gcc -shared" \
CROSS_COMPILING=yes \
_python_sysroot=$(STAGING_DIR) \
_python_srcdir=$(PYTHON_DIR) \
_python_prefix=/usr \
_python_exec_prefix=/usr
@@ -50,7 +49,11 @@ HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT = \
PKG_PYTHON_SETUPTOOLS_ENV = \
PATH="$(TARGET_PATH)" \
PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
PYTHONXCPREFIX="$(STAGING_DIR)/usr/"
PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
CROSS_COMPILING=yes \
_python_sysroot=$(STAGING_DIR) \
_python_prefix=/usr \
_python_exec_prefix=/usr
PKG_PYTHON_SETUPTOOLS_INSTALL_OPT = \
--prefix=$(TARGET_DIR)/usr \