Survey of complex usage of distutils.

Jens Jorgen Mortensen jensj at fysik.dtu.dk
Wed May 21 04:42:02 EDT 2003


Anthony Baxter wrote:
> and wacky usage of distutils internals. If you have written a setup.py that
> is using more than just the basic distutils.core functionality, could you
> please contact me and let me know what other functionality you're using?

I have this piece of (ugly) code in my setup.py:

from distutils import sysconfig
# Make sure C++ code is linked with g++:
old_init_posix = sysconfig._init_posix
def new_init_posix():
    old_init_posix()
    vars = sysconfig._config_vars
    var = vars['LDSHARED']
    if var[:3] == 'gcc':
        vars['LDSHARED'] = 'g++' + var[3:]
        print 'changing LDSHARED =', `var`, 'to', `vars['LDSHARED']`
sysconfig._init_posix = new_init_posix

I don't remember where I got it from!

Jens Jørgen





More information about the Python-list mailing list