[gobolinux-users] Source repositories and other suggestions

Jonatan Liljedahl lijon at kymatica.com
Sun Dec 3 16:49:16 UTC 2006

Martin Baldan wrote:
> On 12/3/06, Jonatan Liljedahl <lijon at kymatica.com> wrote:
>> Just an idea.. I'm not sure what you want, but if you want to control
>> exactly what libraries are linked (runtime) with a program, wouldn't it
>> be possible to have a separate set of links to libs under each program?
>> Like /Programs/Foo/Current/Links/lib and then set LD_LIBRARY_PATH to
>> this before running a binary?
>> -- 
> Wouldn't this affect the behavior of other programs? How does this manage
> recursive dependencies? Isn't LD_LIBRARY_PATH a global variable?

You can set it locally for each running process, like this:

] LD_LIBRARY_PATH=/Programs/MyApp/lib myapp

One could make a wrapper script for this:

LD_LIBRARY_PATH=$(which $1 | cut -d/ -f1-3)/lib $1

If this script is saved as /bin/linkrun, then one just runs:

] linkrun name-of-binary

It wouldn't affect other programs. Recursive dependencies would not be
handled in any special way, all libraries would be searched for in the
current LD_LIBRARY_PATH...

/Jonatan    -=( http://kymatica.com )=-

More information about the gobolinux-users mailing list