[Distutils] changing default compiler

Enrico Sirola enrico.sirola@riskmap.net
Thu Feb 8 04:27:55 2001


>>>>> "MA" == M -A Lemburg <mal@lemburg.com> writes:

    MA> Enrico Sirola wrote:
    >>  Hello, i wrote a C++ extention module, but distutils keep
    >> trying to compile it as a plain C interface one. Is t possible
    >> it's confused by my strange platform name?
    >> 
    >> from sys import platform print platform
    >> 
    >> gives out
    >> 
    >> linux2
    >> 
    >> This is prolly non standard, but maybe it's becouse i'm using a
    >> beta distro (progeny debian)...  Anyway everithing works if i
    >> run compiler commands by hand (changing gcc to g++) and finally
    >> type "python setup.py install".  So, how can i force distutils
    >> to use g++ instead of gcc?

<*slap* self>
I was wrong... on standard debian platforms python has the same
behavior and everything works fine in distutils.

    MA> Try the --compiler option to the build_ext command. Note that
    MA> build_ext is not yet up to compiling C++ code. For gcc a
    MA> simple renaming of the source file to .cc or .cxx will let gcc
    MA> compile the file as C++ without any additional options.

i just tried, but --compiler let me choose 'unix' only (and then it
chooses gcc instead of g++).
there's another strange behavior:
the directories under build/ have the following names:
lib.linux2/
temp.linux2/
and prolly should be
lib.linux-i686-1.5/
temp.linux-i686-1.5/
How do distutils select buid-directory names? This could be a good
starting point..
Thanks for the help
Enrico
--