[Top][All Lists]

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

Re: allowing users to add source files without rerunning the autotools?

From: Stefano Lattarini
Subject: Re: allowing users to add source files without rerunning the autotools?
Date: Wed, 18 Jan 2012 20:58:37 +0100

On 01/18/2012 08:09 PM, Bill Sacks wrote:
> Hi Stefano,
> Thank you very much for your fast and very helpful reply. This
> looks like a clever solution.  However, I should have been more
> clear: In my prototype, Srcfiles is a static file, but in our
> actual build system, Srcfiles will be generated by a rule in the
> makefile.
This would complicate the implementation, but it would still be
possible to make things work anyway (you'll have to be more
careful to avoid potential circular dependencies, tough).  But
see below.

> (In particular: we use a script to find all user-created
> source files in a number of pre-defined locations.) Please correct
> me if I'm wrong, but my understanding is that your proposed solution
> can't be extended to that case. 
It might be extended; the problem is that your users will be required
to have the autmake and autoconf installed themselves, which is quite
against the philosophy of the autotools :-(

So scrap my suggestion.  We should try to find a better way to proceed.

> Actually, the fundamental problem that I'm trying to address here
> is just that: Can we use an autotools-based build and still allow
> for user-created source files that are unknown until build time,
> and if so, what is the most robust way to do that?
Ah, now that you put it this way, the problem is clearer.

First part of the answer: since autoconf doesn't require the use of
automake, you could start your conversion by introducing the use of
autoconf in the "configuration" part of your build system, keeping the
modifications to the rest of it as small as possible (in particular,
no automake at first).  This would be a useful step by itself, even if
you end up not using automake after all.

Second part of the answer: I don't really know whether it's possible to
implement what ask in a sane way (I've never thought about the problem
before).  Maybe we could cook up some hack that does what you want and
require only current automake features; maybe not.  If we can do so, that
would make a lovely addition to the automake manual.  I'll think about
the problem in the next days.

>>> And are there fundamental problems with automake not knowing all
>>> of the source
>>> files?
>> Yes; definitely yes.  See the automake manual for more details (I'd give you
>> a more precise link, but today it seems that has "gone dark to raise
>> awareness agains SOPA and PIPA bills").
> I assume you're referring to the section describing why automake doesn't
> support wildcards, which I have seen. I was hoping this meant that, "to
> the extent that you list source files, they need to be listed explicitly".
No, it means "you have to list all your source files, period." :-(  Sorry.

Here is an excerpt from the manual that should make this clean (from the
paragraph 8.3.1 "Conditional compilation of sources"):

  Automake must know all the source files that could possibly go into a
  program, even if not all the files are built in every circumstance.

> But your statement supports the alternative, and more likely, interpretation,
> which is that automake has to know about all source files in order to work
> correctly.
Basically, this is the correct interpretation.

> Thanks again,
> Bill

Regards, and HTH,

reply via email to

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