From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,15d78a51b0d35cec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn?= Persson Newsgroups: comp.lang.ada Subject: Re: architecture-independent GNAT project files? Date: Thu, 30 Apr 2009 14:17:23 +0200 Message-ID: <75tj6jF19ngl2U1@mid.individual.net> References: <75l5ceF18samiU1@mid.individual.net> <75mlktF1979j6U1@mid.individual.net> <1xrnblwdskgjg$.1v3turpillxav$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit X-Trace: individual.net AhLDxP+XmEUzoQGZaFopNwPvR6pGP+DRY6eahbIPT7yt5+xxx0 Cancel-Lock: sha1:1XiecicfjEDaTr/durJWcoUwTPo= User-Agent: KNode/0.10.9 Xref: g2news2.google.com comp.lang.ada:5625 Date: 2009-04-30T14:17:23+02:00 List-Id: 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