【问题标题】:Cross Compiling Python Extensions交叉编译 Python 扩展
【发布时间】:2012-01-26 16:58:59
【问题描述】:

我在 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

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

【问题讨论】:

    标签: python cross-compiling setuptools distutils


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2011-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多