SpatialBundles
Isak Savo
isak.savo at gmail.com
Fri Sep 21 03:24:52 PDT 2007
2007/9/21, Alexander Larsson <alexl at redhat.com>:
> On Thu, 2007-09-20 at 12:41 +0200, Mildred wrote:
> > Le Thu 20/09/2007 à 09:28 Alexander Larsson à écrit:
>
> > > Also, most apps are not relocatable, so it will be hard to package
> > > them like this.
> >
> > For me, an app that is not relocatable is bogus. Just change it to make
> > it relocatable.
>
> Its easy to state such an opinion. However, to actually make all apps
> relocatable is more work.
It's actually not that hard. The problem is that there isn't any
portable way of doing this for all platforms. On Linux, you can get
the full path of the current process by looking inside /proc/
filesystem (which is what binreloc[1] from autopackage does). Windows
has native API for it. OSX probably too (not sure). No idea on how to
do it on bsd for instance.
Once you have the full path to the currently executing binary, it's
just a matter of replacing hardcoded DATADIR etc with a runtime
initialized variable or function call.
There's also methods[2] that require no changes to the original source code.
-Isak
[1] http://www.autopackage.org/docs/binreloc/
[2] http://trac.autopackage.org/browser/binreloc/trunk/fdbr.c
More information about the xdg
mailing list