summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-ext.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:39:33 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:39:33 +0000
commitdbc3c2290abf6baf4182deb8549e0ae27f924a3d (patch)
tree42154a73ebb6b14dd56ca33611abdbb14e1ac2ef /gcc/ada/prj-ext.adb
parent0cd40f501f295050d3d846506c5eb7f5e439b89a (diff)
downloadgcc-dbc3c2290abf6baf4182deb8549e0ae27f924a3d.tar.gz
2007-08-14 Vincent Celier <celier@adacore.com>
* prj.ads, prj.adb: Update Project Manager to new attribute names for gprbuild. Allow all valid declarations in configuration project files (Reset): Initialize all tables and hash tables in the project tree data Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. (Slash_Id): Change type to be Path_Name_Type (Slash): Return a Path_Name_Type instead of a File_Name_Type * prj-attr.ads, prj-attr.adb: Remove attributes no longer used by gprbuild. Update Project Manager to new attribute names for ghprbuild Allow all valid declarations in configuration project files Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. * prj-com.ads: Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. * prj-dect.adb (Prj.Strt.Attribute_Reference): Set correctly the case insensitive flag for attributes with optional index. (Prj.Dect.Parse_Attribute_Declaration): For case insensitive associative array attribute, put the index in lower case. Update Project Manager to new attribute names for ghprbuild Allow all valid declarations in configuration project files Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. * prj-env.ads, prj-env.adb: Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. (Get_Reference): Change type of parameter Path to Path_Name_Type * prj-ext.ads, prj-ext.adb (Initialize_Project_Path): Make sure, after removing '-' from the path to start with the first character of the next directory. Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. * prj-nmsc.ads, prj-nmsc.adb: Update Project Manager to new attribute names for ghprbuild Allow all valid declarations in configuration project files (Search_Directories): Detect subunits that are specified with an attribute Body in package Naming. Do not replace a source/unit in the same project when the order of the source dirs are known. Detect duplicate sources/units in the same project when the order of the source dirs are not known. (Check_Ada_Name): Allow all identifiers that are not reserved words in Ada 95. Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. (Look_For_Sources): If the list of sources is empty, set the object directory of non extending project to nil. Change type of path name variables to be Path_Name_Type (Locate_Directory): Make sure that on Windows '/' is converted to '\', otherwise creating missing directories will fail. * prj-attr-pm.adb, prj-tree.ads, prj-proc.ads, prj-proc.adb, prj-part.ads, prj-part.adb: Major update of the Project Manager and of the project aware tools, including gprmake, so that the same sources in the GNAT repository can be used by gprbuild. * prj-strt.adb (Prj.Strt.Attribute_Reference): Set correctly the case insensitive flag for attributes with optional index. (Prj.Dect.Parse_Attribute_Declaration): For case insensitive associative array attribute, put the index in lower case. (Parse_Variable_Reference): Allow the current project name to be used in the prefix of an attribute reference. * prj-util.ads, prj-util.adb (Value_Of (for arrays)): New Boolean parameter Force_Lower_Case_Index, defaulted to False. When True, always check against indexes in lower case. * snames.ads, snames.h, snames.adb: Update Project Manager to new attribute names for gprbuild Allow all valid declarations in configuration project files git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127420 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-ext.adb')
-rw-r--r--gcc/ada/prj-ext.adb63
1 files changed, 37 insertions, 26 deletions
diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb
index 4ab0a905322..557f11c8087 100644
--- a/gcc/ada/prj-ext.adb
+++ b/gcc/ada/prj-ext.adb
@@ -29,14 +29,14 @@ with Makeutl; use Makeutl;
with Output; use Output;
with Osint; use Osint;
with Sdefault;
+with Table;
with GNAT.HTable;
package body Prj.Ext is
- Gpr_Project_Path : constant String := "GPR_PROJECT_PATH";
Ada_Project_Path : constant String := "ADA_PROJECT_PATH";
- -- Name of the env. variables that contain path name(s) of directories
+ -- Name of alternate env. variable that contain path name(s) of directories
-- where project files may reside. GPR_PROJECT_PATH has precedence over
-- ADA_PROJECT_PATH.
@@ -67,6 +67,7 @@ package body Prj.Ext is
-- first for external reference in this table, before checking the
-- environment. Htable is emptied (reset) by procedure Reset.
+ ---------
package Search_Directories is new Table.Table
(Table_Component_Type => Name_Id,
Table_Index_Type => Natural,
@@ -76,7 +77,6 @@ package body Prj.Ext is
Table_Name => "Prj.Ext.Search_Directories");
-- The table for the directories specified with -aP switches
- ---------
-- Add --
---------
@@ -97,6 +97,7 @@ package body Prj.Ext is
Htable.Set (The_Key, The_Value);
end Add;
+ -----------
----------------------------------
-- Add_Search_Project_Directory --
----------------------------------
@@ -108,7 +109,6 @@ package body Prj.Ext is
Search_Directories.Append (Name_Find);
end Add_Search_Project_Directory;
- -----------
-- Check --
-----------
@@ -140,28 +140,22 @@ package body Prj.Ext is
Last : Positive;
New_Len : Positive;
New_Last : Positive;
- Prj_Path : String_Access := null;
+ Prj_Path : String_Access := Gpr_Prj_Path;
begin
- if Gpr_Prj_Path.all /= "" then
- if Hostparm.OpenVMS then
- Prj_Path := To_Canonical_Path_Spec ("GPR_PROJECT_PATH:");
- else
- Prj_Path := To_Canonical_Path_Spec (Gpr_Prj_Path.all);
- end if;
+ if Get_Mode = Ada_Only then
+ if Gpr_Prj_Path.all /= "" then
- -- Warn if both environment variables are defined
+ -- Warn if both environment variables are defined
- if Ada_Prj_Path.all /= "" then
- Write_Line ("Warning: ADA_PROJECT_PATH is not taken into account");
- Write_Line (" when GPR_PROJECT_PATH is defined");
- end if;
+ if Ada_Prj_Path.all /= "" then
+ Write_Line
+ ("Warning: ADA_PROJECT_PATH is not taken into account");
+ Write_Line (" when GPR_PROJECT_PATH is defined");
+ end if;
- elsif Ada_Prj_Path.all /= "" then
- if Hostparm.OpenVMS then
- Prj_Path := To_Canonical_Path_Spec ("ADA_PROJECT_PATH:");
else
- Prj_Path := To_Canonical_Path_Spec (Ada_Prj_Path.all);
+ Prj_Path := Ada_Prj_Path;
end if;
end if;
@@ -179,9 +173,9 @@ package body Prj.Ext is
(Get_Name_String (Search_Directories.Table (J)));
end loop;
- -- If environment variable is defined, add its content
+ -- If environment variable is defined and not empty, add its content
- if Prj_Path /= null then
+ if Prj_Path.all /= "" then
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Path_Separator;
@@ -223,6 +217,11 @@ package body Prj.Ext is
Name_Len := Name_Len - No_Project_Default_Dir'Length - 1;
+ -- After removing the '-', go back one character to get the next
+ -- directory corectly.
+
+ Last := Last - 1;
+
elsif not Hostparm.OpenVMS
or else not Is_Absolute_Path (Name_Buffer (First .. Last))
then
@@ -264,9 +263,19 @@ package body Prj.Ext is
Prefix := new String'(Executable_Prefix_Path);
if Prefix.all /= "" then
- Current_Project_Path :=
- new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
- Prefix.all & Directory_Separator & "gnat");
+ if Get_Mode = Ada_Only then
+ Current_Project_Path :=
+ new String'(Name_Buffer (1 .. Name_Len) &
+ Path_Separator &
+ Prefix.all & Directory_Separator & "gnat");
+
+ else
+ Current_Project_Path :=
+ new String'(Name_Buffer (1 .. Name_Len) &
+ Path_Separator &
+ Prefix.all & Directory_Separator &
+ "share" & Directory_Separator & "gpr");
+ end if;
end if;
else
@@ -278,7 +287,9 @@ package body Prj.Ext is
".." & Directory_Separator & "gnat");
end if;
end;
- else
+ end if;
+
+ if Current_Project_Path = null then
Current_Project_Path := new String'(Name_Buffer (1 .. Name_Len));
end if;
end Initialize_Project_Path;