交叉编译Python扩展 [英] Cross Compiling Python Extensions

查看:269
本文介绍了交叉编译Python扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Buildroot Linux发行版的ARM(Python 2.7.2)下交叉编译netifaces扩展时遇到问题。根据此博客, http://whatschrisdoing.com/blog / 2009/10/16 / cross-compiling-python-extensions / 我已经定义了CC,LDSHARE等环境变量,但是distutils / setuptools没有考虑CC,因此所有测试都会失败:

I have a problem with cross-compiling netifaces extension under Buildroot Linux distro for ARM (Python 2.7.2). According to this blog http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/ I've defined CC, LDSHARE etc. environment variables, but distutils/setuptools doesn't take CC into account so all tests will fail:

running build
Setting prefix
Setting prefix
running build_ext
checking for getifaddrs... not found. (cached)
checking for getnameinfo... not found. (cached)
checking for socket IOCTLs... not found. (cached)
checking for optional header files... netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h. (cached)
checking whether struct sockaddr has a length field... no. (cached)
checking which sockaddr_xxx structs are defined... at ax25 in in6 ipx un ash ec ll  atmpvc atmsvc dn irda llc. (cached)
building 'netifaces' extension

是否还有其他交叉编译示例/教程还是我在做什么错?

Are there any other cross-compile examples/tutorials or what am I doing wrong?

推荐答案

请确保已安装 distutilscross软件包,如您所链接的文章中所述。这将添加-x选项并支持PYTHONXCPREFIX / LDSHARED / etc环境变量。

Make sure you have installed the distutilscross package as noted in the article you linked. This adds the -x option and support for PYTHONXCPREFIX/LDSHARED/etc environment variables.

这篇关于交叉编译Python扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆