1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 2001-2002 Free Software Foundation, Inc --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 -- This package implements services for Project-aware tools, related
29 -- to the environment (gnat.adc, ADA_INCLUDE_PATH, ADA_OBJECTS_PATH)
31 with GNAT
.OS_Lib
; use GNAT
.OS_Lib
;
36 -- Put Standard_Naming_Data into Namings table (called by Prj.Initialize)
38 procedure Print_Sources
;
39 -- Output the list of sources, after Project files have been scanned
41 procedure Create_Mapping_File
(Name
: in out Temp_File_Name
);
42 -- Create a temporary mapping file. For each unit, put the mapping of
43 -- its spec and or body to its file name and path name in this file.
45 procedure Set_Mapping_File_Initial_State_To_Empty
;
46 -- When creating a mapping file, create an empty map. This case occurs
47 -- when run time source files are found in the project files.
49 procedure Create_Config_Pragmas_File
50 (For_Project
: Project_Id
;
51 Main_Project
: Project_Id
);
52 -- If there needs to have SFN pragmas, either for non standard naming
53 -- schemes or for individual units, or if Global_Configuration_Pragmas
54 -- has been specified in package gnatmake of the main project, or if
55 -- Local_Configuration_Pragmas has been specified in package Compiler
56 -- of the main project, build (if needed) a temporary file that contains
57 -- all configuration pragmas, and specify the configuration pragmas file
58 -- in the project data.
60 function Ada_Include_Path
(Project
: Project_Id
) return String_Access
;
61 -- Get the ADA_INCLUDE_PATH of a Project file. For the first call, compute
64 function Ada_Include_Path
65 (Project
: Project_Id
;
68 -- Get the ADA_INCLUDE_PATH of a Project file. If Recursive it True,
69 -- get all the source directories of the imported and modified project
70 -- files (recursively). If Recursive is False, just get the path for the
71 -- source directories of Project. Note: the resulting String may be empty
72 -- if there is no source directory in the project file.
74 function Ada_Objects_Path
75 (Project
: Project_Id
;
76 Including_Libraries
: Boolean := True)
78 -- Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute
79 -- it and cache it. When Including_Libraries is False, do not include the
80 -- object directories of the library projects, and do not cache the result.
82 function Path_Name_Of_Library_Unit_Body
86 -- Returns the Path of a library unit.
88 function File_Name_Of_Library_Unit_Body
92 -- Returns the file name of a library unit, in canonical case. Name may or
93 -- may not have an extension (corresponding to the naming scheme of the
94 -- project). If there is no body with this name, but there is a spec, the
95 -- name of the spec is returned. If neither a body or a spec can be found,
96 -- return an empty string.
98 procedure Get_Reference
99 (Source_File_Name
: String;
100 Project
: out Project_Id
;
102 -- Returns the project of a source.
105 with procedure Action
(Path
: String);
106 procedure For_All_Source_Dirs
(Project
: Project_Id
);
107 -- Iterate through all the source directories of a project,
108 -- including those of imported or modified projects.
111 with procedure Action
(Path
: String);
112 procedure For_All_Object_Dirs
(Project
: Project_Id
);
113 -- Iterate through all the object directories of a project,
114 -- including those of imported or modified projects.