libtool
[Top][All Lists]
Advanced

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

Re: Libtool doesn't set -rpath automatically when needed?


From: Ralf Wildenhues
Subject: Re: Libtool doesn't set -rpath automatically when needed?
Date: Sat, 3 Nov 2007 12:57:36 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Benoit SIGOURE wrote on Sat, Nov 03, 2007 at 11:44:15AM CET:
> On Nov 3, 2007, at 9:53 AM, Ralf Wildenhues wrote:
> >
> >Libtool doesn't add run paths to installed libraries without .la  
> >files.  (How should it know that it should not only add
> >/usr/local/lib, but  also /opt/foo/lib because that is needed as
> >well?  OK, this question is  moot on GNU/Linux, but not on other
> >systems.)
> >
> >You can use -R/usr/local/lib to make libtool add one.
> 
> I don't want libtool to add run paths to already installed libraries  
> (this is obviously impossible, simply because it would require root  
> privileges to change /usr/local/lib/libboost_*),

That's a misunderstanding (and upon rereading my previous post, I see
why I was unclear), so again:

If you link a library or program against an installed non-libtool
library, then libtool will not add a run path entry pointing to that
library's directory.

You can do so yourself however by passing -R... to libtool.

> I'd like libtool to  
> add a run path to my own library/program so that I can run them  
> without having to deal with LD_LIBRARY_PATH issues.

Yes.

> >>Moreover, I don't see how to do such a check
> >>while preserving cross-compilation capabilities (since checking
> >>whether -rpath works or not requires to run the binary somehow,
> >>doesn't it?
> >
> >You don't need to, AC_PROG_LIBTOOL does that for you.
> 
> OK great so maybe I can copy/paste the part of AC_PROG_LIBTOOL that  
> does this in my own macro so I can portably figure out the -rpath/-R/ 
> etc. options needed and then add them to BOOST_THREADS_LDFLAGS,  
> right?  I don't think it'd be a good idea to add AC_REQUIRE 
> ([AC_PROG_LIBTOOL]) to my BOOST_THREADS macros...
> How does that sound?

You don't *need* to find out how -rpath/-R works.  Just pass -R to
libtool, it will translate that into -Wl,-rpath or whatever else.

You *only* need to find out how -rpath/-R works in case the users of
your macro may not want to use Libtool at all.  In that case, be advised
to use the gnulib module havelib, because it does exactly what you need.

Cheers,
Ralf




reply via email to

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