summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2011-08-03 19:55:11 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2011-08-04 00:02:16 +0200
commit54a3085b6ff627516a4d4b4be7e278c0aad30878 (patch)
tree79d228d7b7fca8d5599e38d4203936d87caeffbb
parent2e3dc3f26fccd427061531ab36f03343c54dc06c (diff)
downloadptxdist-54a3085b6ff627516a4d4b4be7e278c0aad30878.tar.gz
ptxdist-54a3085b6ff627516a4d4b4be7e278c0aad30878.tar.xz
python3: version bump 3.1.2 -> 3.1.4
also build on Linux 3.x host. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--patches/Python-3.1.2/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch225
-rw-r--r--patches/Python-3.1.2/0010-use-PGEN_FOR_BUILD.patch34
-rw-r--r--patches/Python-3.1.2/0021-fix-parallel-building.patch34
-rw-r--r--patches/Python-3.1.2/0022-python-don-t-call-cross-python.patch22
-rw-r--r--patches/Python-3.1.2/series22
-rw-r--r--patches/Python-3.1.4/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch224
-rw-r--r--patches/Python-3.1.4/0002-printf-format-zd.patch (renamed from patches/Python-3.1.2/0004--configure.in-printf-format-zd.patch)13
-rw-r--r--patches/Python-3.1.4/0003-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch (renamed from patches/Python-3.1.2/0005-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch)25
-rw-r--r--patches/Python-3.1.4/0004-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch (renamed from patches/Python-3.1.2/0006-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch)12
-rw-r--r--patches/Python-3.1.4/0005-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch (renamed from patches/Python-3.1.2/0007-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch)9
-rw-r--r--patches/Python-3.1.4/0006-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch (renamed from patches/Python-3.1.2/0008-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch)16
-rw-r--r--patches/Python-3.1.4/0007-fix-silent-flag.patch (renamed from patches/Python-3.1.2/0009-fix-silent-flag.patch)15
-rw-r--r--patches/Python-3.1.4/0008-use-PGEN_FOR_BUILD.patch33
-rw-r--r--patches/Python-3.1.4/0009-introduce-and-use-PYTHON_FOR_BUILD.patch (renamed from patches/Python-3.1.2/0011-introduce-and-use-PYTHON_FOR_BUILD.patch)61
-rw-r--r--patches/Python-3.1.4/0010-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch (renamed from patches/Python-3.1.2/0012-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch)45
-rw-r--r--patches/Python-3.1.4/0011-setup.py-don-t-leak-host-path-into-cross-compilation.patch (renamed from patches/Python-3.1.2/0013-setup.py-don-t-leak-host-path-into-cross-compilatio.patch)24
-rw-r--r--patches/Python-3.1.4/0012-setup.py-skip-import-check-while-cross-compiling.patch (renamed from patches/Python-3.1.2/0014-setup.py-skip-import-check-while-cross-compiling.patch)9
-rw-r--r--patches/Python-3.1.4/0013-add-cross-compilation-support.patch (renamed from patches/Python-3.1.2/0015-add-cross-compilation-support.patch)37
-rw-r--r--patches/Python-3.1.4/0014-provide-wrapper-for-cross-python.patch (renamed from patches/Python-3.1.2/0016-provide-wrapper-for-cross-python.patch)18
-rw-r--r--patches/Python-3.1.4/0015-0017-fix-for-new-autoconf.diff.patch (renamed from patches/Python-3.1.2/0017-fix-for-new-autoconf.diff)12
-rw-r--r--patches/Python-3.1.4/0016-0018-dont-add-rpaths.diff.patch (renamed from patches/Python-3.1.2/0018-dont-add-rpaths.diff)14
-rw-r--r--patches/Python-3.1.4/0017-add-cache-variable-for-sem_getvalue-test.patch (renamed from patches/Python-3.1.2/0019-add-cache-for-sem-getvalue.diff)13
-rw-r--r--patches/Python-3.1.4/0018-assume-non-buggy-getaddrinfo-when-cross-compiling.patch (renamed from patches/Python-3.1.2/0020-assume-non-buggy-getaddrinfo-when-cross-compiling.patch)7
-rwxr-xr-xpatches/Python-3.1.4/autogen.sh (renamed from patches/Python-3.1.2/autogen.sh)0
-rw-r--r--patches/Python-3.1.4/series21
-rw-r--r--rules/python3.make7
26 files changed, 434 insertions, 518 deletions
diff --git a/patches/Python-3.1.2/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch b/patches/Python-3.1.2/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
deleted file mode 100644
index c0f06fd94..000000000
--- a/patches/Python-3.1.2/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
+++ /dev/null
@@ -1,225 +0,0 @@
-From 7f8972018c739fedf709f6d25405fa5505d226c7 Mon Sep 17 00:00:00 2001
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Tue, 5 May 2009 15:17:20 +0200
-Subject: [PATCH] Add support for socketcan to the python socket module
-
-This patch add support for the protocol family AF_CAN. It contains all the
-necessary code to use the python socket module for socketcan.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Lib/plat-linux2/IN.py | 2 +
- Modules/socketmodule.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
- Modules/socketmodule.h | 11 ++++++
- configure.in | 13 +++++++
- 4 files changed, 115 insertions(+)
-
-Index: b/Lib/plat-linux2/IN.py
-===================================================================
---- a/Lib/plat-linux2/IN.py
-+++ b/Lib/plat-linux2/IN.py
-@@ -384,6 +384,7 @@ PF_SNA = 22
- PF_IRDA = 23
- PF_PPPOX = 24
- PF_WANPIPE = 25
-+PF_CAN = 29
- PF_BLUETOOTH = 31
- PF_MAX = 32
- AF_UNSPEC = PF_UNSPEC
-@@ -414,6 +415,7 @@ AF_SNA = PF_SNA
- AF_IRDA = PF_IRDA
- AF_PPPOX = PF_PPPOX
- AF_WANPIPE = PF_WANPIPE
-+AF_CAN = PF_CAN
- AF_BLUETOOTH = PF_BLUETOOTH
- AF_MAX = PF_MAX
- SOL_RAW = 255
-Index: b/Modules/socketmodule.c
-===================================================================
---- a/Modules/socketmodule.c
-+++ b/Modules/socketmodule.c
-@@ -420,6 +420,10 @@ dup_socket(SOCKET handle)
-
- #define SAS2SA(x) ((struct sockaddr *)(x))
-
-+#ifdef ENABLE_CAN
-+#include <linux/can/raw.h>
-+#endif
-+
- /*
- * Constants for getnameinfo()
- */
-@@ -1005,6 +1009,22 @@ makesockaddr(int sockfd, struct sockaddr
- }
- #endif
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ struct sockaddr_can *a = (struct sockaddr_can *)addr;
-+ char *ifname = "";
-+ struct ifreq ifr;
-+ /* need to look up interface name give index */
-+ if (a->can_ifindex) {
-+ ifr.ifr_ifindex = a->can_ifindex;
-+ if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)
-+ ifname = ifr.ifr_name;
-+ }
-+ return Py_BuildValue("s", ifname);
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- switch (proto) {
-@@ -1280,6 +1300,28 @@ getsockaddrarg(PySocketSockObject *s, Py
- }
- #endif
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ struct sockaddr_can* addr;
-+ struct ifreq ifr;
-+ char *interfaceName;
-+ addr = (struct sockaddr_can*)addr_ret;
-+ if (!PyArg_Parse(args, "s", &interfaceName))
-+ return 0;
-+ strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
-+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
-+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
-+ s->errorhandler();
-+ return 0;
-+ }
-+ addr->can_family = AF_CAN;
-+ addr->can_ifindex = ifr.ifr_ifindex;
-+ *len_ret = sizeof *addr;
-+ return 1;
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- {
-@@ -1516,6 +1558,14 @@ getsockaddrlen(PySocketSockObject *s, so
- }
- #endif
-
-+#ifdef ENABLE_CAN
-+ case AF_CAN:
-+ {
-+ *len_ret = sizeof (struct sockaddr_can);
-+ return 1;
-+ }
-+#endif
-+
- #ifdef USE_BLUETOOTH
- case AF_BLUETOOTH:
- {
-@@ -4379,6 +4429,10 @@ PyInit__socket(void)
- PyModule_AddIntConstant(m, "AF_LLC", AF_LLC);
- #endif
-
-+#ifdef ENABLE_CAN
-+ PyModule_AddIntConstant(m, "AF_CAN", AF_CAN);
-+#endif
-+
- #ifdef USE_BLUETOOTH
- PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH);
- PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
-@@ -4710,6 +4764,41 @@ PyInit__socket(void)
- PyModule_AddIntConstant(m, "IPPROTO_MAX", IPPROTO_MAX);
- #endif
-
-+#ifdef CAN_RAW
-+ PyModule_AddIntConstant(m, "CAN_RAW", CAN_RAW);
-+#endif
-+#ifdef CAN_BCM
-+ PyModule_AddIntConstant(m, "CAN_BCM", CAN_BCM);
-+#endif
-+#ifdef CAN_TP16
-+ PyModule_AddIntConstant(m, "CAN_TP16", CAN_TP16);
-+#endif
-+#ifdef CAN_TP20
-+ PyModule_AddIntConstant(m, "CAN_TP20", CAN_TP20);
-+#endif
-+#ifdef CAN_MCNET
-+ PyModule_AddIntConstant(m, "CAN_MCNET", CAN_MCNET);
-+#endif
-+#ifdef CAN_ISOTP
-+ PyModule_AddIntConstant(m, "CAN_ISOTP", CAN_ISOTP);
-+#endif
-+#ifdef CAN_NPROTO
-+ PyModule_AddIntConstant(m, "CAN_NPROTO", CAN_NPROTO);
-+#endif
-+
-+#ifdef SOL_CAN_BASE
-+ PyModule_AddIntConstant(m, "SOL_CAN_BASE", SOL_CAN_BASE);
-+#endif
-+#ifdef SOL_CAN_RAW
-+ PyModule_AddIntConstant(m, "SOL_CAN_RAW", SOL_CAN_RAW);
-+#endif
-+#ifdef ENABLE_CAN
-+ PyModule_AddIntConstant(m, "CAN_RAW_FILTER", CAN_RAW_FILTER);
-+ PyModule_AddIntConstant(m, "CAN_RAW_ERR_FILTER", CAN_RAW_ERR_FILTER);
-+ PyModule_AddIntConstant(m, "CAN_RAW_LOOPBACK", CAN_RAW_LOOPBACK);
-+ PyModule_AddIntConstant(m, "CAN_RAW_RECV_OWN_MSGS", CAN_RAW_RECV_OWN_MSGS);
-+#endif
-+
- /* Some port configuration */
- #ifdef IPPORT_RESERVED
- PyModule_AddIntConstant(m, "IPPORT_RESERVED", IPPORT_RESERVED);
-Index: b/Modules/socketmodule.h
-===================================================================
---- a/Modules/socketmodule.h
-+++ b/Modules/socketmodule.h
-@@ -55,6 +55,14 @@ typedef int socklen_t;
- #include <bluetooth/hci.h>
- #endif
-
-+#define AF_CAN 29
-+#define PF_CAN AF_CAN
-+
-+#ifdef HAVE_LINUX_CAN_H
-+#define ENABLE_CAN 1
-+#include <linux/can.h>
-+#endif
-+
- #ifdef HAVE_BLUETOOTH_H
- #include <bluetooth.h>
- #endif
-@@ -106,6 +114,9 @@ typedef union sock_addr {
- struct sockaddr_in6 in6;
- struct sockaddr_storage storage;
- #endif
-+#ifdef ENABLE_CAN
-+ struct sockaddr_can can;
-+#endif
- #ifdef HAVE_BLUETOOTH_BLUETOOTH_H
- struct sockaddr_l2 bt_l2;
- struct sockaddr_rc bt_rc;
-Index: b/configure.in
-===================================================================
---- a/configure.in
-+++ b/configure.in
-@@ -1296,6 +1296,19 @@ AC_CHECK_HEADERS(linux/netlink.h,,,[
- #endif
- ])
-
-+AC_CHECK_HEADERS(linux/can.h,[],[],[#include <sys/socket.h>])
-+# check for AF_CAN
-+AC_TRY_COMPILE(
-+ [[#include <sys/socket.h>
-+ int domain = AF_CAN;]],
-+ [[socket(domain, 0, 0);]],
-+ [],
-+ [
-+ AC_DEFINE(AF_CAN, 29, [Define AF_CAN if not defined by sys/socket.h])
-+ AC_DEFINE(PF_CAN, 29, [Define PF_CAN if not defined by sys/socket.h])
-+ ]
-+)
-+
- # checks for typedefs
- was_it_defined=no
- AC_MSG_CHECKING(for clock_t in time.h)
diff --git a/patches/Python-3.1.2/0010-use-PGEN_FOR_BUILD.patch b/patches/Python-3.1.2/0010-use-PGEN_FOR_BUILD.patch
deleted file mode 100644
index 51ea605b6..000000000
--- a/patches/Python-3.1.2/0010-use-PGEN_FOR_BUILD.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From ea4ae1db79bf21899b70f10cd892077725f2f804 Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Tue, 28 Apr 2009 14:05:30 +0200
-Subject: [PATCH] use PGEN_FOR_BUILD
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Makefile.pre.in | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-Index: b/Makefile.pre.in
-===================================================================
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -217,6 +217,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
- ##########################################################################
- # Parser
- PGEN= Parser/pgen$(EXE)
-+PGEN_FOR_BUILD= $(PGEN)
-
- POBJS= \
- Parser/acceler.o \
-@@ -540,9 +541,9 @@ Modules/python.o: $(srcdir)/Modules/pyth
-
- $(IO_OBJS): $(IO_H)
-
--$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-+$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT)
- -@$(INSTALL) -d Include
-- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-+ -$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-
- $(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/patches/Python-3.1.2/0021-fix-parallel-building.patch b/patches/Python-3.1.2/0021-fix-parallel-building.patch
deleted file mode 100644
index 924352785..000000000
--- a/patches/Python-3.1.2/0021-fix-parallel-building.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Wed, 11 Aug 2010 10:44:06 +0200
-Subject: [PATCH] fix parallel building
-
-Producing two target with on command results in a race condition:
-Both targets are requested, the command is executed twice, and the target
-are overwritten randomly.
-Solution: Run the command for on target and let the second depend on it.
-Then touch the second to make sure it's newer.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- Makefile.pre.in | 5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 8e49d84..aced68e 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -546,7 +546,10 @@ Modules/python.o: $(srcdir)/Modules/python.c
-
- $(IO_OBJS): $(IO_H)
-
--$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT)
-+$(GRAMMAR_H): $(GRAMMAR_C)
-+ @touch $@
-+
-+$(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT)
- -@$(INSTALL) -d Include
- -$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-
---
-1.7.1
-
diff --git a/patches/Python-3.1.2/0022-python-don-t-call-cross-python.patch b/patches/Python-3.1.2/0022-python-don-t-call-cross-python.patch
deleted file mode 100644
index fba6ea36b..000000000
--- a/patches/Python-3.1.2/0022-python-don-t-call-cross-python.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Thu, 21 Jul 2011 12:29:58 +0200
-Subject: [PATCH] python: don't call cross python
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- Makefile.pre.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 8b6a6b4..40f64e1 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -918,7 +918,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
- $(srcdir)/Lib/$(PLATDIR):
- mkdir $(srcdir)/Lib/$(PLATDIR)
- cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
-- export PATH; PATH="`pwd`:$$PATH"; \
-+ export PATH; \
- export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
- export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
- export EXE; EXE="$(BUILDEXE)"; \
diff --git a/patches/Python-3.1.2/series b/patches/Python-3.1.2/series
deleted file mode 100644
index 1f967d016..000000000
--- a/patches/Python-3.1.2/series
+++ /dev/null
@@ -1,22 +0,0 @@
-0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
-# 0002--configure.in-chflags.patch ## upstream
-# 0003--configure.in-lchflags.patch ## upstream
-0004--configure.in-printf-format-zd.patch
-0005-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
-0006-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
-0007-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
-0008-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch
-0009-fix-silent-flag.patch
-0010-use-PGEN_FOR_BUILD.patch
-0011-introduce-and-use-PYTHON_FOR_BUILD.patch
-0012-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch
-0013-setup.py-don-t-leak-host-path-into-cross-compilatio.patch
-0014-setup.py-skip-import-check-while-cross-compiling.patch
-0015-add-cross-compilation-support.patch
-0016-provide-wrapper-for-cross-python.patch
-0017-fix-for-new-autoconf.diff
-0018-dont-add-rpaths.diff
-0019-add-cache-for-sem-getvalue.diff
-0020-assume-non-buggy-getaddrinfo-when-cross-compiling.patch
-0021-fix-parallel-building.patch
-0022-python-don-t-call-cross-python.patch
diff --git a/patches/Python-3.1.4/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch b/patches/Python-3.1.4/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
new file mode 100644
index 000000000..0b23c2f99
--- /dev/null
+++ b/patches/Python-3.1.4/0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
@@ -0,0 +1,224 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 5 May 2009 15:17:20 +0200
+Subject: [PATCH] Add support for socketcan to the python socket module
+
+This patch add support for the protocol family AF_CAN. It contains all the
+necessary code to use the python socket module for socketcan.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Lib/plat-linux2/IN.py | 2 +
+ Modules/socketmodule.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
+ Modules/socketmodule.h | 11 ++++++
+ configure.in | 13 +++++++
+ 4 files changed, 115 insertions(+), 0 deletions(-)
+
+diff --git a/Lib/plat-linux2/IN.py b/Lib/plat-linux2/IN.py
+index d7d3002..2e776e4 100644
+--- a/Lib/plat-linux2/IN.py
++++ b/Lib/plat-linux2/IN.py
+@@ -384,6 +384,7 @@ PF_SNA = 22
+ PF_IRDA = 23
+ PF_PPPOX = 24
+ PF_WANPIPE = 25
++PF_CAN = 29
+ PF_BLUETOOTH = 31
+ PF_MAX = 32
+ AF_UNSPEC = PF_UNSPEC
+@@ -414,6 +415,7 @@ AF_SNA = PF_SNA
+ AF_IRDA = PF_IRDA
+ AF_PPPOX = PF_PPPOX
+ AF_WANPIPE = PF_WANPIPE
++AF_CAN = PF_CAN
+ AF_BLUETOOTH = PF_BLUETOOTH
+ AF_MAX = PF_MAX
+ SOL_RAW = 255
+diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
+index 5e911e0..cdf095a 100644
+--- a/Modules/socketmodule.c
++++ b/Modules/socketmodule.c
+@@ -419,6 +419,10 @@ dup_socket(SOCKET handle)
+
+ #define SAS2SA(x) ((struct sockaddr *)(x))
+
++#ifdef ENABLE_CAN
++#include <linux/can/raw.h>
++#endif
++
+ /*
+ * Constants for getnameinfo()
+ */
+@@ -1006,6 +1010,22 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
+ }
+ #endif
+
++#ifdef ENABLE_CAN
++ case AF_CAN:
++ {
++ struct sockaddr_can *a = (struct sockaddr_can *)addr;
++ char *ifname = "";
++ struct ifreq ifr;
++ /* need to look up interface name give index */
++ if (a->can_ifindex) {
++ ifr.ifr_ifindex = a->can_ifindex;
++ if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)
++ ifname = ifr.ifr_name;
++ }
++ return Py_BuildValue("s", ifname);
++ }
++#endif
++
+ #ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ switch (proto) {
+@@ -1285,6 +1305,28 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ }
+ #endif
+
++#ifdef ENABLE_CAN
++ case AF_CAN:
++ {
++ struct sockaddr_can* addr;
++ struct ifreq ifr;
++ char *interfaceName;
++ addr = (struct sockaddr_can*)addr_ret;
++ if (!PyArg_Parse(args, "s", &interfaceName))
++ return 0;
++ strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
++ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
++ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
++ s->errorhandler();
++ return 0;
++ }
++ addr->can_family = AF_CAN;
++ addr->can_ifindex = ifr.ifr_ifindex;
++ *len_ret = sizeof *addr;
++ return 1;
++ }
++#endif
++
+ #ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ {
+@@ -1535,6 +1577,14 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
+ }
+ #endif
+
++#ifdef ENABLE_CAN
++ case AF_CAN:
++ {
++ *len_ret = sizeof (struct sockaddr_can);
++ return 1;
++ }
++#endif
++
+ #ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ {
+@@ -4425,6 +4475,10 @@ PyInit__socket(void)
+ PyModule_AddIntConstant(m, "AF_LLC", AF_LLC);
+ #endif
+
++#ifdef ENABLE_CAN
++ PyModule_AddIntConstant(m, "AF_CAN", AF_CAN);
++#endif
++
+ #ifdef USE_BLUETOOTH
+ PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH);
+ PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
+@@ -4776,6 +4830,41 @@ PyInit__socket(void)
+ PyModule_AddIntConstant(m, "IPPROTO_MAX", IPPROTO_MAX);
+ #endif
+
++#ifdef CAN_RAW
++ PyModule_AddIntConstant(m, "CAN_RAW", CAN_RAW);
++#endif
++#ifdef CAN_BCM
++ PyModule_AddIntConstant(m, "CAN_BCM", CAN_BCM);
++#endif
++#ifdef CAN_TP16
++ PyModule_AddIntConstant(m, "CAN_TP16", CAN_TP16);
++#endif
++#ifdef CAN_TP20
++ PyModule_AddIntConstant(m, "CAN_TP20", CAN_TP20);
++#endif
++#ifdef CAN_MCNET
++ PyModule_AddIntConstant(m, "CAN_MCNET", CAN_MCNET);
++#endif
++#ifdef CAN_ISOTP
++ PyModule_AddIntConstant(m, "CAN_ISOTP", CAN_ISOTP);
++#endif
++#ifdef CAN_NPROTO
++ PyModule_AddIntConstant(m, "CAN_NPROTO", CAN_NPROTO);
++#endif
++
++#ifdef SOL_CAN_BASE
++ PyModule_AddIntConstant(m, "SOL_CAN_BASE", SOL_CAN_BASE);
++#endif
++#ifdef SOL_CAN_RAW
++ PyModule_AddIntConstant(m, "SOL_CAN_RAW", SOL_CAN_RAW);
++#endif
++#ifdef ENABLE_CAN
++ PyModule_AddIntConstant(m, "CAN_RAW_FILTER", CAN_RAW_FILTER);
++ PyModule_AddIntConstant(m, "CAN_RAW_ERR_FILTER", CAN_RAW_ERR_FILTER);
++ PyModule_AddIntConstant(m, "CAN_RAW_LOOPBACK", CAN_RAW_LOOPBACK);
++ PyModule_AddIntConstant(m, "CAN_RAW_RECV_OWN_MSGS", CAN_RAW_RECV_OWN_MSGS);
++#endif
++
+ /* Some port configuration */
+ #ifdef IPPORT_RESERVED
+ PyModule_AddIntConstant(m, "IPPORT_RESERVED", IPPORT_RESERVED);
+diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
+index 4f426f5..a274121 100644
+--- a/Modules/socketmodule.h
++++ b/Modules/socketmodule.h
+@@ -55,6 +55,14 @@ typedef int socklen_t;
+ #include <bluetooth/hci.h>
+ #endif
+
++#define AF_CAN 29
++#define PF_CAN AF_CAN
++
++#ifdef HAVE_LINUX_CAN_H
++#define ENABLE_CAN 1
++#include <linux/can.h>
++#endif
++
+ #ifdef HAVE_BLUETOOTH_H
+ #include <bluetooth.h>
+ #endif
+@@ -114,6 +122,9 @@ typedef union sock_addr {
+ struct sockaddr_in6 in6;
+ struct sockaddr_storage storage;
+ #endif
++#ifdef ENABLE_CAN
++ struct sockaddr_can can;
++#endif
+ #ifdef HAVE_BLUETOOTH_BLUETOOTH_H
+ struct sockaddr_l2 bt_l2;
+ struct sockaddr_rc bt_rc;
+diff --git a/configure.in b/configure.in
+index 9b7a5a7..201fecf 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1349,6 +1349,19 @@ AC_CHECK_HEADERS(linux/netlink.h,,,[
+ #endif
+ ])
+
++AC_CHECK_HEADERS(linux/can.h,[],[],[#include <sys/socket.h>])
++# check for AF_CAN
++AC_TRY_COMPILE(
++ [[#include <sys/socket.h>
++ int domain = AF_CAN;]],
++ [[socket(domain, 0, 0);]],
++ [],
++ [
++ AC_DEFINE(AF_CAN, 29, [Define AF_CAN if not defined by sys/socket.h])
++ AC_DEFINE(PF_CAN, 29, [Define PF_CAN if not defined by sys/socket.h])
++ ]
++)
++
+ # checks for typedefs
+ was_it_defined=no
+ AC_MSG_CHECKING(for clock_t in time.h)
diff --git a/patches/Python-3.1.2/0004--configure.in-printf-format-zd.patch b/patches/Python-3.1.4/0002-printf-format-zd.patch
index 645f1d76e..bd2eacdca 100644
--- a/patches/Python-3.1.2/0004--configure.in-printf-format-zd.patch
+++ b/patches/Python-3.1.4/0002-printf-format-zd.patch
@@ -1,18 +1,17 @@
-From 44a7b5cd5bca0d11b785d917a842d6436f6ad19f Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Thu, 23 Apr 2009 08:49:08 +0200
-Subject: [PATCH] [configure.in] printf format %zd
+Subject: [PATCH] printf format %zd
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
configure.in | 23 +++++++++++++++++++----
- 1 file changed, 19 insertions(+), 4 deletions(-)
+ 1 files changed, 19 insertions(+), 4 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 201fecf..4fd2830 100644
--- a/configure.in
+++ b/configure.in
-@@ -3955,7 +3955,8 @@ else
+@@ -4038,7 +4038,8 @@ else
fi
AC_MSG_CHECKING(for %zd printf() format support)
@@ -22,7 +21,7 @@ Index: b/configure.in
#include <stddef.h>
#include <string.h>
-@@ -3989,9 +3990,23 @@ int main()
+@@ -4072,9 +4073,23 @@ int main()
return 0;
}],
diff --git a/patches/Python-3.1.2/0005-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch b/patches/Python-3.1.4/0003-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
index dfb0b0142..e9942b918 100644
--- a/patches/Python-3.1.2/0005-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
+++ b/patches/Python-3.1.4/0003-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
@@ -1,4 +1,3 @@
-From b03b879f2f107c3f0e55720b31fc87fb02ec2884 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 24 Apr 2009 18:35:19 +0200
Subject: [PATCH] use AC_COMPILE_IFELSE rather than AC_TRY_RUN
@@ -13,17 +12,16 @@ scenario.
This patch uses AC_COMPILE_IFELSE for these tests:
"--enable-profiling, enable C-level code profiling"
-"whether $CC accepts -fno-strict-aliasing"
"whether $CC accepts -OPT:Olimit=0"
"whether $CC accepts -Olimit 1500"
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
- configure.in | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
+ configure.in | 9 +++------
+ 1 files changed, 3 insertions(+), 6 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 4fd2830..3fb4f38 100644
--- a/configure.in
+++ b/configure.in
@@ -665,9 +665,8 @@ AC_ARG_ENABLE(profiling,
@@ -37,18 +35,7 @@ Index: b/configure.in
ac_enable_profiling="no")
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_enable_profiling)
-@@ -884,9 +883,8 @@ yes)
- AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
- ac_save_cc="$CC"
- CC="$CC -fno-strict-aliasing"
-- AC_TRY_RUN([int main() { return 0; }],
-+ AC_COMPILE_IFELSE([int main() { return 0; }],
- ac_cv_no_strict_aliasing_ok=yes,
-- ac_cv_no_strict_aliasing_ok=no,
- ac_cv_no_strict_aliasing_ok=no)
- CC="$ac_save_cc"
- AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
-@@ -1039,9 +1037,8 @@ AC_MSG_CHECKING(whether $CC accepts -OPT
+@@ -1092,9 +1091,8 @@ AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
AC_CACHE_VAL(ac_cv_opt_olimit_ok,
[ac_save_cc="$CC"
CC="$CC -OPT:Olimit=0"
@@ -59,7 +46,7 @@ Index: b/configure.in
ac_cv_opt_olimit_ok=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_opt_olimit_ok)
-@@ -1061,9 +1058,8 @@ else
+@@ -1114,9 +1112,8 @@ else
AC_CACHE_VAL(ac_cv_olimit_ok,
[ac_save_cc="$CC"
CC="$CC -Olimit 1500"
diff --git a/patches/Python-3.1.2/0006-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch b/patches/Python-3.1.4/0004-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
index b98bce9e7..459204ef7 100644
--- a/patches/Python-3.1.2/0006-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
+++ b/patches/Python-3.1.4/0004-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
@@ -1,7 +1,7 @@
-From ba932c009e8fc45e23efe1dfbc0f179c40af6923 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 24 Apr 2009 18:44:11 +0200
-Subject: [PATCH] use AC_CHECK_SIZEOF rather than AC_TRY_COMPILE for long long detection
+Subject: [PATCH] use AC_CHECK_SIZEOF rather than AC_TRY_COMPILE for long long
+ detection
AC_CHECK_SIZEOF does first detect if the type is available and detects
its size. Use it, rather than hand crafted function with AC_TRY_COMPILE.
@@ -9,13 +9,13 @@ its size. Use it, rather than hand crafted function with AC_TRY_COMPILE.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
configure.in | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
+ 1 files changed, 3 insertions(+), 9 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 3fb4f38..905f323 100644
--- a/configure.in
+++ b/configure.in
-@@ -1398,15 +1398,9 @@ AC_CHECK_SIZEOF(fpos_t, 4)
+@@ -1465,15 +1465,9 @@ AC_CHECK_SIZEOF(fpos_t, 4)
AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(pid_t, 4)
diff --git a/patches/Python-3.1.2/0007-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch b/patches/Python-3.1.4/0005-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
index f9c76893b..8b4603a29 100644
--- a/patches/Python-3.1.2/0007-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
+++ b/patches/Python-3.1.4/0005-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
@@ -1,4 +1,3 @@
-From e8684e66c22ce7463c86fb2c6b48451988769721 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 24 Apr 2009 18:47:19 +0200
Subject: [PATCH] use AC_TYPE_LONG_DOUBLE to detect long double support
@@ -9,13 +8,13 @@ test to detect long double support.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
configure.in | 12 ++----------
- 1 file changed, 2 insertions(+), 10 deletions(-)
+ 1 files changed, 2 insertions(+), 10 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 905f323..5894ffe 100644
--- a/configure.in
+++ b/configure.in
-@@ -1403,16 +1403,8 @@ if test "$ac_cv_type_long_long" = "yes"
+@@ -1470,16 +1470,8 @@ if test "$ac_cv_type_long_long" = "yes" ; then
AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
fi
diff --git a/patches/Python-3.1.2/0008-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch b/patches/Python-3.1.4/0006-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch
index 7afd2cd49..19bd82d2b 100644
--- a/patches/Python-3.1.2/0008-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch
+++ b/patches/Python-3.1.4/0006-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch
@@ -1,7 +1,7 @@
-From 648a7538c36f67696d88ee99ddccc2bc78a1ef75 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 24 Apr 2009 19:10:14 +0200
-Subject: [PATCH] use AC_CHECK_SIZEOF rather than handcrafted test with AC_TRY_RUN
+Subject: [PATCH] use AC_CHECK_SIZEOF rather than handcrafted test with
+ AC_TRY_RUN
AC_TRY_RUN doesn't work in the cross compilation scenario. Recent
versions of autoconf support AC_CHECK_SIZEOF even while cross compiling.
@@ -14,13 +14,13 @@ This patch converts the following tests to AC_CHECK_SIZEOF:
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
configure.in | 58 ++++------------------------------------------------------
- 1 file changed, 4 insertions(+), 54 deletions(-)
+ 1 files changed, 4 insertions(+), 54 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 5894ffe..315c435 100644
--- a/configure.in
+++ b/configure.in
-@@ -1425,23 +1425,9 @@ AC_CHECK_TYPES(uintptr_t,
+@@ -1495,23 +1495,9 @@ AC_CHECK_TYPES(uintptr_t,
#endif])
@@ -45,7 +45,7 @@ Index: b/configure.in
AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
[The number of bytes in an off_t.])
-@@ -1464,22 +1450,9 @@ else
+@@ -1534,22 +1520,9 @@ else
fi
# AC_CHECK_SIZEOF() doesn't include <time.h>.
@@ -69,7 +69,7 @@ Index: b/configure.in
AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
[The number of bytes in a time_t.])
-@@ -1493,32 +1466,9 @@ then CC="$CC -Kthread"
+@@ -1563,32 +1536,9 @@ then CC="$CC -Kthread"
elif test "$ac_cv_pthread" = "yes"
then CC="$CC -pthread"
fi
diff --git a/patches/Python-3.1.2/0009-fix-silent-flag.patch b/patches/Python-3.1.4/0007-fix-silent-flag.patch
index 1c1087f4b..7bdd8dcfd 100644
--- a/patches/Python-3.1.2/0009-fix-silent-flag.patch
+++ b/patches/Python-3.1.4/0007-fix-silent-flag.patch
@@ -1,4 +1,3 @@
-From 1833c8a1a14a9fbf99eac971532a6153cde6ba2f Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 28 Apr 2009 13:08:35 +0200
Subject: [PATCH] fix silent flag
@@ -10,20 +9,20 @@ is detected in $MAKEFLAGS, "*s*" is not sufficient.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Makefile.pre.in | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ 1 files changed, 2 insertions(+), 2 deletions(-)
-Index: b/Makefile.pre.in
-===================================================================
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index ed1dc33..e96cc25 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -416,8 +416,8 @@ platform: $(BUILDPYTHON)
+@@ -419,8 +419,8 @@ platform: $(BUILDPYTHON)
# Build the shared modules
sharedmods: $(BUILDPYTHON)
- @case $$MAKEFLAGS in \
-- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+ @case "$(MAKEFLAGS)" in \
-+ s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
++ s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
esac
diff --git a/patches/Python-3.1.4/0008-use-PGEN_FOR_BUILD.patch b/patches/Python-3.1.4/0008-use-PGEN_FOR_BUILD.patch
new file mode 100644
index 000000000..8685fcc69
--- /dev/null
+++ b/patches/Python-3.1.4/0008-use-PGEN_FOR_BUILD.patch
@@ -0,0 +1,33 @@
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Tue, 28 Apr 2009 14:05:30 +0200
+Subject: [PATCH] use PGEN_FOR_BUILD
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Makefile.pre.in | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index e96cc25..503d34d 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -220,6 +220,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++PGEN_FOR_BUILD= $(PGEN)
+
+ POBJS= \
+ Parser/acceler.o \
+@@ -544,9 +545,9 @@ $(IO_OBJS): $(IO_H)
+
+ # Use a stamp file to prevent make -j invoking pgen twice
+ $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
+-Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
++Parser/pgen.stamp: $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT)
+ -@$(INSTALL) -d Include
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -touch Parser/pgen.stamp
+
+ $(PGEN): $(PGENOBJS)
diff --git a/patches/Python-3.1.2/0011-introduce-and-use-PYTHON_FOR_BUILD.patch b/patches/Python-3.1.4/0009-introduce-and-use-PYTHON_FOR_BUILD.patch
index 9c5c1fc07..de30fcae5 100644
--- a/patches/Python-3.1.2/0011-introduce-and-use-PYTHON_FOR_BUILD.patch
+++ b/patches/Python-3.1.4/0009-introduce-and-use-PYTHON_FOR_BUILD.patch
@@ -1,4 +1,3 @@
-From f091c104cb02b0724e7ea13fb5062a788c37091c Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 28 Apr 2009 14:22:01 +0200
Subject: [PATCH] introduce and use PYTHON_FOR_BUILD
@@ -14,11 +13,11 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
configure.in | 16 ++++++++++++++++
2 files changed, 36 insertions(+), 19 deletions(-)
-Index: b/Makefile.pre.in
-===================================================================
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 503d34d..c438baf 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -176,7 +176,8 @@ LIBOBJDIR= Python/
+@@ -179,7 +179,8 @@ LIBOBJDIR= Python/
LIBOBJS= @LIBOBJS@
PYTHON= python$(EXE)
@@ -28,7 +27,7 @@ Index: b/Makefile.pre.in
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
-@@ -394,7 +395,7 @@ build_all_generate_profile:
+@@ -397,7 +398,7 @@ build_all_generate_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
run_profile_task:
@@ -37,46 +36,46 @@ Index: b/Makefile.pre.in
build_all_use_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
-@@ -411,15 +412,15 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
+@@ -414,15 +415,15 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-platform: $(BUILDPYTHON)
- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
-+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
+platform: $(PYTHON_FOR_BUILD)
++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
# Build the shared modules
-sharedmods: $(BUILDPYTHON)
+sharedmods: $(BUILDPYTHON) $(PYTHON_FOR_BUILD)
@case "$(MAKEFLAGS)" in \
-- s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
-- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
-+ s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py -q build;; \
-+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py build;; \
+- s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
++ s|*\ s|s\ *|*\ s\ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py -q build;; \
++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py build;; \
esac
# Build static library
-@@ -706,7 +707,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
+@@ -711,7 +712,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
TESTOPTS= -l $(EXTRATESTOPTS)
TESTPROG= $(srcdir)/Lib/test/regrtest.py
--TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -bb
-+TESTPYTHON= $(RUNSHARED) $(PYTHON_FOR_BUILD) -E -bb
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -bb $(TESTPYTHONOPTS)
++TESTPYTHON= $(RUNSHARED) $(PYTHON_FOR_BUILD) -E -bb $(TESTPYTHONOPTS)
test: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
-@@ -729,7 +730,7 @@ testuniversal: all platform
+@@ -734,7 +735,7 @@ testuniversal: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
-- $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) $(TESTOPTS) -uall
-+ $(RUNSHARED) /usr/libexec/oah/translate $(PYTHON_FOR_BUILD) -E $(TESTPROG) $(TESTOPTS) -uall
+ -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
+- $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) -uall $(TESTOPTS)
++ $(RUNSHARED) /usr/libexec/oah/translate $(PYTHON_FOR_BUILD) -E $(TESTPROG) -uall $(TESTOPTS)
# Like testall, but with a single pass only
-@@ -910,25 +911,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+@@ -916,25 +917,25 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
@@ -107,16 +106,16 @@ Index: b/Makefile.pre.in
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
-@@ -1020,7 +1021,7 @@ libainstall: all
+@@ -1026,7 +1027,7 @@ libainstall: all
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
- sharedinstall:
+ sharedinstall: sharedmods
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
-@@ -1058,7 +1059,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+@@ -1064,7 +1065,7 @@ frameworkinstallstructure: $(LDLIBRARY)
fi; \
done
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
@@ -125,7 +124,7 @@ Index: b/Makefile.pre.in
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
-@@ -1101,7 +1102,7 @@ frameworkinstallextras:
+@@ -1107,7 +1108,7 @@ frameworkinstallextras:
# This installs a few of the useful scripts in Tools/scripts
scriptsinstall:
SRCDIR=$(srcdir) $(RUNSHARED) \
@@ -133,8 +132,8 @@ Index: b/Makefile.pre.in
+ $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
- --root=/$(DESTDIR)
-@@ -1123,7 +1124,7 @@ config.status: $(srcdir)/configure
+ --root=$(DESTDIR)/
+@@ -1129,7 +1130,7 @@ config.status: $(srcdir)/configure
# Run reindent on the library
reindent:
@@ -143,7 +142,7 @@ Index: b/Makefile.pre.in
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
-@@ -1239,7 +1240,7 @@ funny:
+@@ -1246,7 +1247,7 @@ funny:
# Perform some verification checks on any modified files.
patchcheck:
@@ -152,11 +151,11 @@ Index: b/Makefile.pre.in
# Dependencies
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 315c435..2233584 100644
--- a/configure.in
+++ b/configure.in
-@@ -4011,6 +4011,22 @@ for dir in $SRCDIRS; do
+@@ -4095,6 +4095,22 @@ for dir in $SRCDIRS; do
done
AC_MSG_RESULT(done)
@@ -178,4 +177,4 @@ Index: b/configure.in
+
# generate output files
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
- AC_OUTPUT
+ AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
diff --git a/patches/Python-3.1.2/0012-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch b/patches/Python-3.1.4/0010-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch
index c4902120b..4c1ab5416 100644
--- a/patches/Python-3.1.2/0012-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch
+++ b/patches/Python-3.1.4/0010-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch
@@ -1,9 +1,8 @@
-From 35b2f370694bb610118064ef0a6cc5a30fad4b70 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 28 Apr 2009 18:05:33 +0200
Subject: [PATCH] distutils: introduce and use EXECUTABLE_DIRNAME
-os.path.abspath(sys.executable) is used several times in
+os.path.realpath(sys.executable) is used several times in
distutils.sysconfig. This patch introduces the variable
EXECUTABLE_DIRNAME which holds this information.
@@ -11,66 +10,50 @@ This makes it easier to overwrite this value in the cross compilation
scenario. (see later patch)
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-#@@ -73,13 +74,12 @@ def get_python_inc(plat_specific=0, prefix=None):
-# prefix = plat_specific and EXEC_PREFIX or PREFIX
-# if os.name == "posix":
-# if python_build:
-#- base = os.path.dirname(os.path.abspath(sys.executable))
-# if plat_specific:
-#- inc_dir = base
-#+ inc_dir = EXECUTABLE_DIRNAME
-# else:
-#- inc_dir = os.path.join(base, "Include")
-#+ inc_dir = os.path.join(EXECUTABLE_DIRNAME, "Include")
-# if not os.path.exists(inc_dir):
-#- inc_dir = os.path.join(os.path.dirname(base), "Include")
-#+ inc_dir = os.path.join(os.path.dirname(EXECUTABLE_DIRNAME), "Include")
-# return inc_dir
-# return os.path.join(prefix, "include", "python" + get_python_version())
-# elif os.name == "nt":
---
- Lib/distutils/sysconfig.py | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ Lib/distutils/sysconfig.py | 11 +++++------
+ 1 files changed, 5 insertions(+), 6 deletions(-)
-Index: b/Lib/distutils/sysconfig.py
-===================================================================
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 9842d26..3c970a3 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -21,11 +21,12 @@ from .errors import DistutilsPlatformErr
+@@ -21,11 +21,12 @@ from .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)
-+EXECUTABLE_DIRNAME = os.path.dirname(os.path.abspath(sys.executable))
++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 = os.path.dirname(os.path.realpath(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
-@@ -77,9 +78,8 @@ def get_python_inc(plat_specific=0, pref
+@@ -77,9 +78,8 @@ def get_python_inc(plat_specific=0, prefix=None):
# the build directory may not be the source directory, we
# must use "srcdir" from the makefile to find the "Include"
# directory.
-- base = os.path.dirname(os.path.abspath(sys.executable))
+- base = os.path.dirname(os.path.realpath(sys.executable))
if plat_specific:
- return base
+ return EXECUTABLE_DIRNAME
else:
incdir = os.path.join(get_config_var('srcdir'), 'Include')
return os.path.normpath(incdir)
-@@ -223,7 +223,7 @@ def get_config_h_filename():
+@@ -223,8 +223,7 @@ def get_config_h_filename():
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(os.path.dirname(os.path.realpath(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")
-@@ -520,7 +520,7 @@ def get_config_vars(*args):
+@@ -521,7 +520,7 @@ def get_config_vars(*args):
# testing, for example, we might be running a non-installed python
# from a different directory.
if python_build and os.name == "posix":
diff --git a/patches/Python-3.1.2/0013-setup.py-don-t-leak-host-path-into-cross-compilatio.patch b/patches/Python-3.1.4/0011-setup.py-don-t-leak-host-path-into-cross-compilation.patch
index 628f2affa..b36652abc 100644
--- a/patches/Python-3.1.2/0013-setup.py-don-t-leak-host-path-into-cross-compilatio.patch
+++ b/patches/Python-3.1.4/0011-setup.py-don-t-leak-host-path-into-cross-compilation.patch
@@ -1,34 +1,36 @@
-From 2733013612e513e4756fafd82f33f66f7f7036f3 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 28 Apr 2009 19:07:54 +0200
-Subject: [PATCH] setup.py: don't leak host path into cross compilation environment
+Subject: [PATCH] setup.py: don't leak host path into cross compilation
+ environment
During cross compilation we don't host path (neither include nor library
search patch) to leak into our environment.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
- setup.py | 33 ++++++++++++++++++++++++++-------
- 1 file changed, 26 insertions(+), 7 deletions(-)
+ setup.py | 35 +++++++++++++++++++++++++++--------
+ 1 files changed, 27 insertions(+), 8 deletions(-)
-Index: b/setup.py
-===================================================================
+diff --git a/setup.py b/setup.py
+index 1e15b7a..d0118ae 100644
--- a/setup.py
+++ b/setup.py
-@@ -295,8 +295,10 @@ class PyBuildExt(build_ext):
+@@ -363,9 +363,11 @@ class PyBuildExt(build_ext):
def detect_modules(self):
# Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+- self.add_multiarch_paths()
+
+ if os.environ.get('CROSS_COMPILING') != 'yes':
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ self.add_multiarch_paths()
# Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files.
-@@ -310,6 +312,10 @@ class PyBuildExt(build_ext):
+@@ -379,6 +381,10 @@ class PyBuildExt(build_ext):
('CPPFLAGS', '-I', self.compiler.include_dirs)):
env_val = sysconfig.get_config_var(env_var)
if env_val:
@@ -39,7 +41,7 @@ Index: b/setup.py
# To prevent optparse from raising an exception about any
# options in env_val that it doesn't know about we strip out
# all double dashes and any dashes followed by a character
-@@ -341,11 +347,18 @@ class PyBuildExt(build_ext):
+@@ -415,11 +421,18 @@ 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.
@@ -63,7 +65,7 @@ Index: b/setup.py
exts = []
missing = []
-@@ -697,6 +710,9 @@ class PyBuildExt(build_ext):
+@@ -809,6 +822,9 @@ class PyBuildExt(build_ext):
db_inc_paths.append('/pkg/db-3.%d/include' % x)
db_inc_paths.append('/opt/db-3.%d/include' % x)
@@ -73,7 +75,7 @@ Index: b/setup.py
# Add some common subdirectories for Sleepycat DB to the list,
# based on the standard include directories. This way DB3/4 gets
# picked up when it is installed in a non-standard prefix and
-@@ -815,6 +831,9 @@ class PyBuildExt(build_ext):
+@@ -949,6 +965,9 @@ class PyBuildExt(build_ext):
MIN_SQLITE_VERSION = ".".join([str(x)
for x in MIN_SQLITE_VERSION_NUMBER])
diff --git a/patches/Python-3.1.2/0014-setup.py-skip-import-check-while-cross-compiling.patch b/patches/Python-3.1.4/0012-setup.py-skip-import-check-while-cross-compiling.patch
index 70923297b..94e6595f3 100644
--- a/patches/Python-3.1.2/0014-setup.py-skip-import-check-while-cross-compiling.patch
+++ b/patches/Python-3.1.4/0012-setup.py-skip-import-check-while-cross-compiling.patch
@@ -1,4 +1,3 @@
-From ffb8d658042e698dced9be6fece1bcf3f5b62f68 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue, 28 Apr 2009 19:08:19 +0200
Subject: [PATCH] setup.py: skip import check while cross compiling
@@ -9,13 +8,13 @@ compiled modules into the build python. This patch skips this check.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
setup.py | 4 ++++
- 1 file changed, 4 insertions(+)
+ 1 files changed, 4 insertions(+), 0 deletions(-)
-Index: b/setup.py
-===================================================================
+diff --git a/setup.py b/setup.py
+index d0118ae..d397504 100644
--- a/setup.py
+++ b/setup.py
-@@ -246,6 +246,10 @@ class PyBuildExt(build_ext):
+@@ -292,6 +292,10 @@ class PyBuildExt(build_ext):
self.announce('WARNING: skipping import check for Cygwin-based "%s"'
% ext.name)
return
diff --git a/patches/Python-3.1.2/0015-add-cross-compilation-support.patch b/patches/Python-3.1.4/0013-add-cross-compilation-support.patch
index 33c0f6763..226f1c253 100644
--- a/patches/Python-3.1.2/0015-add-cross-compilation-support.patch
+++ b/patches/Python-3.1.4/0013-add-cross-compilation-support.patch
@@ -1,4 +1,3 @@
-From 430893ea1bad2245f00d44fef62bbfb75db27f96 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 4 May 2009 14:39:18 +0200
Subject: [PATCH] add cross compilation support
@@ -13,8 +12,8 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
setup.py | 6 +++++-
4 files changed, 50 insertions(+), 10 deletions(-)
-Index: b/Lib/distutils/sysconfig.py
-===================================================================
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 3c970a3..c3df55b 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -19,9 +19,16 @@ import sys
@@ -23,7 +22,7 @@ Index: b/Lib/distutils/sysconfig.py
# 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)
- EXECUTABLE_DIRNAME = os.path.dirname(os.path.abspath(sys.executable))
+ EXECUTABLE_DIRNAME = os.path.dirname(os.path.realpath(sys.executable))
+if os.environ.get('CROSS_COMPILING') == 'yes':
+ _sysroot=os.environ.get('_python_sysroot')
+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
@@ -36,11 +35,11 @@ Index: b/Lib/distutils/sysconfig.py
# 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,
-Index: b/Makefile.pre.in
-===================================================================
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index c438baf..e031a37 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -75,6 +75,10 @@ CFLAGSFORSHARED=@CFLAGSFORSHARED@
+@@ -78,6 +78,10 @@ CFLAGSFORSHARED=@CFLAGSFORSHARED@
# C flags used for building the interpreter object files
PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
@@ -51,12 +50,12 @@ Index: b/Makefile.pre.in
# Machine-dependent subdirectories
MACHDEP= @MACHDEP@
-@@ -90,11 +94,11 @@ datarootdir= @datarootdir@
+@@ -93,11 +97,11 @@ datarootdir= @datarootdir@
# Expanded directories
- BINDIR= $(exec_prefix)/bin
--LIBDIR= $(exec_prefix)/lib
-+LIBDIR= $(sysroot)$(exec_prefix)/lib
+ BINDIR= @bindir@
+-LIBDIR= @libdir@
++LIBDIR= $(sysroot)@libdir@
MANDIR= @mandir@
-INCLUDEDIR= @includedir@
-CONFINCLUDEDIR= $(exec_prefix)/include
@@ -67,8 +66,8 @@ Index: b/Makefile.pre.in
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 2233584..394d686 100644
--- a/configure.in
+++ b/configure.in
@@ -21,6 +21,9 @@ if test "$prefix" != "/"; then
@@ -81,7 +80,7 @@ Index: b/configure.in
dnl This is for stuff that absolutely must end up in pyconfig.h.
dnl Please use pyport.h instead, if possible.
AH_TOP([
-@@ -760,9 +763,9 @@ fi
+@@ -764,9 +767,9 @@ fi
AC_MSG_RESULT($LDLIBRARY)
@@ -94,7 +93,7 @@ Index: b/configure.in
# tweak ARFLAGS only if the user didn't set it on the command line
AC_SUBST(ARFLAGS)
-@@ -4027,6 +4030,28 @@ AC_SUBST(PYTHON_FOR_BUILD)
+@@ -4111,6 +4114,28 @@ AC_SUBST(PYTHON_FOR_BUILD)
AC_ARG_VAR(PYTHON_FOR_BUILD,[build system python (default: python)])
@@ -122,12 +121,12 @@ Index: b/configure.in
+
# generate output files
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
- AC_OUTPUT
-Index: b/setup.py
-===================================================================
+ AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
+diff --git a/setup.py b/setup.py
+index d397504..2156621 100644
--- a/setup.py
+++ b/setup.py
-@@ -1494,7 +1494,11 @@ class PyBuildExt(build_ext):
+@@ -1649,7 +1649,11 @@ class PyBuildExt(build_ext):
ffi_configfile):
from distutils.dir_util import mkpath
mkpath(ffi_builddir)
diff --git a/patches/Python-3.1.2/0016-provide-wrapper-for-cross-python.patch b/patches/Python-3.1.4/0014-provide-wrapper-for-cross-python.patch
index 4dbf13264..5bdce5ee7 100644
--- a/patches/Python-3.1.2/0016-provide-wrapper-for-cross-python.patch
+++ b/patches/Python-3.1.4/0014-provide-wrapper-for-cross-python.patch
@@ -1,4 +1,3 @@
-From ff60f7c08cb167d060fd0e34b543550facf846c6 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 4 May 2009 21:45:37 +0200
Subject: [PATCH] provide wrapper for cross-python
@@ -10,24 +9,25 @@ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
configure.in | 2 +-
cross-python-wrapper.in | 13 +++++++++++++
- 2 files changed, 14 insertions(+), 1 deletion(-)
- create mode 100755 cross-python-wrapper.in
+ 2 files changed, 14 insertions(+), 1 deletions(-)
+ create mode 100644 cross-python-wrapper.in
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 394d686..60284d4 100644
--- a/configure.in
+++ b/configure.in
-@@ -4053,7 +4053,7 @@ fi
+@@ -4137,7 +4137,7 @@ fi
# generate output files
-AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc cross-python-wrapper)
+ AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT
- echo "creating Modules/Setup"
-Index: b/cross-python-wrapper.in
-===================================================================
+diff --git a/cross-python-wrapper.in b/cross-python-wrapper.in
+new file mode 100644
+index 0000000..9cfd36f
--- /dev/null
+++ b/cross-python-wrapper.in
@@ -0,0 +1,13 @@
diff --git a/patches/Python-3.1.2/0017-fix-for-new-autoconf.diff b/patches/Python-3.1.4/0015-0017-fix-for-new-autoconf.diff.patch
index 8f40a6404..963dbc0a0 100644
--- a/patches/Python-3.1.2/0017-fix-for-new-autoconf.diff
+++ b/patches/Python-3.1.4/0015-0017-fix-for-new-autoconf.diff.patch
@@ -1,12 +1,16 @@
+From: unknown author <unknown.author@example.com>
+Date: Wed, 3 Aug 2011 17:25:10 +0200
+Subject: [PATCH] 0017-fix-for-new-autoconf.diff
+
---
configure.in | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ 1 files changed, 2 insertions(+), 1 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index 60284d4..eee0809 100644
--- a/configure.in
+++ b/configure.in
-@@ -1401,8 +1401,9 @@ AC_CHECK_SIZEOF(fpos_t, 4)
+@@ -1468,8 +1468,9 @@ AC_CHECK_SIZEOF(fpos_t, 4)
AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(pid_t, 4)
diff --git a/patches/Python-3.1.2/0018-dont-add-rpaths.diff b/patches/Python-3.1.4/0016-0018-dont-add-rpaths.diff.patch
index 6a24bae47..d76ac7063 100644
--- a/patches/Python-3.1.2/0018-dont-add-rpaths.diff
+++ b/patches/Python-3.1.4/0016-0018-dont-add-rpaths.diff.patch
@@ -1,12 +1,16 @@
+From: unknown author <unknown.author@example.com>
+Date: Wed, 3 Aug 2011 17:25:10 +0200
+Subject: [PATCH] 0018-dont-add-rpaths.diff
+
---
setup.py | 2 --
- 1 file changed, 2 deletions(-)
+ 1 files changed, 0 insertions(+), 2 deletions(-)
-Index: b/setup.py
-===================================================================
+diff --git a/setup.py b/setup.py
+index 2156621..036063c 100644
--- a/setup.py
+++ b/setup.py
-@@ -910,7 +910,6 @@ class PyBuildExt(build_ext):
+@@ -1051,7 +1051,6 @@ class PyBuildExt(build_ext):
include_dirs=["Modules/_sqlite",
sqlite_incdir],
library_dirs=sqlite_libdir,
@@ -14,7 +18,7 @@ Index: b/setup.py
extra_link_args=sqlite_extra_link_args,
libraries=["sqlite3",]))
else:
-@@ -972,7 +971,6 @@ class PyBuildExt(build_ext):
+@@ -1113,7 +1112,6 @@ class PyBuildExt(build_ext):
print("building dbm using bdb")
dbmext = Extension('_dbm', ['_dbmmodule.c'],
library_dirs=dblib_dir,
diff --git a/patches/Python-3.1.2/0019-add-cache-for-sem-getvalue.diff b/patches/Python-3.1.4/0017-add-cache-variable-for-sem_getvalue-test.patch
index 9b395bedb..3c43867e2 100644
--- a/patches/Python-3.1.2/0019-add-cache-for-sem-getvalue.diff
+++ b/patches/Python-3.1.4/0017-add-cache-variable-for-sem_getvalue-test.patch
@@ -1,5 +1,6 @@
From: Michael Olbrich <m.olbrich@pengutronix.de>
-Subject: add cache variable for sem_getvalue test
+Date: Wed, 3 Aug 2011 17:25:10 +0200
+Subject: [PATCH] add cache variable for sem_getvalue test
AC_TRY_RUN is used to check for a broken sem_getvalue.
This patch adds a cache variable (ac_cv_broken_sem_getvalue)
@@ -8,13 +9,13 @@ that can be set when cross-compiling.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
configure.in | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
+ 1 files changed, 9 insertions(+), 4 deletions(-)
-Index: b/configure.in
-===================================================================
+diff --git a/configure.in b/configure.in
+index eee0809..415d3ca 100644
--- a/configure.in
+++ b/configure.in
-@@ -3376,7 +3376,8 @@ fi
+@@ -3460,7 +3460,8 @@ fi
# Multiprocessing check for broken sem_getvalue
AC_MSG_CHECKING(for broken sem_getvalue)
@@ -24,7 +25,7 @@ Index: b/configure.in
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
-@@ -3398,10 +3399,14 @@ int main(void){
+@@ -3482,10 +3483,14 @@ int main(void){
return res==-1 ? 1 : 0;
}
]
diff --git a/patches/Python-3.1.2/0020-assume-non-buggy-getaddrinfo-when-cross-compiling.patch b/patches/Python-3.1.4/0018-assume-non-buggy-getaddrinfo-when-cross-compiling.patch
index e76430e5b..e1a50eeaa 100644
--- a/patches/Python-3.1.2/0020-assume-non-buggy-getaddrinfo-when-cross-compiling.patch
+++ b/patches/Python-3.1.4/0018-assume-non-buggy-getaddrinfo-when-cross-compiling.patch
@@ -8,10 +8,10 @@ Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.in b/configure.in
-index 89acf25..34dd048 100644
+index 415d3ca..245cf3b 100644
--- a/configure.in
+++ b/configure.in
-@@ -2909,8 +2909,8 @@ AC_MSG_RESULT(good)
+@@ -2951,8 +2951,8 @@ AC_MSG_RESULT(good)
buggygetaddrinfo=no,
AC_MSG_RESULT(buggy)
buggygetaddrinfo=yes,
@@ -22,6 +22,3 @@ index 89acf25..34dd048 100644
AC_MSG_RESULT(no)
buggygetaddrinfo=yes
])
---
-1.7.1
-
diff --git a/patches/Python-3.1.2/autogen.sh b/patches/Python-3.1.4/autogen.sh
index 903ce7847..903ce7847 100755
--- a/patches/Python-3.1.2/autogen.sh
+++ b/patches/Python-3.1.4/autogen.sh
diff --git a/patches/Python-3.1.4/series b/patches/Python-3.1.4/series
new file mode 100644
index 000000000..98d853646
--- /dev/null
+++ b/patches/Python-3.1.4/series
@@ -0,0 +1,21 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Add-support-for-socketcan-to-the-python-socket-modul.patch
+0002-printf-format-zd.patch
+0003-use-AC_COMPILE_IFELSE-rather-than-AC_TRY_RUN.patch
+0004-use-AC_CHECK_SIZEOF-rather-than-AC_TRY_COMPILE-for-l.patch
+0005-use-AC_TYPE_LONG_DOUBLE-to-detect-long-double-suppor.patch
+0006-use-AC_CHECK_SIZEOF-rather-than-handcrafted-test-wit.patch
+0007-fix-silent-flag.patch
+0008-use-PGEN_FOR_BUILD.patch
+0009-introduce-and-use-PYTHON_FOR_BUILD.patch
+0010-distutils-introduce-and-use-EXECUTABLE_DIRNAME.patch
+0011-setup.py-don-t-leak-host-path-into-cross-compilation.patch
+0012-setup.py-skip-import-check-while-cross-compiling.patch
+0013-add-cross-compilation-support.patch
+0014-provide-wrapper-for-cross-python.patch
+0015-0017-fix-for-new-autoconf.diff.patch
+0016-0018-dont-add-rpaths.diff.patch
+0017-add-cache-variable-for-sem_getvalue-test.patch
+0018-assume-non-buggy-getaddrinfo-when-cross-compiling.patch
+# 0e78d00ad21902e463fd24c04a612ecf - git-ptx-patches magic
diff --git a/rules/python3.make b/rules/python3.make
index c3225f840..3b621c709 100644
--- a/rules/python3.make
+++ b/rules/python3.make
@@ -17,8 +17,8 @@ PACKAGES-$(PTXCONF_PYTHON3) += python3
#
# Paths and names
#
-PYTHON3_VERSION := 3.1.2
-PYTHON3_MD5 := 45350b51b58a46b029fb06c61257e350
+PYTHON3_VERSION := 3.1.4
+PYTHON3_MD5 := 09ed98eace4c403b475846702708675e
PYTHON3_MAJORMINOR := $(basename $(PYTHON3_VERSION))
PYTHON3_SITEPACKAGES := /usr/lib/python$(PYTHON3_MAJORMINOR)/site-packages
PYTHON3 := Python-$(PYTHON3_VERSION)
@@ -46,6 +46,9 @@ PYTHON3_PATH := PATH=$(CROSS_PATH)
PYTHON3_ENV := \
$(CROSS_ENV) \
PYTHON_FOR_BUILD=$(PTXCONF_SYSROOT_HOST)/bin/python$(PYTHON3_MAJORMINOR) \
+ ac_sys_system=Linux \
+ ac_sys_release=2 \
+ MACHDEP=linux2 \
ac_cv_have_chflags=no \
ac_cv_have_lchflags=no \
ac_cv_py_format_size_t=yes \