[AWS] "AWS install problems" posted on comp.lang.ada

Ludovic Brenta ludovic at ludovic-brenta.org
Sat May 29 22:52:45 CEST 2010


brett hallett <dragoncity at aanet.com.au> writes:
> So from a beginners point of view there are a number of confusing
> project file 'features' :
>
>    the project .gpr file set up is flaky and not consistent !
>
> -- why do capitals cause it problems ?

Because, I believe, file names are case-sensitive on GNU/Linux,
insensitive on Windows, insentitive in Ada and in GNAT Project files,
and GPS tries to support everything.  The naming convention is that all
file names must be lowercase.

> -- why do some project 'for' commands require ( ) and others do not ?

This is explained in the GNAT User's Guide.  Some attributes, like
Source_Dirs, are lists (hence the plural in the name); others, like
Object_Dir, are single values.

> -- why does project save change the 'use' content so dramatically ?
>    ( the Main files list is understandable as I'nm adding new files to
>    process.

GPS does interfere with you editing the project file by hand.  I learned
the hard way not to mix hand-editing with the GPS project file
generator.

> -- the whole project / properties is quite complex, and a simple
> beginners set up option would be useful !, leaving the other options
> for when one really need them.

That's what you see in the comments in
/usr/share/ada/adainclude/aws.gpr: a minimal, simple project file
written by hand.

> 	ie: I set General : Name & path ( to my working directory )
>                 & Main    : select the .adb files I wish to process
>               
> 	and leave the rest alone. Now it took me some fiddle time to
> 	figure out this minimum requirement to get a working set up. :-)
>
> ==========================
>
> Now to your real question !!
>
> I think the newcomer is confused when directed to the aws.gpr file for
> an example of 'how to use this project file' because although you see
> the comment , you also see the quite complex aws.gpr setup as well and
> its NOT apparent how this related to YOUR ( my) project.

Uh... you must be a _real_ beginner if you don't understand this:

--  This project file is designed to help build applications that use
--  Ada Web Server.  Here is an example of how to use this project file:
--
--  with "aws.gpr";
--  project Example is
--     for Object_Dir use "obj";
--     for Exec_Dir use ".";
--     for Main use ("example");
--  end Example;

The rest of aws.gpr is irrelevant to you.  What made you think
otherwise?

> Instead of the embedded comment I think you should direct the reader of
> aws.gpr to a small text/doc file which contains an example xxx.gpr &
> xxx.adb files of a working complete program using AWS. I had to trawl
> through lots of documents to figure out as much as I have, and required
> your help as well, so using AWS.GPR is not at all clear in my opinion.

OK, perhaps you can now write the doc and send it to me?

> Here is an example program, which works from GPS and as ./getmail2
> in a Konsole. :-)
>
> ------------------- .prg ------------------
>
> with "aws.gpr";
>
> project trymail is
>
>    for Source_Dirs use ("/home/you/trymail");
>    for Object_Dir  use "/home/you/trymail";
>    for Exec_Dir    use "/home/you/trymail";
>    for Main        use ( "getmail.adb");
>
> end trymail;

You should not use absolute paths in your project files; paths are, by
default, relative to the location of the project file itself.  Using
relative paths makes it possible to build your software in directories
other than the initial one.

[...]
> Your example project file is most likely correct, as long as the
> beginner does not fall into simple traps like I did.

The two simple traps I can see were:

- using both GPS and hand-editing for project files (this is a problem
  inherent with GPS, not with Debian or project files).  You should use
  either GPS or hand-editing but not both.

- using absolute paths in your project files

Apart from those, I do not see exactly what caused your programs to fail
to compile.

-- 
Ludovic Brenta.


More information about the AWS mailing list