+2011-08-01 Pascal Obry <obry@adacore.com>
+
+ * prj-part.ads, prj-part.adb (Parse): Add Target_Name parameter. Pass
+ Target_Name to Get_Path call.
+ (Parse_Single_Project): Likewise.
+ (Post_Parse_Context_Clause): Likewise.
+ * prj-env.ads, prj-env.adb (Find_Project): Add Target_Name parameter.
+ Call Initialise_Project_Path with the proper Target_Name.
+ (Initialize_Project_Path): Add <gnat_root>/<target_name>/lib/gnat
+ search path.
+ (Get_Path): Add Target_Name parameter. Call Initialise_Project_Path
+ with the proper Target_Name.
+ * prj-conf.adb (Get_Or_Create_Configuration_File): Pass Target_Name to
+ Part.Parse routine.
+ (Parse_Project_And_Apply_Config): Likewise.
+ * prj-makr.adb (Initialize): Pass empty Target_Name to Parse routine.
+ This is fine as this part of the code is supporting only native
+ compilation.
+ * prj-pars.adb (Parse): Pass empty Target_Name to Parse routine. This
+ is fine as this part of the code is supporting only native compilation.
+
2011-08-01 Yannick Moy <moy@adacore.com>
* sem_util.adb (Enter_Name): issue error in formal mode on declaration
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Directory,
Is_Config_File => True,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
else
-- Maybe the user will want to create his own configuration file
Config_Project_Node := Empty_Node;
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Directory,
Is_Config_File => False,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
if User_Project_Node = Empty_Node then
User_Project_Node := Empty_Node;
(Path_Separator & Prefix.all &
"lib" & Directory_Separator & "gpr" &
Directory_Separator & Target_Name);
+ Add_Str_To_Name_Buffer
+ (Path_Separator & Prefix.all &
+ Target_Name & Directory_Separator &
+ "lib" & Directory_Separator & "gnat");
end if;
Add_Str_To_Name_Buffer
--------------
procedure Get_Path
- (Self : in out Project_Search_Path;
- Path : out String_Access)
+ (Self : in out Project_Search_Path;
+ Path : out String_Access;
+ Target_Name : String := "")
is
begin
- Initialize_Project_Path (Self, ""); -- ??? Target_Name unspecified
+ Initialize_Project_Path (Self, Target_Name);
Path := Self.Path;
end Get_Path;
(Self : in out Project_Search_Path;
Project_File_Name : String;
Directory : String;
- Path : out Namet.Path_Name_Type)
+ Path : out Namet.Path_Name_Type;
+ Target_Name : String)
is
File : constant String := Project_File_Name;
-- Have to do a copy, in case the parameter is Name_Buffer, which we
-- Start of processing for Find_Project
begin
- Initialize_Project_Path (Self, "");
+ Initialize_Project_Path (Self, Target_Name);
if Current_Verbosity = High then
Write_Str ("Searching for project (""");
-- path.
procedure Get_Path
- (Self : in out Project_Search_Path;
- Path : out String_Access);
+ (Self : in out Project_Search_Path;
+ Path : out String_Access;
+ Target_Name : String := "");
-- Return the current value of the project path, either the value set
-- during elaboration of the package or, if procedure Set_Project_Path has
-- been called, the value set by the last call to Set_Project_Path.
(Self : in out Project_Search_Path;
Project_File_Name : String;
Directory : String;
- Path : out Namet.Path_Name_Type);
+ Path : out Namet.Path_Name_Type;
+ Target_Name : String);
-- Search for a project with the given name either in Directory (which
-- often will be the directory contain the project we are currently parsing
-- and which we found a reference to another project), or in the project
Is_Config_File => False,
Flags => Flags,
Current_Directory => Get_Current_Dir,
- Packages_To_Check => Packages_To_Check_By_Gnatname);
+ Packages_To_Check => Packages_To_Check_By_Gnatname,
+ Target_Name => "");
-- Fail if parsing was not successful
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2010, 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- --
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Dir,
Flags => Flags,
- Is_Config_File => False);
+ Is_Config_File => False,
+ Target_Name => "");
-- If there were no error, process the tree
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags);
+ Flags : Processing_Flags;
+ Target_Name : String);
-- Parse a project file. This is a recursive procedure: it calls itself for
-- imported and extended projects. When From_Extended is not None, if the
-- project has already been parsed and is an extended project A, return the
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags);
+ Flags : Processing_Flags;
+ Target_Name : String);
-- Parse the imported projects that have been stored in table Withs, if
-- any. From_Extended is used for the call to Parse_Single_Project below.
-- When In_Limited is True, the importing path includes at least one
Store_Comments : Boolean := False;
Current_Directory : String := "";
Is_Config_File : Boolean;
- Flags : Processing_Flags)
+ Flags : Processing_Flags;
+ Target_Name : String)
is
Dummy : Boolean;
pragma Warnings (Off, Dummy);
Find_Project (In_Tree.Project_Path,
Project_File_Name => Real_Project_File_Name.all,
Directory => Current_Directory,
- Path => Path_Name_Id);
+ Path => Path_Name_Id,
+ Target_Name => Target_Name);
Free (Real_Project_File_Name);
Prj.Err.Initialize;
declare
P : String_Access;
begin
- Get_Path (In_Tree.Project_Path, Path => P);
+ Get_Path
+ (In_Tree.Project_Path,
+ Path => P,
+ Target_Name => Target_Name);
+
Prj.Com.Fail
("project file """
& Project_File_Name
Depth => 0,
Current_Dir => Current_Directory,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
exception
when Types.Unrecoverable_Error =>
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags)
+ Flags : Processing_Flags;
+ Target_Name : String)
is
Current_With_Clause : With_Id := Context_Clause;
(In_Tree.Project_Path,
Project_File_Name => Get_Name_String (Current_With.Path),
Directory => Project_Directory_Path,
- Path => Imported_Path_Name_Id);
+ Path => Imported_Path_Name_Id,
+ Target_Name => Target_Name);
if Imported_Path_Name_Id = No_Path then
Depth => Depth,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
else
Extends_All := Is_Extending_All (Withed_Project, In_Tree);
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags)
+ Flags : Processing_Flags;
+ Target_Name : String)
is
Path_Name : constant String := Get_Name_String (Path_Name_Id);
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects);
end;
(In_Tree.Project_Path,
Project_File_Name => Original_Path_Name,
Directory => Get_Name_String (Project_Directory),
- Path => Extended_Project_Path_Name_Id);
+ Path => Extended_Project_Path_Name_Id,
+ Target_Name => Target_Name);
if Extended_Project_Path_Name_Id = No_Path then
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
end;
if Present (Extended_Project) then
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Flags,
+ Target_Name => Target_Name);
Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects);
end;
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2010, 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- --
Store_Comments : Boolean := False;
Current_Directory : String := "";
Is_Config_File : Boolean;
- Flags : Processing_Flags);
+ Flags : Processing_Flags;
+ Target_Name : String);
-- Parse project file and all its imported project files and create a tree.
-- Return the node for the project (or Empty_Node if parsing failed). If
-- Always_Errout_Finalize is True, Errout.Finalize is called in all cases,