libtool
[Top][All Lists]
Advanced

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

Path to library?


From: David Lee
Subject: Path to library?
Date: Wed, 17 Oct 2001 22:15:27 +0100 (BST)

On page 8 of "GNU Libtool" (version 1.3.5) is a description of how to link
against an already installed library:


||   You could figure out where it lives by yourself, then run:
||      gcc ... -o test test.o -L/usr/local/lib -lhello
||
||   ... However, if you use libtool ... it will do the Right Thing (TM)
||   for you:
||      libtool gcc ... -o test test.o /usr/local/lib/libhello.la


>From this, and other reading, I get the feeling that using:
   gcc ... -L/path/to  -lxyz"
is considered bad, and that it is far preferable to do:
   libtool gcc ... /path/to/libxyz.la
(i.e. that "-L ... -l" is considered poor practice with libtool).

But if this (either scheme, but particularly the latter) is combined with
autoconf and automake, how can autoconf determine the "/path/to"?  Then
how is it used?  I think what is needed is for autoconf, having determined
"/path/to" (or "/path/to/libxyz.la") then to put this into an "@...@"
variable, and for the "Makefile.in"  then to have "@...@" (full pathname)
appended to "test_LDADD" (for sample program "test" etc.)

Is this right?  If so, what is the 'missing link' that determines
"/path/to/libxyz.la"?  Although my example is a pre-installed libtool
library (xyz.la), what similarities/differences might there be when the
pre-installed library is non-libtool (".a", ".so" etc.)? 

(Although I'm on Solaris, it is important that the solution be capable of
being used portably across a range of systems, insofar as those systems
allow it.) 

Feel free to refer me to page numbers in GNU Libtool (and autoconf and
automake) documents and to page numbers in the "Goat" book "GNU Autoconf,
Automake and Libtool": Vaughan et al.

Thanks in advance.

-- 

:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :




reply via email to

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