Libraries that are not installed yet and runpath

Ondřej Kuzník <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
Hi all,
I'm trying to build a few things together and link to them before they
are installed into the final path.

So let's say I want to link against library.so, my understanding is that
I do this:
myfile_la_LIBADD = -lrary

If it is installed in the system, I can omit anything in ./configure's
LDFLAGS and if installed in $(libdir), I can add LDFLAGS='-L$(libdir)'
and runpath will be set accordingly.

But if I'm still staging things into $DESTDIR[0], either library.so
won't be found or (if -L$DESTDIR/'$(libdir)' is passed) the wrong path
is added to RUNPATH. I know we should be using the .la file[1] and
libtool will then get things right, but then it would be my job to find
the .la file and put it into the Makefile (and if this is Debian, there
are no .la files for system provided libraries for the normal case).

Is there a way of having libtool find the .la file if it exists in
directories provided (via "-L", or something libtool specific?) or find
the .so file as usual if the .la file is not around?

Or maybe there is another way to support all three scenarios above?

Thanks,
Ondrej

[0]. Say staging libraries with a circular dependency like
     libldap/libsasl2 do
[1]. https://www.gnu.org/software/libtool/manual/html_node/Linking-executables.html

-- 
Ondřej Kuzník                                                                                                                                                                                                                                                                                  
Senior Software Engineer                                                                                                                                                                                                                                                                       
Symas Corporation                  http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.