[fpc-pascal] Packaging shared libraries for OSX, recommendations?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jun 12 13:36:20 CEST 2013


On 11 Jun 2013, at 07:40, Bruce Tulloch wrote:

> Xcode users of our library just include the framework binary (i.e. the
> dylib, also called MyFramework in this example) in their project.  
> However,
> as part of our library build process we MUST use install_name_tool to
> modify the canonic path in the dylib to be relative to the executable
> location in the app bundle created by Xcode (when they build their  
> app) and
> this relative location will always be as described in the linked  
> examples
> you referred us to (i.e. @executable_path/../Frameworks/MyFramework).
>
> Have we understood this correctly?

Yes, although it's slightly better to use @rpath: http://www.dribin.org/dave/blog/archives/2009/11/15/rpath/

> Can you give me some background on why it works this way?

To ensure that every application and library loads only other  
libraries that the authors intended them to load, rather than  
arbitrary copies located somewhere on the system (or loaded by other  
libraries used by that application/library) that may or may not work.


Jonas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130612/77f838b8/attachment.html>


More information about the fpc-pascal mailing list