comp.lang.ada
 help / color / mirror / Atom feed
* Detecting version of installed GNAT
@ 2005-11-12 13:21 Marc A. Criley
  2005-11-12 13:59 ` Jeff Creem
  2005-11-12 14:18 ` Pascal Obry
  0 siblings, 2 replies; 8+ messages in thread
From: Marc A. Criley @ 2005-11-12 13:21 UTC (permalink / raw)


I'm looking for suggestions for programatically determining what version of 
GNAT is installed on a system.

I'd hoped there was something like "gnatmake -v" that would just display a 
version string, but gnatmake doesn't have that feature.  I could use "gcc 
-v" and then deduce from its version what version of GNAT was installed, 
but I'd prefer something more closely tied to GNAT itself.  And since some 
distributions of gnat use "gnatcc" instead of "gcc", I'd have to account 
for that as well.

It looks like I could compile a small file and then look at its .ali file, 
since that contains a compiler version string, but I'd still like to see 
something a little more direct.

Thanks for any suggestions.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 13:21 Detecting version of installed GNAT Marc A. Criley
@ 2005-11-12 13:59 ` Jeff Creem
  2005-11-12 14:18   ` Ed Falis
  2005-11-12 14:18 ` Pascal Obry
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff Creem @ 2005-11-12 13:59 UTC (permalink / raw)


Marc A. Criley wrote:
> I'm looking for suggestions for programatically determining what version 
> of GNAT is installed on a system.
> 
> I'd hoped there was something like "gnatmake -v" that would just display 
> a version string, but gnatmake doesn't have that feature.  I could use 
> "gcc -v" and then deduce from its version what version of GNAT was 
> installed, but I'd prefer something more closely tied to GNAT itself.  
> And since some distributions of gnat use "gnatcc" instead of "gcc", I'd 
> have to account for that as well.
> 
> It looks like I could compile a small file and then look at its .ali 
> file, since that contains a compiler version string, but I'd still like 
> to see something a little more direct.
> 
> Thanks for any suggestions.
> 
> -- Marc A. Criley
> -- McKae Technologies
> -- www.mckae.com
> -- DTraq - XPath In Ada - XML EZ Out
> 

Perhaps something like

gnatlink -v | grep GNATLINK

There is info in that for both FSF derived versions and GNAT GPL 
versions...Though its form is pretty different in each case.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 13:59 ` Jeff Creem
@ 2005-11-12 14:18   ` Ed Falis
  2005-11-12 20:24     ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Ed Falis @ 2005-11-12 14:18 UTC (permalink / raw)


Try

gnatls -v



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 13:21 Detecting version of installed GNAT Marc A. Criley
  2005-11-12 13:59 ` Jeff Creem
@ 2005-11-12 14:18 ` Pascal Obry
  2005-11-12 17:42   ` Björn Persson
  2005-11-14 13:28   ` Marc A. Criley
  1 sibling, 2 replies; 8+ messages in thread
From: Pascal Obry @ 2005-11-12 14:18 UTC (permalink / raw)
  To: Marc A. Criley

Marc,

All gnat tools have a -v option. The version number is displayed just
after the tool name. Isn't that what you are looking for ?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 14:18 ` Pascal Obry
@ 2005-11-12 17:42   ` Björn Persson
  2005-11-14 13:28   ` Marc A. Criley
  1 sibling, 0 replies; 8+ messages in thread
From: Björn Persson @ 2005-11-12 17:42 UTC (permalink / raw)


Pascal Obry wrote:
> All gnat tools have a -v option. The version number is displayed just
> after the tool name. Isn't that what you are looking for ?

-v seems to mean "verbose" rather than "version".

The simplest way seems to be "gnat | head -n 1".

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 14:18   ` Ed Falis
@ 2005-11-12 20:24     ` Simon Wright
  2005-11-14  8:39       ` Alex R. Mosteo
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2005-11-12 20:24 UTC (permalink / raw)


"Ed Falis" <falis@verizon.net> writes:

> Try
>
> gnatls -v

The rules are something like:

If the second 'word' in the output line containing GNATLS is:

    GPL it's a GPL compiler

    Pro it's a Professional (supported) release

    I haven't seen what happens with GAP releases but I would expect
    GAP

and in all these cases the 3rd word is the release.

Otherwise, the second word is the release.

Here, I see

GNATLS GPL 2005 ...
GNATLS 4.0.0
GNATLS 3.15p ...
GNATLS Pro 3.16a1 ...
GNATLS Pro 5.02a1 ...



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 20:24     ` Simon Wright
@ 2005-11-14  8:39       ` Alex R. Mosteo
  0 siblings, 0 replies; 8+ messages in thread
From: Alex R. Mosteo @ 2005-11-14  8:39 UTC (permalink / raw)


Simon Wright wrote:
> "Ed Falis" <falis@verizon.net> writes:
> 
> 
>>Try
>>
>>gnatls -v
> 
> 
> The rules are something like:
> 
> If the second 'word' in the output line containing GNATLS is:
> 
>     GPL it's a GPL compiler
> 
>     Pro it's a Professional (supported) release
> 
>     I haven't seen what happens with GAP releases but I would expect
>     GAP

GNATLS GAP 2005 (20050615)

> and in all these cases the 3rd word is the release.
> 
> Otherwise, the second word is the release.
> 
> Here, I see
> 
> GNATLS GPL 2005 ...
> GNATLS 4.0.0
> GNATLS 3.15p ...
> GNATLS Pro 3.16a1 ...
> GNATLS Pro 5.02a1 ...



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Detecting version of installed GNAT
  2005-11-12 14:18 ` Pascal Obry
  2005-11-12 17:42   ` Björn Persson
@ 2005-11-14 13:28   ` Marc A. Criley
  1 sibling, 0 replies; 8+ messages in thread
From: Marc A. Criley @ 2005-11-14 13:28 UTC (permalink / raw)


Pascal Obry wrote:
> Marc,
> 
> All gnat tools have a -v option. The version number is displayed just
> after the tool name. Isn't that what you are looking for ?

Doh!

gnatmake -v DOES show the version in the first output line.  It just 
then immediately follows it with all the Usage information.  And typing 
gnatmake alone shows all the Usage information.

As I simply saw all the Usage information scroll by when trying gnatmake 
-v, I didn't look it at closely enough, until after seeing Pascal's 
comment, to notice that the first non-blank line is in fact different. 
It's "GNATMAKE" followed by the version number, which is sufficent for 
my needs.

(Since I need to programatically invoke gnatmake, using that to as the 
source of the version is the most appropriate.)

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-14 13:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-12 13:21 Detecting version of installed GNAT Marc A. Criley
2005-11-12 13:59 ` Jeff Creem
2005-11-12 14:18   ` Ed Falis
2005-11-12 20:24     ` Simon Wright
2005-11-14  8:39       ` Alex R. Mosteo
2005-11-12 14:18 ` Pascal Obry
2005-11-12 17:42   ` Björn Persson
2005-11-14 13:28   ` Marc A. Criley

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