This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: is LDADD line the place to put .a convenience libraries AS WELLAS -l switches?? like -lm??? how works?
> LDADD = helperfunctions/libhelperfunctions.a -lpthread -lm
>
> First of all, is the LDADD line the place to add .a files
> as well as -l switches???
Yes. Although you might be better off doing:
foo_LDFLAGS = -Lhelperfunctions
foo_LDADD = -lpthread -lm
Then again, if the helper functions will NEVER be installed and there's no
chance you'd ever link against installed libraries, maybe your way is
better.
> I'm a little impressed and amazed Autotools was able to accept /both/
> types of animals on the LDADD line.
Why? gcc/g++ can do it when it's linking too.
> Did I get lucky or is LDADD the place to *always* add both of these guys?
Yes, that is correct, when linking you'd always use LDADD for both forms of
libraries. In one of your other posts you asked about LIBADD, and that is
to tell libtool that "this" library has a dependency on some other library.
The beauty of THAT is that when you use dynamic linking, it allows it to
preload the dependant libraries automatically. And when static linking,
(and you use libtool to link), it automatically generates the full list of
libraries to link to, presumably in the right order (if you specified them
this way.) As far as I'm concerned, this is the main benefit of using
libtool.
Take care,
Dale
--
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin at cliftonlabs dot com
http://www.cliftonlabs.com
pgp key available