* gcc.c (getenv_spec_function): New function.
[official-gcc.git] / gcc / ada / g-comver.ads
blob33494202f7e24c6f4581248a04a5c56af166784b
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- G N A T . C O M P I L E R _ V E R S I O N --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2002-2005, AdaCore --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package provides a routine for obtaining the version number of the
35 -- GNAT compiler used to compile the program. It relies on the generated
36 -- constant in the binder generated package that records this information.
38 -- Note: to use this package you must first instantiate it, for example:
40 -- package CVer is new GNAT.Compiler_Version;
42 -- and then you use the function in the instantiated package (Cver.Version).
43 -- The reason that this unit is generic is that otherwise the direct attempt
44 -- to import the necessary variable from the binder file causes trouble when
45 -- building a shared library, since the symbol is not available.
47 -- Note: this unit is only useable if the main program is written in Ada.
48 -- It cannot be used if the main program is written in foreign language.
50 generic
51 package GNAT.Compiler_Version is
52 pragma Pure;
54 function Version return String;
55 -- This function returns the version in the form "v.vvx (yyyyddmm)".
56 -- Here v.vv is the main version number (e.g. 3.16), x is the version
57 -- designator (e.g. a1 in 3.16a1), and yyyyddmm is the date in ISO form.
58 -- An example of the returned value would be "3.16w (20021029)". The
59 -- version is actually that of the binder used to bind the program,
60 -- which will be the same as the compiler version if a consistent
61 -- set of tools is used to build the program.
63 end GNAT.Compiler_Version;