libtool
[Top][All Lists]
Advanced

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

How do I hard-code the configuration path into a shared library?


From: Jost Boekemeier
Subject: How do I hard-code the configuration path into a shared library?
Date: Mon, 1 Dec 2003 13:59:56 +0100

Hi,

I have a main library main.so which in turn dlopens other libraries sub1.so
sub2.so located in some directories.

How to I compile main.so so that when someone invokes the library (by
calling dlopen) the main.so will look for the sub-libraries in its
configuration directories -- without implementing my own .so search
algorithm?  This should work on Linux.


To be more concrete: I want to dlopen the jdk1.4 libjvm.so.  The problem is
that libjvm.so in turn dlopens other libraries within a well-known
directory, but this directory is not part of the global LD_LIBRARY_PATH.  So
one solution would be to set the LD_LIBRARY_PATH before I invoke dlopen
(this is not possible on Linux) or to hard-code the configuration into a
shared library (probably with the -rpath). But this also does not seem to
work on Linux.  Calling execve() and setting the LD_LIBRARY_PATH there is
not a solution because I am within an environment where I cannot call exec.




Jost




reply via email to

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