Commit a70f5d82 by Vincent Celier Committed by Arnaud Charlet

makeutl.ads (Main_Config_Project): Moved to gpr_util.ads

2007-09-26  Vincent Celier  <celier@adacore.com>

	* makeutl.ads (Main_Config_Project): Moved to gpr_util.ads

	* prj.ads, prj.adb (Default_Language): Remove function, no longer used
	Replace components Compiler_Min_Options and Binder_Min_Options with
	Compiler_Required_Switches and Binder_Required_Switches in record
	Language_Config.
	Remove components Default_Language and Config in Project_Tree_Data,
	no longer used.

	* prj-attr.adb: New attributes Required_Switches (<language>) in
	packages Compiler and Binder.

	* prj-nmsc.adb: Major rewrite of the processing of configuration
	attributes for gprbuild. No impact on GNAT tools.

	* prj-proc.ads, prj-proc.adb (Process_Project_Tree_Phase_2): No longer
	process configuration attributes: this is done in Prj.Nmsc.Check.
	(Recursive_Process): Make a full copy of packages inherited from project
	being extended, instead of a shallow copy.
	(Process_Project_Tree_Phase_1): New procedure
	(Process_Project_Tree_Phase_1): New procedure
	(Process): Implementation now uses the two new procedures

	* prj-util.adb (Executable_Of): Get the suffix and the default suffix
	from the project config, not the tree config that no longer exists.

From-SVN: r128797
parent 15cf0748
...@@ -43,9 +43,6 @@ package Makeutl is ...@@ -43,9 +43,6 @@ package Makeutl is
Project_Tree : constant Project_Tree_Ref := new Project_Tree_Data; Project_Tree : constant Project_Tree_Ref := new Project_Tree_Data;
-- The project tree -- The project tree
Main_Config_Project : Project_Id;
-- The project id of the main configuration project
procedure Add procedure Add
(Option : String_Access; (Option : String_Access;
To : in out String_List_Access; To : in out String_List_Access;
......
...@@ -156,6 +156,7 @@ package body Prj.Attr is ...@@ -156,6 +156,7 @@ package body Prj.Attr is
-- Configuration - Compiling -- Configuration - Compiling
"Sadriver#" & "Sadriver#" &
"Larequired_switches#" &
"Lapic_option#" & "Lapic_option#" &
-- Configuration - Mapping files -- Configuration - Mapping files
...@@ -208,6 +209,7 @@ package body Prj.Attr is ...@@ -208,6 +209,7 @@ package body Prj.Attr is
-- Configuration - Binding -- Configuration - Binding
"Sadriver#" & "Sadriver#" &
"Larequired_switches#" &
"Saprefix#" & "Saprefix#" &
"Saobjects_path#" & "Saobjects_path#" &
"Saobjects_path_file#" & "Saobjects_path_file#" &
......
...@@ -50,12 +50,37 @@ package Prj.Proc is ...@@ -50,12 +50,37 @@ package Prj.Proc is
-- still valid if they point to a file which is outside of the project), -- still valid if they point to a file which is outside of the project),
-- and that no directory has a name which is a valid source name. -- and that no directory has a name which is a valid source name.
-- --
-- When_No_Sources indicates what should be done when no sources -- When_No_Sources indicates what should be done when no sources are found
-- are found in a project for a specified or implied language. -- in a project for a specified or implied language.
-- --
-- When Reset_Tree is True, all the project data are removed from the -- When Reset_Tree is True, all the project data are removed from the
-- project table before processing. -- project table before processing.
-- --
-- Process is a bit of a junk name, how about Process_Project_Tree??? -- Process is a bit of a junk name, how about Process_Project_Tree???
-- The two procedures that follow are implementing procedure Process in
-- two successive phases. They are used by gprbuild/gprclean to add the
-- configuration attributes between the two phases.
procedure Process_Project_Tree_Phase_1
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Report_Error : Put_Line_Access;
Reset_Tree : Boolean := True);
-- See documentation of parameters in procedure Process above
procedure Process_Project_Tree_Phase_2
(In_Tree : Project_Tree_Ref;
Project : Project_Id;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Report_Error : Put_Line_Access;
Follow_Links : Boolean := True;
When_No_Sources : Error_Warning := Error);
-- See documentation of parameters in procedure Process above
end Prj.Proc; end Prj.Proc;
...@@ -145,7 +145,8 @@ package body Prj.Util is ...@@ -145,7 +145,8 @@ package body Prj.Util is
begin begin
if Builder_Package /= No_Package then if Builder_Package /= No_Package then
if Get_Mode = Multi_Language then if Get_Mode = Multi_Language then
Executable_Suffix_Name := In_Tree.Config.Executable_Suffix; Executable_Suffix_Name :=
In_Tree.Projects.Table (Project).Config.Executable_Suffix;
else else
Executable_Suffix := Prj.Util.Value_Of Executable_Suffix := Prj.Util.Value_Of
...@@ -283,7 +284,8 @@ package body Prj.Util is ...@@ -283,7 +284,8 @@ package body Prj.Util is
Result : File_Name_Type; Result : File_Name_Type;
begin begin
Executable_Extension_On_Target := In_Tree.Config.Executable_Suffix; Executable_Extension_On_Target :=
In_Tree.Projects.Table (Project).Config.Executable_Suffix;
Result := Executable_Name (Name_Find); Result := Executable_Name (Name_Find);
Executable_Extension_On_Target := Saved_EEOT; Executable_Extension_On_Target := Saved_EEOT;
return Result; return Result;
......
...@@ -358,15 +358,6 @@ package body Prj is ...@@ -358,15 +358,6 @@ package body Prj is
return Default_Ada_Spec_Suffix_Id; return Default_Ada_Spec_Suffix_Id;
end Default_Ada_Spec_Suffix; end Default_Ada_Spec_Suffix;
----------------------
-- Default_Language --
----------------------
function Default_Language (In_Tree : Project_Tree_Ref) return Name_Id is
begin
return In_Tree.Default_Language;
end Default_Language;
--------------------------- ---------------------------
-- Delete_All_Temp_Files -- -- Delete_All_Temp_Files --
--------------------------- ---------------------------
...@@ -454,10 +445,6 @@ package body Prj is ...@@ -454,10 +445,6 @@ package body Prj is
Value := Project_Empty; Value := Project_Empty;
Value.Naming := Tree.Private_Part.Default_Naming; Value.Naming := Tree.Private_Part.Default_Naming;
if Current_Mode = Multi_Language then
Value.Config := Tree.Config;
end if;
return Value; return Value;
end Empty_Project; end Empty_Project;
......
...@@ -298,8 +298,6 @@ package Prj is ...@@ -298,8 +298,6 @@ package Prj is
Next : Name_List_Index := No_Name_List; Next : Name_List_Index := No_Name_List;
end record; end record;
function Default_Language (In_Tree : Project_Tree_Ref) return Name_Id;
package Name_List_Table is new GNAT.Dynamic_Tables package Name_List_Table is new GNAT.Dynamic_Tables
(Table_Component_Type => Name_Node, (Table_Component_Type => Name_Node,
Table_Index_Type => Name_List_Index, Table_Index_Type => Name_List_Index,
...@@ -363,12 +361,9 @@ package Prj is ...@@ -363,12 +361,9 @@ package Prj is
Compiler_Driver_Path : String_Access := null; Compiler_Driver_Path : String_Access := null;
-- The path name of the executable for the compiler of the language -- The path name of the executable for the compiler of the language
Compiler_Min_Options : Name_List_Index := No_Name_List; Compiler_Required_Switches : Name_List_Index := No_Name_List;
-- The minimum options for the compiler of the language. Specified -- The list of switches that are required as a minimum to invoke the
-- in the configuration as Compiler'Switches (<language>). -- compiler driver.
Min_Compiler_Options : String_List_Access := null;
-- The minimum options as an argument list
Compilation_PIC_Option : Name_List_Index := No_Name_List; Compilation_PIC_Option : Name_List_Index := No_Name_List;
-- The option(s) to compile a source in Position Independent Code for -- The option(s) to compile a source in Position Independent Code for
...@@ -407,7 +402,7 @@ package Prj is ...@@ -407,7 +402,7 @@ package Prj is
Runtime_Project : Path_Name_Type := No_Path; Runtime_Project : Path_Name_Type := No_Path;
Binder_Driver : File_Name_Type := No_File; Binder_Driver : File_Name_Type := No_File;
Binder_Driver_Path : Path_Name_Type := No_Path; Binder_Driver_Path : Path_Name_Type := No_Path;
Binder_Min_Options : Name_List_Index := No_Name_List; Binder_Required_Switches : Name_List_Index := No_Name_List;
Binder_Prefix : Name_Id := No_Name; Binder_Prefix : Name_Id := No_Name;
Toolchain_Version : Name_Id := No_Name; Toolchain_Version : Name_Id := No_Name;
Toolchain_Description : Name_Id := No_Name; Toolchain_Description : Name_Id := No_Name;
...@@ -416,39 +411,38 @@ package Prj is ...@@ -416,39 +411,38 @@ package Prj is
end record; end record;
No_Language_Config : constant Language_Config := No_Language_Config : constant Language_Config :=
(Kind => File_Based, (Kind => File_Based,
Naming_Data => No_Lang_Naming_Data, Naming_Data => No_Lang_Naming_Data,
Compiler_Driver => No_File, Compiler_Driver => No_File,
Compiler_Driver_Path => null, Compiler_Driver_Path => null,
Compiler_Min_Options => No_Name_List, Compiler_Required_Switches => No_Name_List,
Min_Compiler_Options => null, Compilation_PIC_Option => No_Name_List,
Compilation_PIC_Option => No_Name_List, Mapping_File_Switches => No_Name_List,
Mapping_File_Switches => No_Name_List, Mapping_Spec_Suffix => No_File,
Mapping_Spec_Suffix => No_File, Mapping_Body_Suffix => No_File,
Mapping_Body_Suffix => No_File, Config_File_Switches => No_Name_List,
Config_File_Switches => No_Name_List, Dependency_Kind => Makefile,
Dependency_Kind => Makefile, Dependency_Option => No_Name_List,
Dependency_Option => No_Name_List, Compute_Dependency => No_Name_List,
Compute_Dependency => No_Name_List, Include_Option => No_Name_List,
Include_Option => No_Name_List, Include_Path => No_Name,
Include_Path => No_Name, Include_Path_File => No_Name,
Include_Path_File => No_Name, Objects_Path => No_Name,
Objects_Path => No_Name, Objects_Path_File => No_Name,
Objects_Path_File => No_Name, Config_Body => No_Name,
Config_Body => No_Name, Config_Spec => No_Name,
Config_Spec => No_Name, Config_Body_Pattern => No_Name,
Config_Body_Pattern => No_Name, Config_Spec_Pattern => No_Name,
Config_Spec_Pattern => No_Name, Config_File_Unique => False,
Config_File_Unique => False, Runtime_Project => No_Path,
Runtime_Project => No_Path, Binder_Driver => No_File,
Binder_Driver => No_File, Binder_Driver_Path => No_Path,
Binder_Driver_Path => No_Path, Binder_Required_Switches => No_Name_List,
Binder_Min_Options => No_Name_List, Binder_Prefix => No_Name,
Binder_Prefix => No_Name, Toolchain_Version => No_Name,
Toolchain_Version => No_Name, Toolchain_Description => No_Name,
Toolchain_Description => No_Name, PIC_Option => No_Name,
PIC_Option => No_Name, Objects_Generated => True);
Objects_Generated => True);
type Language_Data is record type Language_Data is record
Name : Name_Id := No_Name; Name : Name_Id := No_Name;
...@@ -1390,14 +1384,6 @@ package Prj is ...@@ -1390,14 +1384,6 @@ package Prj is
type Project_Tree_Data is type Project_Tree_Data is
record record
-- General
Default_Language : Name_Id := No_Name;
-- The name of the language of the sources of a project, when
-- attribute Languages is not specified.
Config : Project_Configuration;
-- Languages and sources of the project -- Languages and sources of the project
First_Language : Language_Index := No_Language_Index; First_Language : Language_Index := No_Language_Index;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment