[Top][All Lists]

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

Re: libtool check libraries always result in 'uninstalled' binary script

From: Ralf Wildenhues
Subject: Re: libtool check libraries always result in 'uninstalled' binary script
Date: Thu, 6 Nov 2008 20:36:37 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* James Leek wrote on Thu, Nov 06, 2008 at 07:32:46PM CET:
> Ralf Wildenhues wrote:
>> First off, what you're trying to do fits much better with the 'check'
>> target than with the 'installcheck' target: the former is meant to test
>> things before you ever run 'make install', the latter is meant to test
>> those things you have actually created with 'make install'; also, it is
>> nice if 'make installcheck' does not change the object files in the
>> build tree.
>> So, to summarize, I'd rename your installcheck-local target to
>> check-local.
> I guess I don't quite get your point here.  I have a program and its  
> associated libraries that I do install call Coop.  When I run  
> installcheck I want the tests to link against the installed versions of  
> Coop's libraries.  Hence this weird rule:
> installcheck-local : installcheck-not-check
>    $(MAKE) $(AM_MAKEFLAGS) \
>        LIBCOOP_INCLDIRS=-I$(includedir) \
>        LIBCOOP_LIBDIRS=-L$(libdir) \
>        LIBCOOP_PYPATH=$(bindir) \
>        $(check_LTLIBRARIES) $(check_PROGRAMS) \
>        $(check_SCRIPTS) check-TESTS
> I'm forcing the tests to find the installed includes and libs by  
> changing those LIBCOOP variables.  In the build directory, those  
> libraries are all in different directories, but during install they all  
> end up in libdir.  Admittedly, it seems like there should be some more  
> obvious way to do this, but I haven't figured it out yet.  Do you have a  
> suggestion?

Yes: I should be reading more closely.  Please just disregard what I
wrote above.  D'oh.

A couple of minor notes though:
- in case the 'installcheck-not-check' bit is to simulate phony targets,
then that can also be done with
  .PHONY: installcheck-local
- for portability to non-GNU make, and to avoid using internal Automake
details (minor nit: the 'check-TESTS' rule is not public), you could use
this in the rule:

  env LIBCOOP_INCLDIRS='-I$(includedir)' \
      LIBCOOP_LIBDIRS='-L$(libdir)' \
      LIBCOOP_PYPATH='$(bindir)' \
    $(MAKE) $(AM_MAKEFLAGS) -e check

(I'd always quote the path variable expansions BTW).

- for portability to non-GNU make, in these rules
| Master_LDADD = ./ ./
| Slave_LDADD = ./ ./ $(LIBCOOP_LIBDIRS)

drop the leading './' from file names.

> I wasn't aware of the -no-install flag, but my initial guess would've
> been that it would go on the libraries, not the binary.

Well, putting it on the binary enables you to link against libraries
which you are going to install later.  Conversely, if you have a library
that you intend not to install, and you are linking a program against
it, then installing the program later may cause trouble if that library
is shared[1]; that's why noinst_LTLIBRARIES are static archives by


[1] installed program with run path pointing to build tree, for example.

reply via email to

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