OSDN Git Service

Remove s-crtl-vms64.ads, no longer used.
[pf3gnuchains/gcc-fork.git] / gcc / ada / makeutl.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              M A K E U T L                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2004-2007, Free Software Foundation, Inc.         --
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 3,  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 COPYING3.  If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license.          --
20 --                                                                          --
21 -- GNAT was originally developed  by the GNAT team at  New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
23 --                                                                          --
24 ------------------------------------------------------------------------------
25
26 with Namet; use Namet;
27 with Osint;
28 with Prj;   use Prj;
29 with Types; use Types;
30
31 with GNAT.OS_Lib; use GNAT.OS_Lib;
32
33 package Makeutl is
34
35    type Fail_Proc is access procedure
36      (S1 : String;
37       S2 : String := "";
38       S3 : String := "");
39    Do_Fail : Fail_Proc := Osint.Fail'Access;
40    --  Failing procedure called from procedure Test_If_Relative_Path below.
41    --  May be redirected.
42
43    Project_Tree : constant Project_Tree_Ref := new Project_Tree_Data;
44    --  The project tree
45
46    Main_Config_Project : Project_Id;
47    --  The project id of the main configuration project
48
49    procedure Add
50      (Option : String_Access;
51       To     : in out String_List_Access;
52       Last   : in out Natural);
53    procedure Add
54      (Option : String;
55       To     : in out String_List_Access;
56       Last   : in out Natural);
57    --  Add a string to a list of strings
58
59    function Create_Name (Name : String) return File_Name_Type;
60    function Create_Name (Name : String) return Name_Id;
61    function Create_Name (Name : String) return Path_Name_Type;
62    --  Get the Name_Id of a name
63
64    function Executable_Prefix_Path return String;
65    --  Return the absolute path parent directory of the directory where the
66    --  current executable resides, if its directory is named "bin", otherwise
67    --  return an empty string.
68
69    procedure Inform (N : Name_Id := No_Name; Msg : String);
70    procedure Inform (N : File_Name_Type; Msg : String);
71    --  Prints out the program name followed by a colon, N and S
72
73    function Is_External_Assignment (Argv : String) return Boolean;
74    --  Verify that an external assignment switch is syntactically correct
75    --
76    --  Correct forms are:
77    --
78    --      -Xname=value
79    --      -X"name=other value"
80    --
81    --  Assumptions: 'First = 1, Argv (1 .. 2) = "-X"
82    --  When this function returns True, the external assignment has
83    --  been entered by a call to Prj.Ext.Add, so that in a project
84    --  file, External ("name") will return "value".
85
86    function Linker_Options_Switches
87      (Project  : Project_Id;
88       In_Tree  : Project_Tree_Ref) return String_List;
89    --  Collect the options specified in the Linker'Linker_Options attributes
90    --  of project Project, in project tree In_Tree, and in the projects that
91    --  it imports directly or indirectly, and returns the result.
92
93    --  Package Mains is used to store the mains specified on the command line
94    --  and to retrieve them when a project file is used, to verify that the
95    --  files exist and that they belong to a project file.
96
97    function Unit_Index_Of (ALI_File : File_Name_Type) return Int;
98    --  Find the index of a unit in a source file. Return zero if the file
99    --  is not a multi-unit source file.
100
101    package Mains is
102
103       --  Mains are stored in a table. An index is used to retrieve the mains
104       --  from the table.
105
106       procedure Add_Main (Name : String);
107       --  Add one main to the table
108
109       procedure Delete;
110       --  Empty the table
111
112       procedure Reset;
113       --  Reset the index to the beginning of the table
114
115       function Next_Main return String;
116       --  Increase the index and return the next main.
117       --  If table is exhausted, return an empty string.
118
119       function Number_Of_Mains return Natural;
120       --  Returns the number of mains added with Add_Main since the last call
121       --  to Delete.
122
123    end Mains;
124
125    procedure Test_If_Relative_Path
126      (Switch               : in out String_Access;
127       Parent               : String_Access;
128       Including_L_Switch   : Boolean := True;
129       Including_Non_Switch : Boolean := True);
130    --  Test if Switch is a relative search path switch.
131    --  If it is, fail if Parent is null, otherwise prepend the path with
132    --  Parent. This subprogram is only called when using project files.
133    --  For gnatbind switches, Including_L_Switch is False, because the
134    --  argument of the -L switch is not a path.
135
136    ----------------------
137    -- Marking Routines --
138    ----------------------
139
140    procedure Mark (Source_File : File_Name_Type; Index : Int := 0);
141    --  Mark a unit, identified by its source file and, when Index is not 0,
142    --  the index of the unit in the source file. Marking is used to signal
143    --  that the unit has already been inserted in the Q.
144
145    function Is_Marked
146      (Source_File : File_Name_Type;
147       Index       : Int := 0) return Boolean;
148    --  Returns True if the unit was previously marked
149
150    procedure Delete_All_Marks;
151    --  Remove all file/index couples marked
152
153 end Makeutl;