[Pythonmac-SIG] -R, -L, ldd, and the meaning of life...

Jack Jansen Jack.Jansen@oratrix.com
Thu, 10 Oct 2002 21:48:20 +0200


On donderdag, oktober 10, 2002, at 05:11 , Skip Montanaro wrote:

>
> In much of the Unixoid world, link editors understand a -R flag 
> and/or an
> LD_RUN_PATH environment variable (or something similar).  One 
> or the other
> tell the run-time linker to search the argument director(y|ies) 
> for shared
> libraries.

You don't normally need it for MacOSX. The output file will 
contain the full pathname for the .dylib used to resolve the 
library. This can then be modifed by a number of environment 
variables at runtime (some of which are appended to the dynamic 
library search path so they serve as a fallback, others are 
more-or-less prepended and allow you to load a dynamic library 
from a non-standard location even though the original exists). 
See "man dyld" for the gory details. So, -L is usually enough, 
but you have to be careful with relative pathnames to -L as 
these'll be recorded as relative pathnames in the resulting 
binary. Sometimes this is what you want, often it isn't.

> Also, is there a MacOSX equivalent of the ldd command?

otool will tell you pretty much anything you want to know.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -