summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-env.ads
blob: 36687b46b1ea645b96eba2f3c265e9cf8ce3aa4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
------------------------------------------------------------------------------
--                                                                          --
--                         GNAT COMPILER COMPONENTS                         --
--                                                                          --
--                              P R J . E N V                               --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
--                            $Revision$
--                                                                          --
--             Copyright (C) 2001 Free Software Foundation, Inc.            --
--                                                                          --
-- GNAT is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License  distributed with GNAT;  see file COPYING.  If not, write --
-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
-- MA 02111-1307, USA.                                                      --
--                                                                          --
-- GNAT was originally developed  by the GNAT team at  New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
--                                                                          --
------------------------------------------------------------------------------

--  This package implements services for Project-aware tools, related
--  to the environment (gnat.adc, ADA_INCLUDE_PATH, ADA_OBJECTS_PATH)

with GNAT.OS_Lib; use GNAT.OS_Lib;

package Prj.Env is

   procedure Initialize;
   --  Put Standard_Naming_Data into Namings table (called by Prj.Initialize)

   procedure Print_Sources;
   --  Output the list of sources, after Project files have been scanned

   procedure Create_Mapping_File (Name : in out Temp_File_Name);
   --  Create a temporary mapping file. For each unit, put the mapping of
   --  its spec and or body to its file name and path name in this file.

   procedure Create_Config_Pragmas_File
     (For_Project  : Project_Id;
      Main_Project : Project_Id);
   --  If there needs to have SFN pragmas, either for non standard naming
   --  schemes or for individual units, or if Global_Configuration_Pragmas
   --  has been specified in package gnatmake of the main project, or if
   --  Local_Configuration_Pragmas has been specified in package Compiler
   --  of the main project, build (if needed) a temporary file that contains
   --  all configuration pragmas, and specify the configuration pragmas file
   --  in the project data.

   function Ada_Include_Path (Project : Project_Id) return String_Access;
   --  Get the ADA_INCLUDE_PATH of a Project file. For the first call, compute
   --  it and cache it.

   function Ada_Objects_Path
     (Project             : Project_Id;
      Including_Libraries : Boolean := True)
      return                String_Access;
   --  Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute
   --  it and cache it. When Including_Libraries is False, do not include the
   --  object directories of the library projects, and do not cache the result.

   function Path_Name_Of_Library_Unit_Body
     (Name    : String;
      Project : Project_Id)
      return    String;
   --  Returns the Path of a library unit.

   function File_Name_Of_Library_Unit_Body
     (Name    : String;
      Project : Project_Id)
      return    String;
   --  Returns the file name of a library unit, in canonical case. Name may or
   --  may not have an extension (corresponding to the naming scheme of the
   --  project). If there is no body with this name, but there is a spec, the
   --  name of the spec is returned. If neither a body or a spec can be found,
   --  return an empty string.

   procedure Get_Reference
     (Source_File_Name : String;
      Project          : out Project_Id;
      Path             : out Name_Id);
   --  Returns the project of a source.

   generic
      with procedure Action (Path : String);
   procedure For_All_Source_Dirs (Project : Project_Id);
   --  Iterate through all the source directories of a project,
   --  including those of imported or modified projects.

   generic
      with procedure Action (Path : String);
   procedure For_All_Object_Dirs (Project : Project_Id);
   --  Iterate through all the object directories of a project,
   --  including those of imported or modified projects.

end Prj.Env;