comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <bjorn@xn--rombobjrn-67a.se>
Subject: Re: architecture-independent GNAT project files?
Date: Thu, 30 Apr 2009 14:17:23 +0200
Date: 2009-04-30T14:17:23+02:00	[thread overview]
Message-ID: <75tj6jF19ngl2U1@mid.individual.net> (raw)
In-Reply-To: 1xrnblwdskgjg$.1v3turpillxav$.dlg@40tude.net

Dmitry A. Kazakov wrote:

> On Mon, 27 Apr 2009 23:16:13 +0200, Bj�rn Persson wrote:
> 
>> The analog for my case would be:
>> 
>>    type Architecture is ("i386", "x86_64");
>>    Target : Architecture := external ("Target", "i386");
>> 
>> The problem with that is of course that on x86_64 systems the default
>> will almost always be wrong, and if I set the default to x86_64 it will
>> be wrong on i386 systems.
> 
> New GPS remembers the last choices of the project variables (well almost
> always (:-)). So it should not be a great problem. Of course object and
> executable files have to land into disparate directories (switched by the
> same variable).

I'm not writing for GPS only. I want commands like "gnatmake -P project" to
do the right thing without additional parameters.

If I use a global environment variable I will at least be right for the
common case of compiling for the native platform.

>> The cross-compiler would know its target platform and would assign that
>> value to the hypothetical variable. The project file would then select
>> the right library directories for that platform.
> 
> Hmm, I see no obvious way to do it. In my case there are several GNAT
> compilers installed. The project variable Platform chooses the compiler as
> well. For example, I have:
> 
>    package Ide is
>       case Platform is
>          when "x86_Windows" =>
>             for Gnatlist use "gnatls";
>             for Gnat use "gnat";
>             for Compiler_Command ("ada") use "gnatmake";
>             for Debugger_Command use "gdb";
>          when "x86_VxWorks" =>
>             for Gnatlist use "i586-wrs-vxworks-gnatls";
>             for Gnat use "i586-wrs-vxworks-gnat";
>             for Compiler_Command ("ada") use "i586-wrs-vxworks-gnatmake";
>             for Debugger_Command use "i586-wrs-vxworks6-gdb";
>       end case;
>    end Ide;
> 
> This changes gnatlist, gnat, gnatmake, everything...

Is that a new feature that hasn't been merged into GCC yet? I don't see
those attributes in the GNAT User's Guide of GCC 4.4.0.

Are those attributes only for GPS or does the "gnat" driver actually invoke
the VxWorks version of itself if you run
"gnat -P project -XPlatform=x86_VxWorks"?

I was thinking you'd run "i586-wrs-vxworks-gnatmake -P project" from a
command prompt, and i586-wrs-vxworks-gnatmake would set Platform
to "x86_VxWorks" (or more likely "i586-wrs-vxworks").

-- 
Bj�rn Persson
PGP key A88682FD



  parent reply	other threads:[~2009-04-30 12:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27  7:32 architecture-independent GNAT project files? Björn Persson
2009-04-27  8:02 ` Dmitry A. Kazakov
2009-04-27 21:16   ` Björn Persson
2009-04-27 21:55     ` Ludovic Brenta
2009-04-28 21:41       ` Björn Persson
2009-04-28  7:24     ` Dmitry A. Kazakov
2009-04-28 20:56       ` sjw
2009-04-30 12:17       ` Björn Persson [this message]
2009-04-30 12:31         ` Ludovic Brenta
2009-04-27 12:06 ` anon
2009-04-27 19:10   ` sjw
replies disabled

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