[Distutils] static linking in distutils/setuptools?
Bob Ippolito
bob at redivi.com
Fri Jan 27 01:02:44 CET 2006
On Jan 26, 2006, at 3:29 PM, Robert Kern wrote:
> Stefan Seefeld wrote:
>> Robert Kern wrote:
>
>>> Not really, no. In many cases (e.g., GNU ld), there's simply no
>>> way to tell the
>>> linker that you prefer static libraries to shared libraries when
>>> you are
>>> building a shared library like a Python extension. You simply
>>> have to make sure
>>> that the static libraries are found first.
>>
>> I believe this is wrong. The (GNU ld) man pages mention '-
>> Bdynamic' and '-Bstatic'
>> as a means to instruct the linker to link to a particular library
>> dynamically or
>> statically. (To only link statically to libbar.a you could write e.g.
>>
>> ... -lfoo -Bstatic -lbar -Bdynamic -lbaz
>>
>> etc.)
>
> Ah, yes, you are correct. Unfortunately, OS X's ld does not have
> these options
> (and is not GNU; I am an idiot).
What I normally do is specify the full path to the library in
extra_link_args, and remove it from the libraries list.
-bob
More information about the Distutils-SIG
mailing list