comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: How to get GNAT version during build process
Date: Thu, 5 Jan 2012 21:45:02 -0800 (PST)
Date: 2012-01-05T21:45:02-08:00	[thread overview]
Message-ID: <17cd8808-bbcf-4c15-b0a1-de4bf7a110b4@p16g2000yqd.googlegroups.com> (raw)

How would one discover the version of GNAT used in a build? I'm
inquiring for someone using cmake. They have cobbled something
together but I get the feeling it is too brittle and requires manual
updating from time to time. Here is the patch that someone submitted:


diff -up plplot-5.9.9/cmake/modules/ada.cmake.gnat plplot-5.9.9/cmake/
modules/ada.cmake
--- plplot-5.9.9/cmake/modules/ada.cmake.gnat	2011-10-12
18:43:01.000000000 -0600
+++ plplot-5.9.9/cmake/modules/ada.cmake	2012-01-04 08:58:11.501470982
-0700
@@ -43,7 +43,7 @@ if(ENABLE_ada)
 endif(ENABLE_ada)

 if(ENABLE_ada)
-  find_library(GNAT_LIB NAMES gnat gnat-4.5 gnat-4.4 gnat-4.3
gnat-4.2 gnat-4.1)
+  find_library(GNAT_LIB NAMES gnat gnat-4.7 gnat-4.6 gnat-4.5
gnat-4.4 gnat-4.3 gnat-4.2 gnat-4.1)
   if(NOT GNAT_LIB)
     message(STATUS "WARNING: "
       "gnat library not found. Disabling ada bindings")


I stumbled across
GNAT.Compiler_Version (g-comver.ads)
in the GNAT library but when I ran this

with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Compiler_Version;
procedure ada_version is
    package CVer is new GNAT.Compiler_Version;
    use Cver;
begin
    Put_Line(Version);
end ada_version;

all I got was this

GPL 2010 (20100603)

whereas g-comver.ads promises a  result in this format

v.vvx (yyyyddmm)"

where v.vv would be something like 3.16.

Jerry



             reply	other threads:[~2012-01-06  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06  5:45 Jerry [this message]
2012-01-06  8:32 ` How to get GNAT version during build process Simon Wright
replies disabled

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