chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Adding a free slot to Chicken symbols


From: felix winkelmann
Subject: Re: [Chicken-users] Adding a free slot to Chicken symbols
Date: Wed, 12 Apr 2006 21:45:35 +0200

[cc'd to chicken-users, as this might be of general interest]

On 4/12/06, felix winkelmann <address@hidden> wrote:
> On 4/11/06, Zbigniew <address@hidden> wrote:
> > Hi Felix.  That seems like a simple and effective way to distribute
> > objc apps.  I do have one question though, as I have never really used
> > the static linking option of Chicken.  Given that the objc egg has a
> > special case for static linking, how does an objc application which
> > also uses other eggs get distributed?  In other words, would I need to
> > do something similar to link in another egg library statically, or is
> > the objc egg just a special case, and there is a more "normal" method?
>
> That (the change from `require'ing an extension to declaring the
> use of unit) would be needed for every egg.
> The situation is a bit ugly: extensions are .so's that ultimately refer
> to libchicken.so. If no libchicken is installed, then the egg won't
> be able to load. One solution is to use OS X frameworks (I understand
> that an app can bring it's own set of libraries, even though I've never
> used this feature). Another (the more simplistic and portable one) is
> to convert eggs to units and linking them directly into your app via
> `(declare (uses ...))' or `-uses'. The `-extension' option helps here,
> but one still needs to recompile all needed eggs in a special mode,
> which can get complicated for eggs that have multiple compile-/run-time
> dependencies.

In fact, it's even simpler than I thought: All we need is to use
install_name_tool
to modify the load-paths of libchicken and libffi for a compiled executable
and add a small snippet of prologue-code for the application that obtains
the bundle's executable path (and sets the repository path to this). Then
we can just copy the libraries and all eggs required at runtime into the
application bundle and it is self-contained. Eggs (or better the runtime-parts
of them) are loaded directly from the app's Contents/MacOS folder, unchanged.

I will describe this solution in more detail in the next days on chicken-coop.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]