[Distutils] C extension modules
tmohr at s.netic.de
Thu Jan 28 00:51:03 CET 2010
thank you all for your hints. I've created a setup.py and can compile my C++
extension module now.
> > Also, i use libjpeg, libtiff and libpng. Can i portably test for
> > presence and version of these libs on Linux, Windows and other OSes?
> Not really. There is distutils.ccompiler.find_library_file() and
> friends which you might put to good use, but I've never seen it being
> used or used it myself. And it's quite complicated to get a usable
> instance of CCompiler, expect to read distutils source.
> But generally you can just use the platform default includes and then
> it will simply fail to compile if they're not present.
But when using:
libraries = [ 'jpeg', 'png', 'tiff']
Then the dynamic libraries are linked, which i not necessarily want.
Using names line libjpeg.a seems to work but is not portable.
In distutils.ccompiler it seems in CCompiler() there is something like
"library_filename()", has anybody got an example? Or is there a better
More information about the Distutils-SIG