[oe-commits] Klaus Kurzmann : python-native: build with ctypes

GIT User account git at amethyst.openembedded.net
Sat May 23 22:51:36 UTC 2009


Module: openembedded.git
Branch: shr/import
Commit: a55d4b0ca8b7a01ddcd1150be72b79e0b0ca88a7
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=a55d4b0ca8b7a01ddcd1150be72b79e0b0ca88a7

Author: Klaus Kurzmann <mok at fluxnetz.de>
Date:   Thu May 14 20:00:04 2009 +0200

python-native: build with ctypes

Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>

---

 .../05-enable-ctypes-cross-build.patch             |   28 ++++++++++++++++++++
 recipes/python/python-native_2.6.1.bb              |    2 +
 recipes/python/python.inc                          |    2 +-
 3 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch b/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch
new file mode 100644
index 0000000..874b8be
--- /dev/null
+++ b/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,28 @@
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt at emdete.de>
+
+Index: Python-2.6.1/setup.py
+===================================================================
+--- Python-2.6.1.orig/setup.py
++++ Python-2.6.1/setup.py
+@@ -1656,16 +1656,16 @@ class PyBuildExt(build_ext):
+                                          ffi_configfile):
+                 from distutils.dir_util import mkpath
+                 mkpath(ffi_builddir)
+-                config_args = []
++                config_args = ['--host=%s' % os.environ["HOST_SYS"], ]
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.
+-                cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+-                      % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++                cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++                      % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+ 
+                 res = os.system(cmd)
+                 if res or not os.path.exists(ffi_configfile):
+-                    print "Failed to configure _ctypes module"
++                    print "Failed to configure _ctypes module (ret=%d) or missing conffile=%s" % ( ret, ffi_configfile )
+                     return False
+ 
+             fficonfig = {}
diff --git a/recipes/python/python-native_2.6.1.bb b/recipes/python/python-native_2.6.1.bb
index 3ae4828..b5382ae 100644
--- a/recipes/python/python-native_2.6.1.bb
+++ b/recipes/python/python-native_2.6.1.bb
@@ -1,10 +1,12 @@
 require python.inc
 DEPENDS = "openssl-native bzip2-full-native"
+PR = "${INC_PR}.1"
 
 SRC_URI = "\
   http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
   file://00-fix-bindir-libdir-for-cross.patch;patch=1 \
   file://04-default-is-optimized.patch;patch=1 \
+  file://05-enable-ctypes-cross-build.patch;patch=1 \
   file://10-distutils-fix-swig-parameter.patch;patch=1 \
   file://11-distutils-never-modify-shebang-line.patch;patch=1 \
   file://12-distutils-prefix-is-inside-staging-area.patch;patch=1 \
diff --git a/recipes/python/python.inc b/recipes/python/python.inc
index 1e53e69..390c8c6 100644
--- a/recipes/python/python.inc
+++ b/recipes/python/python.inc
@@ -4,7 +4,7 @@ LICENSE = "PSF"
 SECTION = "devel/python"
 PRIORITY = "optional"
 # bump this on every change in contrib/python/generate-manifest-2.6.py
-PR = "ml2"
+INC_PR = "ml2.1"
 
 DEFAULT_PREFERENCE = "-26"
 





More information about the Openembedded-commits mailing list