更改distutils使用的gcc版本

Har*_*ama 5 python gcc distutils osx-snow-leopard

我在雪豹上,并希望distutils使用gcc 4.0而不是4.2,谁能告诉我如何让它做到这一点?我已经尝试更改/ usr/bin/g*符号链接,并设置C*环境变量 - 但无济于事.有什么想法吗?

vpi*_*833 0

你试过了吗python setup.py build --compiler=gcc?它在文档中进行了描述。

编辑:此外,这一讨论看起来与当前的讨论非常相似。 distutils.core似乎具有指定编译器和平台的功能。distutils.ccompiler.get_compiler(osname, platform) 或 distutils.ccompiler.new_compiler(platform, compiler, verbose, dry_run, force) 应该可以工作。