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 
EXTRA_LTLIBRARIES), Automake
    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 directory"
of say, eg, -lhrnet, because the actual link line reads
    -L/postfix/dev/pipes/Linux-2.4/lib /postfix/dev/pipes/Linux-2.4/lib/libhrnet.so
but does not know  the "eventual installation  directory"  of libtcl.so,  even
tho -L/postfix/dev/tcl/Linux-2.4/lib is given.  Is there  a possibility that libtcl.so 
will
have moved by runtime; but not libhrnet.so?   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  from?
(tips is the name of the package I'm building, but there is no libtips.so)

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/libhrnet.so 
>/postfix/dev/pipes/Linux-2.4/lib/libregion.so 
>/postfix/dev/pipes/Linux-2.4/lib/libseg.so 
>/postfix/dev/pipes/Linux-2.4/lib/libutil.so 
>/postfix/dev/gfiles/Linux-2.4/lib/libgf.so -lstdc++ -lc -lgcc 
>/postfix/dev/gfiles/Linux-2.4/lib/liblists.so -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 libhrnet.so,eg,  was created with libtool; but libtk.so was not.
>
> Thanks in advance,
> - Ted


Reply via email to