summaryrefslogtreecommitdiffstats
path: root/package/python/python-2.7-015-distutils-cross-compilation-support.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-02-13 21:48:53 +0100
committerPeter Korsgaard <peter@korsgaard.com>2014-02-14 21:41:43 +0100
commit7e960dc9da56d4a484b5480746aaf617ca491274 (patch)
tree214a78615dbc3700847ca2be645ad75b5235d7ba /package/python/python-2.7-015-distutils-cross-compilation-support.patch
parent577e52ac087a1a3c63837d0da37c93949c455941 (diff)
downloadbuildroot-7e960dc9da56d4a484b5480746aaf617ca491274.tar.gz
buildroot-7e960dc9da56d4a484b5480746aaf617ca491274.zip
python: bump to 2.7.6
Even though jumping from 2.7.3 to 2.7.6 looks like a minor version bump, it is in fact a fairly significant one, because a good number of changes to help cross-compilation have been merged into Python upstream. Therefore, most of our patches are affected by this change. In detail, this commit: * Renames all the patches to follow the naming convention of patches in Buildroot: the patch file names should not have any version number. * The patches numbered above 100, that add configuration options to disable certain modules of the Python standard library, are only renamed and slightly adapted, they didn't change that much. * The patches numbered below 100 are almost entirely rewritten: many of the cross-compilation problems that used to exist in Python 2.7.3 no longer exist, and the number of remaining problems is smaller, and can be fixed with smaller patches. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/python/python-2.7-015-distutils-cross-compilation-support.patch')
-rw-r--r--package/python/python-2.7-015-distutils-cross-compilation-support.patch125
1 files changed, 0 insertions, 125 deletions
diff --git a/package/python/python-2.7-015-distutils-cross-compilation-support.patch b/package/python/python-2.7-015-distutils-cross-compilation-support.patch
deleted file mode 100644
index 7fd404e54e..0000000000
--- a/package/python/python-2.7-015-distutils-cross-compilation-support.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-Add some cross-compilation fixes to distutils
-
-Inspired by work done by Marc Kleine-Budde <mkl@pengutronix.de> in
-PTXdist.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- Lib/distutils/sysconfig.py | 7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
-
-Index: b/Lib/distutils/sysconfig.py
-===================================================================
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -18,14 +18,38 @@
-
- from distutils.errors import DistutilsPlatformError
-
--# These are needed in a couple of spots, so just compute them once.
--PREFIX = os.path.normpath(sys.prefix)
--EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
-+if os.environ.get('CROSS_COMPILING') == 'yes':
-+ _sysroot=os.environ.get('_python_sysroot')
-+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
-+ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
-+ # In the cross-compilation case, we have two cases:
-+ #
-+ # 1/ We're currently cross-compiling Python itself. In this case,
-+ # EXECUTABLE_DIRNAME should point to the source directory of the
-+ # target Python, so that the rest of the code, especially the
-+ # _python_build() function will properly understand that we are
-+ # building Python itself. In this case, _python_srcdir is
-+ # defined.
-+ #
-+ # 2/ We're currently cross-compiling third party Python
-+ # modules. In this case, EXECUTABLE_DIRNAME should point to where
-+ # the target python executable is installed in the sysroot, so
-+ # that the proper Makefile is going to be read. In this case,
-+ # _python_srcdir is not defined.
-+ #
-+ if os.environ.get('_python_srcdir') is not None:
-+ EXECUTABLE_DIRNAME = os.environ.get('_python_srcdir')
-+ else:
-+ EXECUTABLE_DIRNAME = os.path.join(_sysroot, "usr/bin")
-+else:
-+ PREFIX = os.path.normpath(sys.prefix)
-+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
-+ EXECUTABLE_DIRNAME = os.path.dirname(os.path.realpath(sys.executable))
-
- # Path to the base directory of the project. On Windows the binary may
- # live in project/PCBuild9. If we're dealing with an x64 Windows build,
- # it'll live in project/PCbuild/amd64.
--project_base = os.path.dirname(os.path.abspath(sys.executable))
-+project_base = EXECUTABLE_DIRNAME
- if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
- project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
- # PC/VS7.1
-@@ -74,7 +98,7 @@
-
- if os.name == "posix":
- if python_build:
-- buildir = os.path.dirname(sys.executable)
-+ buildir = EXECUTABLE_DIRNAME
- if plat_specific:
- # python.h is located in the buildir
- inc_dir = buildir
-@@ -245,7 +269,7 @@
- def get_makefile_filename():
- """Return full pathname of installed Makefile from the Python build."""
- if python_build:
-- return os.path.join(os.path.dirname(sys.executable), "Makefile")
-+ return os.path.join(EXECUTABLE_DIRNAME, "Makefile")
- lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
- return os.path.join(lib_dir, "config", "Makefile")
-
-@@ -311,6 +335,11 @@
- # `$$' is a literal `$' in make
- tmpv = v.replace('$$', '')
-
-+ # Adjust prefix and exec_prefix when we're cross compiling
-+ if os.environ.get('CROSS_COMPILING') == "yes":
-+ if n == "prefix" or n == "exec_prefix":
-+ v = _sysroot + v
-+
- if "$" in tmpv:
- notdone[n] = v
- else:
-Index: b/configure.in
-===================================================================
---- a/configure.in
-+++ b/configure.in
-@@ -4342,6 +4342,20 @@
- CROSS_COMPILING=$cross_compiling
- AC_SUBST(CROSS_COMPILING)
-
-+#
-+# Cross compiling
-+#
-+# special RUNSHARED
-+if test "$cross_compiling" = "yes"; then
-+ RUNSHARED="\
-+ CROSS_COMPILING=yes \
-+ _python_cross_host=${ac_cv_host} \
-+ _python_srcdir=\"\$(srcdir)\" \
-+ _python_prefix=\"\$(prefix)\" \
-+ _python_exec_prefix=\"\$(exec_prefix)\""
-+fi
-+
-+
- # generate output files
- AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
- AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
-Index: b/Lib/distutils/command/build_ext.py
-===================================================================
---- a/Lib/distutils/command/build_ext.py
-+++ b/Lib/distutils/command/build_ext.py
-@@ -237,7 +237,7 @@
- if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu')
- or sys.platform.startswith('sunos'))
- and sysconfig.get_config_var('Py_ENABLE_SHARED')):
-- if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
-+ if not sysconfig.python_build:
- # building third party extensions
- self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
- else:
OpenPOWER on IntegriCloud