[Distutils] Dynamic linking on Linux, Mac OS, et al
Bob Ippolito
bob at redivi.com
Fri Jan 6 06:47:15 CET 2006
On Jan 5, 2006, at 9:00 PM, Robert Kern wrote:
> Phillip J. Eby wrote:
>> Hi folks. I just implemented preliminary shared library build
>> support for
>> setuptools, but I ran into a bit of a snag. I was operating under
>> the
>> assumption that you could simply put shared libraries in the
>> directory
>> alongside the extensions that use them, but in practice it turns
>> out that
>> this only works on Windows. On Linux I found that you could only put
>> shared libraries in a directory on LD_LIBRARY_PATH, and I suspect
>> a similar
>> issue will be found under OS X and other Unixes.
>
> On OS X, the headers of the dylib can be rewritten to point to a
> specific path.
> IIRC, this can be a relative path. Bob Ippolito's py2app does this
> kind of
> rewriting for making relocatable .app bundles. I'm sure he'll chime
> in soon, so
> I'm not entirely sure why I bothered replying myself.
It's actually the extension that needs the rewriting.. but it's good
to rewrite the dylib also.
It can be a relative path, but only relative to the executable. You
can be relative to the bundle on Mac OS X 10.4+, but it really ought
to just make the path static upon installation and remain backwards
compatible. In order to make that bulletproof, the linker flag -
headerpad_max_install_names should be used.
-bob
More information about the Distutils-SIG
mailing list