交叉编译Python扩展

18
我在Buildroot Linux distro for 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

是否有其他跨平台编译的示例/教程,或者是我哪里做错了?

2个回答

1

请确保已按照您提供的文章中所述安装了distutilscross package。这将添加-x选项并支持PYTHONXCPREFIX/LDSHARED等环境变量。


-1

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接