[Top][All Lists]

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

Re: question about -rpath

From: Michael Matz
Subject: Re: question about -rpath
Date: Wed, 27 Feb 2002 02:42:49 +0100 (MET)


On Tue, 26 Feb 2002, Ted Irons wrote:

> I don't understand when -rpath (or -R or -Wl,--rpath -Wl,<libdir>) is
> needed

"-rpath /path" (as libtool argument) is when you build a library, which
shall be installed later into /path.  I.e. it only depends on the built
library.  (It btw. is saved into the .la file, so libtool notices when you
move by hand the lib to another dir, but forget to adjust the .la file).

"-R /path2" (which libtool transforms into -Wl,--rpath -Wl,/path2, if
that is the appropriate sequence to achieve that on the platform in
question) is for the runtime search path.  I.e. where the dyn loader
should look for libs which the lib just built depends on.  Note carefully
the mismatch, that "-rpath" does _not_ mean the usual "-Wl,--rpath"
semantic on linux (historically the Solaris ld used -R for runtime search

> >From reading the following on p. 22 of the Automake manual
>     For libraries installed in some directory, Automake will
>     automatically supply the appropriate `-rpath' option.

See?  The -rpath options can be added by automake, because it is for the
installation dir, which might be immediately derivable by automake just by
looking at the (or support files).  Again, bear in mind that
this has nothing to do with "-Wl,--rpath", whose effect is achieved by -R
in libtool speak.

> Also, where is that -Wl,--rpath -Wl,/postfix/dev/tips/Linux-2.4/lib
> coming from?

Probably the actual .la file for the tips library mentions -R <path>.  If
you then link against that .la file, the -R argument is applied there


reply via email to

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