Cross Compiling Python Extensions

不问归期 提交于 2019-11-27 23:40:19

问题


I have a problem 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 making wrong?


回答1:


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.




回答2:


I don't know whether you still care this question. It seems that you have some build target already, so it doesn't compile the c program any more. Try to clean all the files and directories below "build" folder, and build again.



来源:https://stackoverflow.com/questions/8614261/cross-compiling-python-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!