[Distutils] [build_ext] more than one external library
cludwig at cdc.informatik.tu-darmstadt.de
Wed Apr 20 10:19:14 CEST 2005
On Fri, Apr 15, 2005 at 03:09:26PM +0200, Christoph Ludwig wrote:
> I use the distutils shipped with Python 2.4 on a i686-pc-linux-gnu system.
> I am wondering how can I pass more than one external library to distutils'
> build_ext option (on the command line or even better via setup.cfg)?
can anyone help with this one?
In case you wonder why I need to pass the library names on the command line
of setup.py: My extension uses several Boost libraries. Boost uses some kind
of "library name mangling" to encode the compiler, library version and build
options (single vs. multi threaded, release vs. debug build) in the library
names. I cannot know which build of the Boost library the user of my extension
will want / need to link against. (E.g., if he user's python interpreter was
built without thread support then the extension must not be linked against
So I need to offer the users of my extension a way to override the default
choice of external libraries.
> In analogy to --include-dirs I'd expect
> ./setup.py build_ext --libraries A:B
> to generate a linker call similar to:
> g++ -lA -lB # ... other arguments and options
> But I get:
> g++ -lA:B # ...
> I also tried
> ./setup.py build_ext --libraries 'A B'
> ./setup.py build_ext --libraries A B
> ./setup.py build_ext --libraries A,B
> ./setup.py build_ext --libraries A --libraries B
> but to no avail. (In the last case the second --libraries option seems to
> overwrite the first one.)
> Is this feature missing and I need to put the library list in the libraries
> option of the respective Extension constructor in setup.py? Or did I fail to
> try the correct syntax?
More information about the Distutils-SIG