python setup.py 构建指令有类似 AC_CHECK_LIB 的东西吗?
我有一个 python 包,它构建了自己的扩展模块。目前我正在 setup.py 中将所有编译作为 ext_module 进行,但我确实需要 AC_CHECK_LIB 类型功能 - setup.py 是否有类似的东西,或者我是否需要为我的模块编写 autoconf?
这里的具体情况是,现在很多发行版都将 iconv 包含在 libc 中,但我仍然需要支持需要将 -liconv 传递给 gcc 的发行版。如何检查 libc 中是否包含 iconv 功能?
我应该跳过通过 setup.py 执行所有这些操作并使用 autoconf 吗?
谢谢!
I have a python package that builds its own extension module. currently I'm doing all the compilation in setup.py as an ext_module, but I really need AC_CHECK_LIB type capability - is there something like this for setup.py, or do I need to write a autoconf for my module?
Specific case here is that quite a few distros now have iconv included in libc, but I still need to support distros where -liconv needs to be passed to gcc. How can I check if iconv functionality is included in libc or not?
Should I skip doing all this through setup.py, and use autoconf?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我的观察看来,你能做的似乎并不多。您可能会幸运地使用
autoconf
生成setup.py
,或者您可以使用automake
和libtool
并执行以下操作整个事情与autofoo有关。 Automake 提供了一个宏 AM_PATH_PYTHON 来设置一大堆有用的变量,并给出了以下声明扩展模块的示例:From my poking around, it doesn't look like there's much you can do. You might have luck using
autoconf
to generatesetup.py
, or you could useautomake
andlibtool
and do the whole thing with autofoo. Automake provides a macroAM_PATH_PYTHON
that sets a whole pile of useful variables and gives the following example for declaring an extension module: