[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why configure script says to link this library with LIBADD instead o
Dale E Martin
Re: Why configure script says to link this library with LIBADD instead of LDADD?
Tue, 29 Apr 2003 07:30:37 -0400
> Try either of these instead:
> myprogram_LDADD = ../lib/libmynoinstlib.a
> myprogram_LDADD = $(top_builddir)/lib/libmynoinstlib.a
I would HIGHLY recommend the second form here, and I'd also highly
recommend refering to source files using $(top_srcdir)/path/to/source.
Someday you or someone wanting to use your software will want to use VPATH
builds and if you use the second style above, it should be possible.
If you're not aware of VPATH builds, it's when you build outside of your
source tree. For example, say I have some sources in "foo/src". I can do
this to build if I want:
This will cause foo to build and install, without putting any .o files in
the foo/src directory. Why would I want to do this? One reason I do it is
to be able to build with both g++ 2.95 and 3.2 on the same source tree
before I ever check files into CVS. Other people do it to cross compile to
multiple targets on the same source. You could also do it to
enable/disable different configure time options on the same tree and make
sure the combinations work as you develop.
Anyways, I think the $(top_builddir) and $(top_srcdir) stuff is essential
when you need to reference things "across" your source archive.
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
pgp key available