Hi,
On 1/14/08, Steve Lihn <[EMAIL PROTECTED]> wrote:
In perl scripts (unix), one can do
#!/usr/local/bin/perl
BEGIN { $ENV{LD_LIBRARY_PATH} = ...; }
I've not tested this (what a great line to start a post...), but see
if this works for you:
#! /usr/bin/env LD_LIBRARY_PATH=/path/to/libs runhaskell
which also has the (desirable? Hmm...) side effect of letting env
figure out (using PATH) where to find runhaskell.
This doesn't work for compiled binaries, sadly.
Modifying LD_LIBRARY_PATH at runtime works for Perl because libraries
are loaded at runtime, and the language allows you to sneak in some
code before that happens. Even if Haskell had a
System.Environment.withEnv (it already has a withArgs), it's probably
too late to patch the environment -- you can't get in before the
linker. (Unless you're using some sort of funky dynamic plugin thing.)
Cheers,
/Liyang
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe