OSDN Git Service

2004-05-03 Olivier Hainque <hainque@act-europe.fr>
[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 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 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,  59 Temple Place - Suite 330,  Boston, --
20 -- MA 02111-1307, USA.                                                      --
21 --                                                                          --
22 -- GNAT was originally developed  by the GNAT team at  New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 with GNAT.OS_Lib; use GNAT.OS_Lib;
28 with Osint;
29 with Prj;         use Prj;
30
31 package Makeutl is
32
33    type Fail_Proc is access procedure
34      (S1 : String; S2 : String := ""; S3 : String := "");
35    Do_Fail : Fail_Proc := Osint.Fail'Access;
36
37
38    function Is_External_Assignment (Argv : String) return Boolean;
39    --  Verify that an external assignment switch is syntactically correct.
40    --  Correct forms are
41    --      -Xname=value
42    --      -X"name=other value"
43    --  Assumptions: 'First = 1, Argv (1 .. 2) = "-X"
44    --  When this function returns True, the external assignment has
45    --  been entered by a call to Prj.Ext.Add, so that in a project
46    --  file, External ("name") will return "value".
47
48    --  Package Mains is used to store the mains specified on the command line
49    --  and to retrieve them when a project file is used, to verify that the
50    --  files exist and that they belong to a project file.
51
52    function Linker_Options_Switches (Project  : Project_Id) return String_List;
53
54    package Mains is
55
56       --  Mains are stored in a table. An index is used to retrieve the mains
57       --  from the table.
58
59       procedure Add_Main (Name : String);
60       --  Add one main to the table
61
62       procedure Delete;
63       --  Empty the table
64
65       procedure Reset;
66       --  Reset the index to the beginning of the table
67
68       function Next_Main return String;
69       --  Increase the index and return the next main.
70       --  If table is exhausted, return an empty string.
71
72       function Number_Of_Mains return Natural;
73       --  Returns the number of mains added with Add_Main since the last call
74       --  to Delete.
75
76    end Mains;
77
78    procedure Test_If_Relative_Path
79      (Switch             : in out String_Access;
80       Parent             : String_Access;
81       Including_L_Switch : Boolean := True);
82    --  Test if Switch is a relative search path switch.
83    --  If it is, fail if Parent is null, otherwise prepend the path with
84    --  Parent. This subprogram is only called when using project files.
85    --  For gnatbind switches, Including_L_Switch is False, because the
86    --  argument of the -L switch is not a path.
87
88 end Makeutl;