On Apr 19, 2012, at 12:42 AM, ext [email protected] wrote:
>
>> How can I specified the correct path for my library?
>
> Interesting question! I was also wondering about how to set LD_LIBRARY_PATH
> to a certain value.
LD_LIBRARY_PATH gets special treatment. Because complete operation of SB2 is
based on a preload library, LD_LIBRARY_PATH (and LD_PRELOAD, too) are needed
internally.
But it has been taken into account that the user might have other requirements
for LD_LIBRARY_PATH; therefore SB2 does some invisible changes to that variable
before and after execs.
What you see in the user-visible environment is the user's LD_LIBRARY_PATH, and
then there is a separate SB2's LD_LIBRARY_PATH.
SB2 combines those two for the real exec calls, but it also hides what is
actually used.
Note that by default there is no user's LD_LIBRARY_PATH in the environment for
a session. The session won't inherit it from outside. but you can set it inside
the session.
> Changing it with sb2-config will break my whole scratchbox environment
> (unsetenv helps here, of course).
Yes, that seems to be a bug. "sb2-config setenv LD_LIBRARY_PATH=..." causes
problems at startup (the bug is in sb2-monitor, related to option -e)
As a workaround, set LD_LIBRARY_PATH inside the session.
>
> This shell script doesn't work either:
>
> #!/bin/bash
> LD_LIBRARY_PATH="/my/own/lib:$LD_LIBRARY_PATH"
> $@
Does it help if you export LD_LIBRARY_PATH in that script? As there is no
user's LD_LIBRARY_PATH in the environment by default, your assignment in the
script does not change the environment. It only sets a local shell variable
which doesn't affect anything.
I just tested these things, and LD_LIBRARY_PATH features still work in 2.3.54.
Lauri
_______________________________________________
Scratchbox-users mailing list
[email protected]
http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users