[Top][All Lists]

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

Re: question about -rpath

From: Ted Irons
Subject: Re: question about -rpath
Date: Tue, 26 Feb 2002 17:59:45 -0700

I'm using autoconf-2.52, automake-1.5b, libtool-1.4d.

I don't understand when -rpath (or -R or -Wl,--rpath -Wl,<libdir>) is needed
(other than  by experimentation).
>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.
    However, for libraries determined at configure time (and thus mentioned in 
    does not know the eventual installation directory; for such libraries you 
must add the `-rpath' option to the
    appropriate `_LDFLAGS' variable by hand.

it would seem to me that -rpath is needed on ALL libraries determined at 
configure time.
But the eg below (where postfix is a local project) seems to indicate otherwise:
image_sh is a program and
    -L/postfix/dev/pipes/Linux-2.4/lib -lhrnet -lregion -lseg -lutil
    -L/postfix/dev/gfiles/Linux-2.4/lib -lgf -llists
are libtool libraries picked up at configure time.
    -L/postfix/dev/tcl/Linux-2.4/lib -ltcl -lk
are the non-libtool tcl/tk libraries picked up at configure time.

It would seem that libtool knows (from automake?) "the eventual installation 
of say, eg, -lhrnet, because the actual link line reads
but does not know  the "eventual installation  directory"  of,  even
tho -L/postfix/dev/tcl/Linux-2.4/lib is given.  Is there  a possibility that will
have moved by runtime; but not   The rule seems to be that -rpath
is not needed for libtool libraries, but is needed otherwise.  But why?

Also, where is that -Wl,--rpath -Wl,/postfix/dev/tips/Linux-2.4/lib coming  
(tips is the name of the package I'm building, but there is no

The  autotools documentation doesn't seem to explain anywhere what is going on.
Or does it?

Thanks again,
- Ted

Ted Irons wrote:

> Starting with
> [187.virgo.image_wish] make image_sh
> /bin/sh ../../libtool --mode=link g++ ...
> -L/postfix/dev/pipes/Linux-2.4/lib -lhrnet -lregion -lseg -lutil 
> -L/postfix/dev/gfiles/Linux-2.4/lib -lgf -llists 
> -L/postfix/dev/tcl/Linux-2.4/lib -ltk -ltcl -L/usr/X11/lib -lXmu -lX11 -ldl 
> -lm -lnsl -lm
> we get the following; but why is there
> no -Wl,--rpath  -Wl,/postfix/dev/tcl/Linux-2.4 in the following?
> g++ ...
> -L/postfix/dev/pipes/Linux-2.4/lib 
> /postfix/dev/pipes/Linux-2.4/lib/ 
> /postfix/dev/pipes/Linux-2.4/lib/ 
> /postfix/dev/pipes/Linux-2.4/lib/ 
> /postfix/dev/pipes/Linux-2.4/lib/ 
> /postfix/dev/gfiles/Linux-2.4/lib/ -lstdc++ -lc -lgcc 
> /postfix/dev/gfiles/Linux-2.4/lib/ -ltk -ltcl -lXmu -lX11 -ldl 
> -lnsl -lm -Wl,--rpath -Wl,/postfix/dev/tips/Linux-2.4/lib -Wl,--rpath 
> -Wl,/postfix/dev/nitf/Linux-2.4/lib -Wl,--rpath 
> -Wl,/postfix/dev/pipes/Linux-2.4/lib
> -Wl,--rpath -Wl,/postfix/dev/gfiles/Linux-2.4/lib
> creating image_sh

> It is true that,eg,  was created with libtool; but was 
> not.
> Thanks in advance,
> - Ted

reply via email to

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