with Prj.Env;
with Prj.Ext;
with Prj.Pars;
+with Prj.Tree; use Prj.Tree;
with Prj.Util; use Prj.Util;
with Snames;
with Switch; use Switch;
Project_File_Name : String_Access := null;
- Project_Tree : constant Prj.Project_Tree_Ref := new Prj.Project_Tree_Data;
+ Project_Node_Tree : Project_Node_Tree_Ref;
Main_Project : Prj.Project_Id := Prj.No_Project;
begin
Proj := Project_Tree.Projects;
while Proj /= null loop
- if Has_Foreign_Sources (Proj.Project) then
+
+ -- For gnatmake, when the project specifies more than
+ -- just Ada as a language (even if course we could not
+ -- find any source file for the other languages), we
+ -- will take all the object files found in the object
+ -- directories. Since we know the project supports at
+ -- least Ada, we just have to test whether it has at
+ -- least two languages, and we do not care about the
+ -- sources.
+
+ if Proj.Project.Languages /= null
+ and then Proj.Project.Languages.Next /= null
+ then
Global_Archive := True;
exit;
end if;
Prj.Pars.Parse
(Project => Main_Project,
In_Tree => Project_Tree,
+ In_Node_Tree => Project_Node_Tree,
Project_File_Name => Project_File_Name.all,
+ Flags => Gnatmake_Flags,
Packages_To_Check => Packages_To_Check_By_Gnatmake);
if Main_Project = No_Project then
Csets.Initialize;
Namet.Initialize;
Snames.Initialize;
+
+ Project_Node_Tree := new Project_Node_Tree_Data;
+ Prj.Tree.Initialize (Project_Node_Tree);
+
Prj.Initialize (Project_Tree);
-- Check if the platform is VMS and, if it is, change some variables
elsif Arg (3) = 'P' then
Prj.Ext.Add_Search_Project_Directory
- (Arg (4 .. Arg'Last));
+ (Project_Node_Tree, Arg (4 .. Arg'Last));
else
Bad_Argument;
when 'e' =>
if Arg = "-eL" then
Follow_Links_For_Files := True;
+ Follow_Links_For_Dirs := True;
else
Bad_Argument;
if OK then
Prj.Ext.Add
- (External_Name =>
+ (Project_Node_Tree,
+ External_Name =>
Ext_Asgn (Start .. Equal_Pos - 1),
Value =>
Ext_Asgn (Equal_Pos + 1 .. Stop));