views:

48

answers:

1

Say I have two autotools projects:

  • libmyutils
  • libmypackage

The libmypackage library has a dependency on libmyutils. Is there a way to have libmypackage link to and reference the libmyutils package without it actually being installed? Or do I have to actually install libmyutils in order for libmypackage to access it?

Example:

# Contains src/*, configure, etc.
~/workspaces/libmyutils

# Contains src/*, configure, etc.
~/workspaces/libmypackage

The problem is that I want to keep libmyutils as its own package so that other libraries will be able to use it (libmypackage2, libmypackage3, etc.) but since I may be actively doing development both on libmyutils and libmypackage, I would like to avoid having to compile and install libmyutils every time I make a change.

Is this possible?

+1  A: 

i have a tree of subprojects i work with and i set my libmylib_la_LIBADD vars to point to the compiled but uninstalled lib so that during testing / debugging i link to the lib in the build system and get the benefits if incremental compile, etc...

libmyapplib_la_LIBADD = -lpthread $(top_builddir)/components/common/libmyutils.la

then, later when i install with configure --prefix=whatever, configure correctly does the final link to the installed location of the util lib

navicore
In your example, where would the root directory live for libmyutils? Does common/ have a configure.ac and a Makefile.am?
Beau Simensen
in my project libmyutils and libmyapplib shaare a root, they are subprojects. there is one configure.ac and a Makefile.am in the root, the Makefile.am only has a single line " SUBDIRS = components modules myutils myapplib" and each sub has its Makefile.am. so i can checkout/modify/build/test stuff without actually installing either on the dev machine.i think that if each project was totally standalone, which i hadn't thought about before, and each had it's own configure.ac it *should* work because of the rpath info in the .la partially built lib but i haven't tried it.
navicore
sorry, cut and paste error, i mean the root Makefile.am has the single line:SUBDIRS = myutils myapplib
navicore
@navicore thanks for the info. I do not think it is relevant as I'm needing a solution for linking one project to another project with a completely separate root. Thanks for your time, though!
Beau Simensen