交叉编译Python扩展

问题描述 投票:13回答:2

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

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

有没有其他交叉编译示例/教程或我做错了什么?

python cross-compiling setuptools distutils
2个回答
0
投票

确保您已按照所链接文章中的说明安装了distutilscross package。这会添加-x选项并支持PYTHONXCPREFIX / LDSHARED / etc环境变量。


-1
投票

我不知道你是否还在关心这个问题。看来你已经有了一些构建目标,所以它不再编译c程序了。尝试清除“build”文件夹下的所有文件和目录,然后重新构建。

© www.soinside.com 2019 - 2024. All rights reserved.