[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Question about testing a library.
From: |
Schrader, Glenn |
Subject: |
RE: Question about testing a library. |
Date: |
Wed, 18 Jun 2008 15:10:13 -0400 |
I believe that I found the answer to my poorly asked question. My confusion
started when I noticed that target lists that begin with check_ are special in
that they are only built when 'make check' is executed. This is reasonable
since you probably want to do a complete build before building any of the
tests. I am using the target 'installcheck' to verify that my installed
libraries are working by building test programs against the files installed at
the install prefix. It doesn't make any sense to make installcheck before
making install since there won't be anything at the install prefix to allow a
build to succeed. I added my install test programs into a installcheck_PROGRAM
variable. I found a few ways this didn't work so I dug into the Makefile.in
that automake produced. It seems that the tests always wound up being
dependencies of the 'all' target, which wasn't what I had expected. As far as I
can tell the check_ prefix is the only special one in this regard so what I
originally wanted to do simply won't work.
There is any number of hackish solutions to what I want to do so feasibility
isn't the issue. But, is there a clean way to do this within automake? Am I
missing something?
--glenn
> -----Original Message-----
> From: Ralf Wildenhues [mailto:address@hidden
> Sent: Friday, June 13, 2008 1:42 AM
> To: Schrader, Glenn
> Cc: address@hidden
> Subject: Re: Question about testing a library.
>
> Hello Glenn,
>
> * Schrader, Glenn wrote on Thu, Jun 12, 2008 at 07:54:59PM CEST:
> >
> > I am creating a library that is built with automake. The way that I
> > >think< this should work is:
>
> > The problem I'm having is that the programs installcheck uses to test
> > the library can only be build after the 'make install' but the
> > Makefile automake produces wants to build them as a dependency of the
> > 'all' target. This, of course, fails since the library isn't installed
> > yet.
>
> Do you use libtool to build the library?
>
> Generally, the intended mode of operation is like this: 'make all'
> builds uninstalled libraries and uninstalled programs that may depend on
> these libraries. 'make install' installs the libraries, then the
> program, possibly causing libtool to relink these so they point to their
> then-installed dependencies.
>
> For this to work, it requires a bit of cooperation from the developer.
> First, within a Makefile.am, lib_LTLIBRARIES has to be listed in
> dependency order (for installation to be in order; this is irrelevant
> for 'make all', because for them lib*_la_LIBADD are used, or if that
> fails, *_DEPENDENCIES may be supplied). With dependencies spread out
> among several Makefile.am's, the developer should arrange the build
> order (through the order in the SUBDIRS line) so that deplibs are built
> before the libraries and programs that use them.
>
> Hope that helps.
>
> Cheers,
> Ralf
- Simple "how-to" question, libtool, Mar Loh, 2008/06/12
- Question about testing a library., Schrader, Glenn, 2008/06/12
- Re: Question about testing a library., Ralf Wildenhues, 2008/06/13
- RE: Question about testing a library.,
Schrader, Glenn <=
- Re: Question about testing a library., Ralf Wildenhues, 2008/06/18
- RE: Question about testing a library., Schrader, Glenn, 2008/06/18
- Re: Question about testing a library., Ralf Wildenhues, 2008/06/18
- RE: Question about testing a library., Schrader, Glenn, 2008/06/18
Re: Simple "how-to" question, libtool, Brian Dessent, 2008/06/12
Re: Simple "how-to" question, libtool, Ralf Wildenhues, 2008/06/13