libtool
[Top][All Lists]
Advanced

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

Multiple -rpaths


From: Jan Engelhardt
Subject: Multiple -rpaths
Date: Sun, 2 Nov 2008 17:24:27 +0100 (CET)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

Hi,

I have two libraries in paths that are not searched by default (e.g. 
/opt/foo/lib). So I have this in my pkgconfig files:

foo.pc: Libs:   -L${libdir} -lfoo
bar.pc: Libs:   -L${libdir} -lbar

The linker will find -lfoo,-lbar and successfully create the output file 
-- which is an .la library --, but running `ldd` on it says 
"libfoo.so.0 => not found", and that seems fine to me, since no -rpath 
was given. So I try to add -rpath in the pkgconfig files:

foo.pc: Libs:   -L${libdir} -rpath ${libdir} -lfoo
bar.pc: Libs:   -L${libdir} -rpath ${libdir} -lbar

Then unfortunately, libtool complains with

libtool: link: warning: ignoring multiple `-rpath's for a libtool 
library

The Makefile.am line is just:

lib_LTLIBRARIES = baz.la
baz_la_LDFLAGS = -avoid-version -module ${libfoo_LIBS} ${libbar_LIBS}

with ${lib*_LIBS} being mapped to the pkgconfig parts, respectively.

How would I achieve what I am trying here? (Possibly without using 
non-portable linker flags or workarounds like -Wl,-rpath,${libdir} -- I 
seem to remember Solaris ld does not like -rpath at all and wants -R 
instead.)

thanks,
Jan




reply via email to

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