I'm on Snow Leopard, and want distutils to use gcc 4.0 and not 4.2, can anyone tell me how to make it do that? I've tried changing the /usr/bin/g* symlinks, 开发者_如何学运维and setting the C* environment vars -- but to no avail. Any thoughts?
Did you try python setup.py build --compiler=gcc
? it is described in the docs.
EDIT: Also, this discussion looks very similar the present one. distutils.core appears to have the functions to specify the compiler and platform. distutils.ccompiler.get_compiler(osname, platform) or distutils.ccompiler.new_compiler(platform, compiler, verbose, dry_run, force) should work.
精彩评论