libtool
[Top][All Lists]
Advanced

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

Re: build program before library


From: Ralf Wildenhues
Subject: Re: build program before library
Date: Sat, 20 Jan 2007 10:26:08 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Bob,

* Bob Rossi wrote on Fri, Jan 19, 2007 at 04:19:32PM CET:
> 
> How do I build a program before a library with automake and libtool?
> By default, the library is being built first and that is not what I
> want.

This is an Automake question.  There are several possible answers.
The first note is that libraries aren't necessarily being built
first, in that the Automake-generated Makefile doesn't contain a
dependency relation, unless a certain program links against (and
thus depends on) a certain library.  You may be able to see in a
parallel make build that both are built simultaneously, for example.

If you need the program to create input for the library (e.g., a
parser generator or the like), then you could put those inputs in
BUILT_SOURCES, and list appropriate dependencies on the program in
the Makefile.am.  (Note in this case support for cross-compilation
will complicate your build, since you need both a compiler that
creates code for the $build as well as one for the $host.)

Simpler though, if you merely want the program linked before the
library is created, you could let the library depend on the program.
You may achieve that by overriding libfoo_la_DEPENDENCIES, see
<http://sources.redhat.com/automake/automake.html#Program-and-Library-Variables>.
Be aware that if you do this, you disallow Automake to compute this
variable automatically, so be sure to also put in what it would put
there (see the manual), otherwise you'll be missing dependencies.

Curious though, why do you want or need this order?  Except for the
first case, I don't see a good reason.

Cheers,
Ralf




reply via email to

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