comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: GNAT and GNU build system
Date: Sun, 08 Aug 2004 16:45:15 +0200
Date: 2004-08-08T16:45:22+02:00	[thread overview]
Message-ID: <87n0157kp0.fsf@insalien.org> (raw)
In-Reply-To: xxmQc.1161$256.723@reader1.news.jippii.net

Tapio Kelloniemi writes:
>>Ludovic Brenta writes:
>>
>>> Tapio Kelloniemi writes:
>>> > I would really prefer typing:
>>> > ./configure --prefix=/usr --enable-goldobj
>>>
>>> I understand your concern completely.  My concern, though, is the
>>> sheer complecity of the ./configure script itself, and that of the
>>> Makefile it generates.  Most of that complexity is unnecessary with
>>> Ada programs, and in fact really gets in the way.  With Ada, you would
>>> normally want to take full advantage of GNAT project files.  The only
>>> places where ./configure may be of help are for the installation
>>> target (--prefix), and finding any Ada libraries you depend on.
>
> There are still things that cannot be solved with Ada, consider such
> a real time programming need as memory mapped IO, which is very
> non-portable.

The usual way to do configuration management in Ada in these
situations is to have several bodies for a single spec, and choose one
body when configuring.  This can be done in several ways.  The GNAT
way is to symlink the file containing the particular body to the
canonical name.  For example, one body is "5msystem.ads" and it is
symlinked to "system.ads" before building.  This however is done from
the Makefile and does not, per se, require a configure script.

Another way is to have one target-dependent directory, and pass a
variable to a GNAT project file to select which target-dependent
directory should be added to the Source_Dirs.

A third way, used by GPS, is to write a GNAT configuration file
containing configuration pragmas.  The compiler-specific pragma
Souce_File_Name can associate a body with the selected file.

A fourth way could be to use gnatprep (like Florist does).

> Configure could perhaps generate a Makefile, which runs automake
> with the appropriate GNAT project file (assuming that GNAT is the
> only compiler to support). The project file used could be choosed by 
> configure (eg. if --enable-maintainer-mode is specified, choose 
> debug.gpr, instead super_optimise.gpr).

I would probably be better to use a single project file, and pass
variables on the command line (you can have a case statement in a
project file).

As you can see, there is a lot you can do to influence the build.
Some of this has to be done at configure time; some can be done from
within the Makefile.

I think that the general idea is to have a minimal configure script
that only does what is strictly necessary, i.e. generates the
Makefile.  I do not like GNU configure because it tries to be
everything to all developers, and ends up in unmaintainable and
unnecessary complexity.

If the Makefile can be written in a portable way, then I would prefer
not to have a configure script at all (or a no-op configure script, to
please people with pavlovian reflexes).

-- 
Ludovic Brenta.



  reply	other threads:[~2004-08-08 14:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-03 19:36 GNAT and GNU build system Tapio Kelloniemi
2004-08-03 20:12 ` Jerome Hugues
2004-08-04  2:05 ` Lutz Donnerhacke
2004-08-04  7:49   ` Tapio Kelloniemi
2004-08-04 13:33     ` Mark H Johnson
2004-08-04 16:04       ` Georg Bauhaus
2004-08-04 19:21         ` Ludovic Brenta
2004-08-04 20:29         ` Tapio Kelloniemi
2004-08-05  2:15           ` Georg Bauhaus
2004-08-06 10:26             ` Stephen Leake
2004-08-06 15:36               ` Georg Bauhaus
2004-08-14  6:00                 ` Tapio Kelloniemi
2004-08-14 11:32                   ` Ludovic Brenta
2004-08-14 14:41                   ` Georg Bauhaus
2004-08-04 20:06       ` Tapio Kelloniemi
2004-08-04 20:34         ` Ludovic Brenta
2004-08-04 22:11           ` Stephen Leake
2004-08-05  8:50             ` Tapio Kelloniemi
2004-08-08 14:45               ` Ludovic Brenta [this message]
2004-08-10 16:18                 ` Nick Roberts
2004-08-12 13:56   ` Florian Weimer
2004-08-13 15:52     ` Lutz Donnerhacke
2004-08-04 22:06 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox