From d82df10e90ee9457ea0baba2d6a766149d4b7c38 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 10 Dec 2010 23:05:39 +0100 Subject: python: Port the python2.4 patches to 2.7 Signed-off-by: Maxime Ripard --- package/python/python-2.7-002-cross-compile.patch | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 package/python/python-2.7-002-cross-compile.patch (limited to 'package/python/python-2.7-002-cross-compile.patch') diff --git a/package/python/python-2.7-002-cross-compile.patch b/package/python/python-2.7-002-cross-compile.patch new file mode 100644 index 000000000..598e5f520 --- /dev/null +++ b/package/python/python-2.7-002-cross-compile.patch @@ -0,0 +1,47 @@ +Second patch to bring cross-compilation support to python build-system. + +Allow the libraries detection routine to look for headers and libs in +other directories than /usr/include or /usr/lib through the env variables +PYTHON_MODULES_INCLUDE and PYTHON_MODULES_LIB. + +We can then use it to look for libraries in the buildroot staging directory. + + +Patch ported to python2.7 by Maxime Ripard + +diff -rduNp Python-2.7.orig/setup.py Python-2.7/setup.py +--- Python-2.7.orig/setup.py 2010-09-21 17:15:31.000000000 +0200 ++++ Python-2.7/setup.py 2010-09-21 17:20:46.000000000 +0200 +@@ -346,6 +346,18 @@ class PyBuildExt(build_ext): + return sys.platform + + def detect_modules(self): ++ try: ++ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split() ++ except KeyError: ++ modules_include_dirs = ['/usr/include'] ++ try: ++ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split() ++ except KeyError: ++ modules_include_dirs = ['/usr/lib'] ++ for dir in modules_include_dirs: ++ add_dir_to_list(self.compiler.include_dirs, dir) ++ for dir in modules_lib_dirs: ++ add_dir_to_list(self.compiler.library_dirs, dir) + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. + # We must get the values from the Makefile and not the environment +@@ -388,11 +400,8 @@ class PyBuildExt(build_ext): + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +- lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ lib_dirs = self.compiler.library_dirs ++ inc_dirs = self.compiler.include_dirs + exts = [] + missing = [] + -- cgit v1.2.3