* Braden McDaniel wrote on Mon, Aug 06, 2007 at 03:40:09AM CEST: > On Mon, 2007-08-06 at 10:53 +1000, Russell Shaw wrote: > > > However, the shared object that dlopen requires is in a new .libs > > directory: [...] > > modules/System/.libs/system.so [...] > > Dlopen fails because it is looking for modules/System/system.so > > When installed, i'll have the install location at: > > > > /usr/lib/$(pkglibdir)/System/system.so > > > > Should i just have dlopen look for modules/System/.libs/system.so > > and modules/System/system.so and use the first one that succeeds, or > > is there a cleaner way for avoiding this? > > You can use libltdl's ltdlopen instead. libltdl is included with > libtool.
The answer isn't wrong, but the answer isn't hitting the nail fully on the head either. One way to dlopen uninstalled modules is to libtool --mode=execute -dlopen modules/System/system.la program [ARGS...] which should set LD_LIBRARY_PATH (or the appropriate variable on the system) to contain modules/System/.libs to find system.so. You may want to refer to `libtool' as `$(LIBTOOL)' in Makefile.am (or even add `$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)' for user benefit). Hope that helps. Cheers, Ralf