[C++-sig] OT(?): Building boost::python with distutils?
Stefan Seefeld
seefeld at sympatico.ca
Wed Feb 14 15:18:08 CET 2007
Hans Meine wrote:
> Hi!
>
> David Abrahams once asked on the distutils list whether distutils could be
> used to build shared libraries (like libboost_python.so) which are no
> extension modules:
> http://mail.python.org/pipermail/distutils-sig/2002-October/002966.html
>
> Apparently, the answers all contain more or less hackish ways around using
> distutils.Extension(..)
>
> I am sorry if this is more or less off-topic here, but does anybody know
> whether there is a solution to that problem? (To draw a real connection to
> BPL: This is about distributing BPL extension modules which all link against
> a common shared library.)
My 'solution' is indeed to work around the 'Extension' mechanism. Completely.
In my case (Synopsis: http://synopsis.fresco.org/, for the curious), I build
a C++ library as well as a set of python (extension) modules, so this is a
hybrid project, which distutils wasn't exactly designed for.
I have basically reimplemented all the main distutils commands that relate
to that, and then added a 'build_clib' command for the shared (in the above
sense) library.
My build_clib and build_ext commands are essentially opaque wrappers around
invocations to 'make'. None of those commands uses the distutils.Extension
type at all.
I don't think it is worth waiting for distutils to fix this. I would, however,
be interested in looking into ways to add distutils-like capabilities to
boost.build. (I mentored a Google SoC project last summer to do something
similar to SCons.)
Regards,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
More information about the Cplusplus-sig
mailing list