gpt4 book ai didi

python - 交叉编译 Python 扩展

转载 作者:太空狗 更新时间:2023-10-29 17:35:21 24 4
gpt4 key购买 nike

我在 ARM 的 Buildroot Linux 发行版(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

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

最佳答案

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

关于python - 交叉编译 Python 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8614261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com