[Gnome-devtools] Abstracting Build Systems



Ok, Ed's last email helped me clarify a few things so here goes...

First lets try to define a few terms in an abstract sense (NB. these are
very rough):

source = provider of functionality (even if the functionality is
internal to the source)
target = a group of dependent sources that form a user runnable program
(interpreted or whatever).  May rely on libraries.
library = external, independent provider of functionality to targets
project = a group of targets that logically form an association

As far as I know, the concepts of sources, targets, projects and
libraries apply to every build system we've discussed:

1. Auto*
2. Imake
3. Make (plain 'ol)
4. Java
5. M$ VS

Defining anything else specific for an abstract interface would seem to
favour one build system over another.  This gives rise to
"configurations" similar to those mentioned by Ed.  Things like c flags,
ld flags and the like (for autoconf) can be handled by the backends via
calls in the abstract interface that just hand off to the backends. The
abstract interface should allow configurations to be associated with
projects or targets.  That being said, it almost appears as though we
really want an abstract class that each backend derives from rather than
two separate layers.

Now, the stickiest issue is how to handle adding libraries to a target
:-)

The backends know best how to really implement the addition of libraries
to targets.  However, the discovery of library availability is really
language dependent (ie. C/C++ libraries can be found with ldd, java ones
with classpaths, python ones in another way) rather than build system
dependent. 

So, gnome-build can probably build library lists with dependencies in a
language specific manner, we'll need to code this but for a lot of key
languages, this should be fairly straightforward.  For auto*, autoc*
needs to provide a mapping internally from libraries to macros.  If it
can map this stuff (say -lbonobo to GNOME_BONOBO_CHECKS and BONOBO_LIBS)
then it should, if it can't it can use a default handler to add -lbonobo
to LD_FLAGS of the target.  The auto* backend will also need to define
the languages it can handle and will probably need to handle various
libraries in different ways.

This is quite fleshed out, but hoepfully its thorough enough for
comments.

-JP
-- 
=======================================================================
JP Rosevear				jpr arcavia com
Arcavia Software Ltd.			http://www.arcavia.com
(905) 853-7714




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