[Pythonmac-SIG] configure/distutils and C++
Doug Wyatt
doug@sonosphere.com
Sat, 14 Dec 2002 15:45:57 -0800
I thought I'd rephrase and summarize what I learned trying to build
XIST, which uses distutils and has one .cxx file.
What I learned: distutils gets its information about the compile/link
commands from configure; a copy of the Python Makefile gets stored in
/usr/local/lib/python2.2/config/Makefile.
configure --with-cxx=g++ does cause g++ to get invoked to compile .cxx
or .cpp (etc.) sources, but the problem appears to be that:
[a] at least on Mac OS X, that's unneccessary; gcc will "do the right
thing" for C++ sources
[b] there is no way to generate different link commands depending on
whether one of the source files was C++. The general solution might be
simply to define -lstdc++ for all link commands in configure, and rely
on the linker being smart enough to notice that nothing from libstdc++
is referenced when there are no C++ files compiled.
Have I missed something about distutils/configure?
Doug
--
Doug Wyatt
doug@sonosphere.com
http://www.sonosphere.com/