-- The name of the archive dependency file for this project
Obj_Dir : constant String :=
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String (Data.Object_Directory.Display_Name);
begin
Change_Dir (Obj_Dir);
Unit : Unit_Data;
begin
- if Data.Library and then Data.Library_Src_Dir /= No_Path then
+ if Data.Library and then Data.Library_Src_Dir /= No_Path_Information then
declare
Directory : constant String :=
- Get_Name_String (Data.Display_Library_Src_Dir);
+ Get_Name_String (Data.Library_Src_Dir.Display_Name);
begin
Change_Dir (Directory);
declare
Lib_Directory : constant String :=
- Get_Name_String (Data.Display_Library_Dir);
+ Get_Name_String
+ (Data.Library_Dir.Display_Name);
Lib_ALI_Directory : constant String :=
Get_Name_String
- (Data.Display_Library_ALI_Dir);
+ (Data.Library_ALI_Dir.Display_Name);
begin
Canonical_Case_File_Name (Archive_Name);
Processed_Projects.Increment_Last;
Processed_Projects.Table (Processed_Projects.Last) := Project;
- if Data.Object_Directory /= No_Path then
+ if Data.Object_Directory /= No_Path_Information then
declare
Obj_Dir : constant String :=
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String
+ (Data.Object_Directory.Display_Name);
begin
Change_Dir (Obj_Dir);
if not Compile_Only then
Clean_Library_Directory (Project);
- if Data.Library_Src_Dir /= No_Path then
+ if Data.Library_Src_Dir /= No_Path_Information then
Clean_Interface_Copy_Directory (Project);
end if;
end if;
if Data.Standalone_Library and then
- Data.Object_Directory /= No_Path
+ Data.Object_Directory /= No_Path_Information
then
Delete_Binder_Generated_Files
- (Get_Name_String (Data.Display_Object_Dir),
+ (Get_Name_String (Data.Object_Directory.Display_Name),
File_Name_Type (Data.Library_Name));
end if;
end if;
-- The executables are deleted only if switch -c is not specified
- if Project = Main_Project and then Data.Exec_Directory /= No_Path then
+ if Project = Main_Project
+ and then Data.Exec_Directory /= No_Path_Information
+ then
declare
Exec_Dir : constant String :=
- Get_Name_String (Data.Display_Exec_Dir);
+ Get_Name_String (Data.Exec_Directory.Display_Name);
begin
Change_Dir (Exec_Dir);
end;
end if;
- if Data.Object_Directory /= No_Path then
+ if Data.Object_Directory /= No_Path_Information then
Delete_Binder_Generated_Files
- (Get_Name_String (Data.Display_Object_Dir),
+ (Get_Name_String (Data.Object_Directory.Display_Name),
Strip_Suffix (Main_Source_File));
end if;
end loop;
while Main /= Nil_String loop
File :=
new String'
- (Get_Name_String (Data.Object_Directory) &
- Directory_Separator &
- B_Start.all &
+ (Get_Name_String (Data.Object_Directory.Name) &
+ Directory_Separator &
+ B_Start.all &
MLib.Fil.Ext_To
(Get_Name_String
(Project_Tree.String_Elements.Table
File :=
new String'
- (Get_Name_String (Data.Object_Directory) &
- Directory_Separator &
- B_Start.all &
- Get_Name_String (Data.Library_Name) &
+ (Get_Name_String (Data.Object_Directory.Name) &
+ Directory_Separator &
+ B_Start.all &
+ Get_Name_String (Data.Library_Name) &
".ci");
if Is_Regular_File (File.all) then
if
Unit_Data.File_Names (Body_Part).Name /= No_File
and then
- Unit_Data.File_Names (Body_Part).Path /= Slash
+ Unit_Data.File_Names (Body_Part).Path.Name /= Slash
then
-- There is a body, check if it is for this project
if
Unit_Data.File_Names (Specification).Name = No_File
or else
- Unit_Data.File_Names (Specification).Path = Slash
+ Unit_Data.File_Names
+ (Specification).Path.Name = Slash
then
-- We have a body with no spec: we need to check if
-- this is a subunit, because gnatls will complain
Src_Ind := Sinput.P.Load_Project_File
(Get_Name_String
(Unit_Data.File_Names
- (Body_Part).Path));
+ (Body_Part).Path.Name));
Subunit :=
Sinput.P.Source_File_Is_Subunit
elsif
Unit_Data.File_Names (Specification).Name /= No_File
and then
- Unit_Data.File_Names (Specification).Path /= Slash
+ Unit_Data.File_Names (Specification).Path.Name /= Slash
then
-- We have a spec with no body; check if it is for this
-- project.
if
Unit_Data.File_Names (Body_Part).Name /= No_File
and then
- Unit_Data.File_Names (Body_Part).Path /= Slash
+ Unit_Data.File_Names (Body_Part).Path.Name /= Slash
then
-- There is a body. Check if .ci files for this project
-- must be added.
if
Unit_Data.File_Names (Specification).Name = No_File
or else
- Unit_Data.File_Names (Specification).Path = Slash
+ Unit_Data.File_Names
+ (Specification).Path.Name = Slash
then
-- We have a body with no spec: we need to check
-- if this is a subunit, because .ci files are not
begin
Src_Ind := Sinput.P.Load_Project_File
(Get_Name_String
- (Unit_Data.File_Names (Body_Part).Path));
+ (Unit_Data.File_Names
+ (Body_Part).Path.Name));
Subunit :=
Sinput.P.Source_File_Is_Subunit (Src_Ind);
(Project_Tree.Projects.Table
(Unit_Data.File_Names
(Body_Part).Project).
- Object_Directory) &
+ Object_Directory.Name) &
Directory_Separator &
MLib.Fil.Ext_To
(Get_Name_String
elsif
Unit_Data.File_Names (Specification).Name /= No_File
and then
- Unit_Data.File_Names (Specification).Path /= Slash
+ Unit_Data.File_Names (Specification).Path.Name /= Slash
then
-- We have a spec with no body. Check if it is for this
-- project.
(Project_Tree.Projects.Table
(Unit_Data.File_Names
(Specification).Project).
- Object_Directory) &
+ Object_Directory.Name) &
Dir_Separator &
MLib.Fil.Ext_To
(Get_Name_String
if Check_Project
(Unit_Data.File_Names (Kind).Project, Project)
and then Unit_Data.File_Names (Kind).Name /= No_File
- and then Unit_Data.File_Names (Kind).Path /= Slash
+ and then Unit_Data.File_Names (Kind).Path.Name /= Slash
then
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'
(Get_Name_String
(Unit_Data.File_Names
- (Kind).Display_Path));
+ (Kind).Path.Display_Name));
end if;
end loop;
end if;
end loop;
Get_Name_String (Project_Tree.Projects.Table
- (Project).Exec_Directory);
+ (Project).Exec_Directory.Name);
if Name_Buffer (Name_Len) /= Directory_Separator then
Name_Len := Name_Len + 1;
Get_Name_String (Udata.File_Names (Specification).Name) =
Line (1 .. Last)
then
- Path := Udata.File_Names (Specification).Path;
+ Path := Udata.File_Names (Specification).Path.Name;
exit;
elsif Udata.File_Names (Body_Part).Name /= No_File
Get_Name_String (Udata.File_Names (Body_Part).Name) =
Line (1 .. Last)
then
- Path := Udata.File_Names (Body_Part).Path;
+ Path := Udata.File_Names (Body_Part).Path.Name;
exit;
end if;
end loop;
Dir : constant String :=
Get_Name_String
(Project_Tree.Projects.Table
- (Prj).Object_Directory);
+ (Prj).Object_Directory.Name);
begin
if Is_Regular_File
(Dir &
new String'("-o");
Get_Name_String
(Project_Tree.Projects.Table
- (Project).Exec_Directory);
+ (Project).Exec_Directory.Name);
Last_Switches.Increment_Last;
Last_Switches.Table (Last_Switches.Last) :=
new String'(Name_Buffer (1 .. Name_Len) &
new String'("-L" &
Get_Name_String
(Project_Tree.Projects.Table
- (Project).Library_Dir));
+ (Project).Library_Dir.Name));
-- Add the -l switch
Library_Paths.Table (Library_Paths.Last) :=
new String'(Get_Name_String
(Project_Tree.Projects.Table
- (Project).Library_Dir));
+ (Project).Library_Dir.Name));
end if;
end if;
end Set_Library_For;
Put (To_Lower (Command_List (C).Cname.all));
Set_Col (25);
- Put (Program_Name (Command_List (C).Unixcmd.all).all);
+
+ -- No prefix for gnatstack
+
+ if C = Stack then
+ Put (Command_List (C).Unixcmd.all);
+ else
+ Put (Program_Name (Command_List (C).Unixcmd.all).all);
+ end if;
declare
Sws : Argument_List_Access renames Command_List (C).Unixsws;
end if;
declare
- Program : constant String :=
- Program_Name (Command_List (The_Command).Unixcmd.all).all;
-
+ Program : String_Access;
Exec_Path : String_Access;
begin
+ if The_Command = Stack then
+ Program := new String'(Command_List (The_Command).Unixcmd.all);
+
+ else
+ Program :=
+ Program_Name (Command_List (The_Command).Unixcmd.all);
+ end if;
+
-- Locate the executable for the command
- Exec_Path := Locate_Exec_On_Path (Program);
+ Exec_Path := Locate_Exec_On_Path (Program.all);
if Exec_Path = null then
- Put_Line (Standard_Error, "could not locate " & Program);
+ Put_Line (Standard_Error, "could not locate " & Program.all);
raise Error_Exit;
end if;
Change_Dir
(Get_Name_String
(Project_Tree.Projects.Table
- (Project).Object_Directory));
+ (Project).Object_Directory.Name));
end if;
-- Set up the env vars for project path files
end loop;
Get_Name_String
- (Project_Tree.Projects.Table (Project).Directory);
+ (Project_Tree.Projects.Table (Project).Directory.Name);
declare
Project_Dir : constant String := Name_Buffer (1 .. Name_Len);
if The_Command = Metric
and then
- Project_Tree.Projects.Table (Project).Object_Directory /= No_Path
+ Project_Tree.Projects.Table (Project).Object_Directory /=
+ No_Path_Information
then
First_Switches.Increment_Last;
First_Switches.Table (2 .. First_Switches.Last) :=
new String'("-d=" &
Get_Name_String
(Project_Tree.Projects.Table
- (Project).Object_Directory));
+ (Project).Object_Directory.Name));
end if;
-- For gnat check, -rules and the following switches need to be the
else
Get_Name_String
- (Project_Tree.Projects.Table (Main_Project).Display_Directory);
+ (Project_Tree.Projects.Table (Main_Project).Directory.Display_Name);
Add_Lib_Search_Dir
(Normalize_Pathname (Path, Name_Buffer (1 .. Name_Len)));
end if;
else
Get_Name_String
- (Project_Tree.Projects.Table (Main_Project).Display_Directory);
+ (Project_Tree.Projects.Table (Main_Project).Directory.Display_Name);
Add_Src_Search_Dir
(Normalize_Pathname (Path, Name_Buffer (1 .. Name_Len)));
end if;
if Project_Of_Current_Object_Directory /= Actual_Project then
Project_Of_Current_Object_Directory := Actual_Project;
Object_Directory :=
- Project_Tree.Projects.Table (Actual_Project).Object_Directory;
+ Project_Tree.Projects.Table (Actual_Project).Object_Directory.Name;
-- Set the working directory to the object directory of the actual
-- project.
Make_Failed ("unable to change to object directory """ &
Path_Or_File_Name
(Project_Tree.Projects.Table
- (Actual_Project).Object_Directory) &
+ (Actual_Project).Object_Directory.Name) &
""" of project " &
Get_Name_String (Project_Tree.Projects.Table
(Actual_Project).Display_Name));
while ALI_Project /= No_Project and then
Obj_Dir /=
Project_Tree.Projects.Table
- (ALI_Project).Object_Directory
+ (ALI_Project).Object_Directory.Name
loop
ALI_Project :=
Project_Tree.Projects.Table (ALI_Project).Extended_By;
if Data.Dir_Path = null then
Data.Dir_Path :=
- new String'(Get_Name_String (Data.Display_Directory));
+ new String'(Get_Name_String (Data.Directory.Display_Name));
Project_Tree.Projects.Table (Arguments_Project) :=
Data;
end if;
Udata.File_Names (Body_Part).Name /=
No_File
and then
- Udata.File_Names (Body_Part).Path /= Slash
+ Udata.File_Names (Body_Part).Path.Name /=
+ Slash
then
Sfile := Udata.File_Names (Body_Part).Name;
Source_Index :=
Udata.File_Names (Specification).Name /=
No_File
and then
- Udata.File_Names (Specification).Path /=
- Slash
+ Udata.File_Names
+ (Specification).Path.Name /= Slash
then
Sfile :=
Udata.File_Names (Specification).Name;
Parent_Directory : constant String :=
Get_Name_String
(Project_Tree.Projects.Table
- (Project).Display_Directory);
+ (Project).Directory.Display_Name);
begin
if Parent_Directory (Parent_Directory'Last) =
-- for other projects, use the object directory.
if PD.Library then
- Get_Name_String (PD.Library_Dir);
+ Get_Name_String (PD.Library_Dir.Name);
else
- Get_Name_String (PD.Object_Directory);
+ Get_Name_String (PD.Object_Directory.Name);
end if;
if Name_Buffer (Name_Len) /=
if Main_Project /= No_Project then
if Project_Tree.Projects.Table
- (Main_Project).Object_Directory /= No_Path
+ (Main_Project).Object_Directory /= No_Path_Information
then
-- Change current directory to object directory of main project
-- impossible to build the library. So fail immediately.
if Project_Tree.Projects.Table (Proj).Object_Directory =
- No_Path
+ No_Path_Information
then
Make_Failed
("no object files to build library for project """,
if not Is_Absolute_Path (Exec_File_Name) then
Get_Name_String
(Project_Tree.Projects.Table
- (Main_Project).Exec_Directory);
+ (Main_Project).Exec_Directory.Name);
if Name_Buffer (Name_Len) /= Directory_Separator then
Name_Len := Name_Len + 1;
Dir_Path : constant String_Access :=
new String'(Get_Name_String
(Project_Tree.Projects.Table
- (Main_Project).Directory));
+ (Main_Project).Directory.Name));
begin
for J in 1 .. Binder_Switches.Last loop
Test_If_Relative_Path
begin
if not Is_Absolute_Path (Exec_File_Name) then
- Get_Name_String (Project_Tree.Projects.Table
- (Main_Project).Display_Exec_Dir);
+ Get_Name_String
+ (Project_Tree.Projects.Table
+ (Main_Project).Exec_Directory.Display_Name);
if Name_Buffer (Name_Len) /= Directory_Separator then
Name_Len := Name_Len + 1;
new String'
(Get_Name_String
(Project_Tree.Projects.Table
- (Proj1).Display_Library_Dir));
+ (Proj1).Library_Dir.Display_Name));
end if;
end if;
end loop;
Get_Name_String
(Project_Tree.Projects.Table
(Library_Projs.Table (Index)).
- Display_Library_Dir));
+ Library_Dir.Display_Name));
-- Add the -l switch
Dir_Path : constant String_Access :=
new String'(Get_Name_String
(Project_Tree.Projects.Table
- (Main_Project).Directory));
+ (Main_Project).Directory.Name));
begin
for
J in Last_Binder_Switch + 1 .. Binder_Switches.Last
-- locally removed,
if Unit.File_Names (Body_Part).Name /= No_File
- and then Unit.File_Names (Body_Part).Path /= Slash
+ and then Unit.File_Names (Body_Part).Path.Name /= Slash
then
-- And it is a source for the specified project
begin
Src_Ind := Sinput.P.Load_Project_File
(Get_Name_String
- (Unit.File_Names (Body_Part).Path));
+ (Unit.File_Names (Body_Part).Path.Name));
-- If it is a subunit, discard it
end if;
elsif Unit.File_Names (Specification).Name /= No_File
- and then Unit.File_Names (Specification).Path /= Slash
+ and then Unit.File_Names (Specification).Path.Name /= Slash
and then Check_Project (Unit.File_Names (Specification).Project)
then
-- If there is no source for the body, but there is a source
declare
Object_Directory : constant String :=
Normalize_Pathname
- (Get_Name_String
- (Data.Display_Object_Dir));
+ (Get_Name_String
+ (Data.Object_Directory.Display_Name));
Olast : Natural := Object_Directory'Last;
(Dir,
Get_Name_String
(Project_Tree.Projects.Table
- (Main_Project).Display_Directory));
+ (Main_Project).Directory.Display_Name));
begin
if Real_Path'Length = 0 then
if not For_Gnatmake then
if Data.Library_Kind = Static then
Add_Argument
- (Get_Name_String (Data.Display_Library_Dir) &
+ (Get_Name_String (Data.Library_Dir.Display_Name) &
Directory_Separator &
"lib" & Get_Name_String (Data.Library_Name) &
'.' & Archive_Ext,
("-l" & Get_Name_String (Data.Library_Name),
Verbose_Mode);
- Get_Name_String (Data.Display_Library_Dir);
+ Get_Name_String (Data.Library_Dir.Display_Name);
Add_Argument
("-L" & Name_Buffer (1 .. Name_Len),
elsif Project = Main_Project and then Global_Archive_Exists then
Add_Argument
- (Get_Name_String (Data.Display_Object_Dir) &
+ (Get_Name_String (Data.Object_Directory.Display_Name) &
Directory_Separator &
"lib" & Get_Name_String (Data.Display_Name)
& '.' & Archive_Ext,
if Project_Of_Current_Object_Directory /= Main_Project then
Project_Of_Current_Object_Directory := Main_Project;
- Change_Dir (Get_Name_String (Data.Object_Directory));
+ Change_Dir (Get_Name_String (Data.Object_Directory.Name));
if Verbose_Mode then
Write_Str ("Changing to object directory of """);
Write_Name (Data.Display_Name);
Write_Str (""": """);
- Write_Name (Data.Display_Object_Dir);
+ Write_Name (Data.Object_Directory.Display_Name);
Write_Line ("""");
end if;
end if;
MLib.Build_Library
(Ofiles => Arguments (1 .. Last_Argument),
Output_File => Get_Name_String (Data.Library_Name),
- Output_Dir => Get_Name_String (Data.Display_Library_Dir));
+ Output_Dir => Get_Name_String
+ (Data.Library_Dir.Display_Name));
else
-- Link with g++ if C++ is one of the languages, otherwise
Options => Lib_Opts.all,
Interfaces => No_Argument,
Lib_Filename => Get_Name_String (Data.Library_Name),
- Lib_Dir => Get_Name_String (Data.Library_Dir),
+ Lib_Dir => Get_Name_String (Data.Library_Dir.Name),
Symbol_Data => No_Symbols,
Driver_Name => Driver_Name,
Lib_Version => "",
if Project_Of_Current_Object_Directory /= Main_Project then
Project_Of_Current_Object_Directory := Main_Project;
- Change_Dir (Get_Name_String (Data.Object_Directory));
+ Change_Dir (Get_Name_String (Data.Object_Directory.Name));
if Verbose_Mode then
Write_Str ("Changing to object directory of """);
Write_Name (Data.Name);
Write_Str (""": """);
- Write_Name (Data.Display_Object_Dir);
+ Write_Name (Data.Object_Directory.Display_Name);
Write_Line ("""");
end if;
end if;
-- Specify the project file
Add_Argument (Dash_P, True);
- Add_Argument (Get_Name_String (Data.Display_Path_Name), True);
+ Add_Argument (Get_Name_String (Data.Path.Display_Name), True);
-- Add the saved switches, if any
if Project_Of_Current_Object_Directory /= Project then
Project_Of_Current_Object_Directory := Project;
- Change_Dir (Get_Name_String (Data.Object_Directory));
+ Change_Dir (Get_Name_String (Data.Object_Directory.Name));
if Verbose_Mode then
Write_Str ("Changing to object directory of """);
Write_Name (Data.Display_Name);
Write_Str (""": """);
- Write_Name (Data.Display_Object_Dir);
+ Write_Name (Data.Object_Directory.Display_Name);
Write_Line ("""");
end if;
end if;
if not Compile_Only
and then not Data.Library
- and then Data.Object_Directory /= No_Path
+ and then Data.Object_Directory /= No_Path_Information
then
Build_Global_Archive;
Link_Executables;
-- True if main sources were specified on the command line
Object_Dir : constant String :=
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String (Data.Object_Directory.Display_Name);
-- Path of the object directory of the main project
Source_Id : Other_Source_Id;
if Data.Other_Sources_Present then
declare
Archive_Path : constant String := Get_Name_String
- (Prj_Data.Display_Object_Dir) & Directory_Separator
+ (Prj_Data.Object_Directory.Display_Name)
+ & Directory_Separator
& "lib" & Get_Name_String (Prj_Data.Display_Name)
& '.' & Archive_Ext;
Archive_TS : Time_Stamp_Type;
Executable_Path : constant String :=
Get_Name_String
- (Data.Display_Exec_Dir) &
+ (Data.Exec_Directory.Display_Name) &
Directory_Separator & Executable_Name;
-- Path name of the executable
Add_Argument (Dash_o, True);
Add_Argument
- (Get_Name_String (Data.Display_Exec_Dir) &
+ (Get_Name_String (Data.Exec_Directory.Display_Name) &
Directory_Separator &
Get_Name_String
(Executable_Of
new String'
(Get_Name_String
(In_Tree.Projects.Table
- (Proj). Directory));
+ (Proj).Directory.Name));
end if;
while Options /= Nil_String loop
-- g-trasym.obj.
Object_Directory_Path : constant String :=
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String (Data.Object_Directory.Display_Name);
Standalone : constant Boolean := Data.Standalone_Library;
if Libgnarl_Needed = Unknown then
if Data.Libgnarl_Needed = Unknown
- and then Data.Object_Directory /= No_Path
+ and then Data.Object_Directory /= No_Path_Information
then
-- Check if libgnarl is needed for this library
declare
Object_Dir_Path : constant String :=
Get_Name_String
- (Data.Display_Object_Dir);
+ (Data.Object_Directory.
+ Display_Name);
Object_Dir : Dir_Type;
Filename : String (1 .. 255);
Last : Natural;
Current := Library_Projs.Table (Index);
Get_Name_String
- (In_Tree.Projects.Table (Current).Display_Library_Dir);
+ (In_Tree.Projects.Table (Current).Library_Dir.Display_Name);
Opts.Increment_Last;
Opts.Table (Opts.Last) :=
new String'("-L" & Name_Buffer (1 .. Name_Len));
Unit := In_Tree.Units.Table (Source);
if Unit.File_Names (Body_Part).Name /= No_File
- and then Unit.File_Names (Body_Part).Path /= Slash
+ and then Unit.File_Names (Body_Part).Path.Name /= Slash
then
if
Check_Project (Unit.File_Names (Body_Part).Project)
Src_Ind := Sinput.P.Load_Project_File
(Get_Name_String
(Unit.File_Names
- (Body_Part).Path));
+ (Body_Part).Path.Name));
-- Add the ALI file only if it is not a subunit
end if;
elsif Unit.File_Names (Specification).Name /= No_File
- and then Unit.File_Names (Specification).Path /= Slash
+ and then Unit.File_Names (Specification).Path.Name /= Slash
and then Check_Project
(Unit.File_Names (Specification).Project)
then
end if;
Lib_Dirpath :=
- new String'(Get_Name_String (Data.Display_Library_Dir));
+ new String'(Get_Name_String (Data.Library_Dir.Display_Name));
Lib_Filename := new String'(Get_Name_String (Data.Library_Name));
case Data.Library_Kind is
There_Are_Foreign_Sources := Data.Other_Sources_Present;
loop
- declare
- Object_Dir_Path : constant String :=
- Get_Name_String (Data.Display_Object_Dir);
- Object_Dir : Dir_Type;
- Filename : String (1 .. 255);
- Last : Natural;
- Id : Name_Id;
+ if Data.Object_Directory /= No_Path_Information then
+ declare
+ Object_Dir_Path : constant String :=
+ Get_Name_String
+ (Data.Object_Directory.Display_Name);
+ Object_Dir : Dir_Type;
+ Filename : String (1 .. 255);
+ Last : Natural;
+ Id : Name_Id;
- begin
- Open (Dir => Object_Dir, Dir_Name => Object_Dir_Path);
+ begin
+ Open (Dir => Object_Dir, Dir_Name => Object_Dir_Path);
- -- For all entries in the object directory
+ -- For all entries in the object directory
- loop
- Read (Object_Dir, Filename, Last);
+ loop
+ Read (Object_Dir, Filename, Last);
- exit when Last = 0;
+ exit when Last = 0;
- -- Check if it is an object file
+ -- Check if it is an object file
- if Is_Obj (Filename (1 .. Last)) then
- declare
- Object_Path : constant String :=
- Normalize_Pathname
- (Object_Dir_Path & Directory_Separator &
- Filename (1 .. Last));
- C_Object_Path : String := Object_Path;
- C_Filename : String := Filename (1 .. Last);
+ if Is_Obj (Filename (1 .. Last)) then
+ declare
+ Object_Path : constant String :=
+ Normalize_Pathname
+ (Object_Dir_Path &
+ Directory_Separator &
+ Filename (1 .. Last));
+ C_Object_Path : String := Object_Path;
+ C_Filename : String := Filename (1 .. Last);
- begin
- Canonical_Case_File_Name (C_Object_Path);
- Canonical_Case_File_Name (C_Filename);
+ begin
+ Canonical_Case_File_Name (C_Object_Path);
+ Canonical_Case_File_Name (C_Filename);
- -- If in the object directory of an extended project,
- -- do not consider generated object files.
+ -- If in the object directory of an extended
+ -- project, do not consider generated object files.
- if In_Main_Object_Directory
- or else Last < 5
- or else C_Filename (1 .. B_Start'Length) /=
- B_Start.all
- then
- Name_Len := Last;
- Name_Buffer (1 .. Name_Len) :=
- C_Filename (1 .. Last);
- Id := Name_Find;
-
- if not Objects_Htable.Get (Id) then
- declare
- ALI_File : constant String :=
- Ext_To
- (C_Filename
- (1 .. Last), "ali");
- ALI_Path : constant String :=
- Ext_To (C_Object_Path, "ali");
- Add_It : Boolean :=
- There_Are_Foreign_Sources
- or else
- (Last > 5
+ if In_Main_Object_Directory
+ or else Last < 5
+ or else C_Filename (1 .. B_Start'Length) /=
+ B_Start.all
+ then
+ Name_Len := Last;
+ Name_Buffer (1 .. Name_Len) :=
+ C_Filename (1 .. Last);
+ Id := Name_Find;
+
+ if not Objects_Htable.Get (Id) then
+ declare
+ ALI_File : constant String :=
+ Ext_To
+ (C_Filename
+ (1 .. Last), "ali");
+ ALI_Path : constant String :=
+ Ext_To (C_Object_Path, "ali");
+ Add_It : Boolean :=
+ There_Are_Foreign_Sources
+ or else
+ (Last > 5
and then
- C_Filename
- (1 .. B_Start'Length) =
- B_Start.all);
- Fname : File_Name_Type;
- Proj : Project_Id;
-
- begin
- if Is_Regular_File (ALI_Path) then
-
- -- If there is an ALI file, check if the
- -- object file should be added to the
- -- library. If there are foreign sources
- -- we put all object files in the library.
-
- if not Add_It then
- for Index in
- 1 .. Unit_Table.Last (In_Tree.Units)
- loop
- if In_Tree.Units.Table
- (Index).File_Names
- (Body_Part).Name /= No_File
- then
- Proj :=
- In_Tree.Units.Table (Index).
- File_Names
- (Body_Part).Project;
- Fname :=
- In_Tree.Units.Table (Index).
- File_Names (Body_Part).Name;
-
- elsif
- In_Tree.Units.Table
- (Index).File_Names
- (Specification).Name /= No_File
- then
- Proj :=
- In_Tree.Units.Table
- (Index).File_Names
- (Specification).Project;
- Fname :=
+ C_Filename
+ (1 .. B_Start'Length) =
+ B_Start.all);
+ Fname : File_Name_Type;
+ Proj : Project_Id;
+
+ begin
+ if Is_Regular_File (ALI_Path) then
+
+ -- If there is an ALI file, check if
+ -- the object file should be added to
+ -- the library. If there are foreign
+ -- sources we put all object files in
+ -- the library.
+
+ if not Add_It then
+ for Index in
+ 1 .. Unit_Table.Last
+ (In_Tree.Units)
+ loop
+ if In_Tree.Units.Table
+ (Index).File_Names
+ (Body_Part).Name /= No_File
+ then
+ Proj :=
+ In_Tree.Units.Table (Index).
+ File_Names
+ (Body_Part).Project;
+ Fname :=
+ In_Tree.Units.Table (Index).
+ File_Names (Body_Part).Name;
+
+ elsif
In_Tree.Units.Table
(Index).File_Names
- (Specification).Name;
-
- else
- Proj := No_Project;
- end if;
-
- Add_It := Proj /= No_Project;
-
- -- If the source is in the project
- -- or a project it extends, we may
- -- put it in the library.
-
- if Add_It then
- Add_It := Check_Project (Proj);
- end if;
-
- -- But we don't, if the ALI file
- -- does not correspond to the unit.
-
- if Add_It then
- declare
- F : constant String :=
- Ext_To
- (Get_Name_String
- (Fname), "ali");
- begin
- Add_It := F = ALI_File;
- end;
- end if;
-
- exit when Add_It;
- end loop;
- end if;
+ (Specification).Name /=
+ No_File
+ then
+ Proj :=
+ In_Tree.Units.Table
+ (Index).File_Names
+ (Specification).Project;
+ Fname :=
+ In_Tree.Units.Table
+ (Index).File_Names
+ (Specification).Name;
+
+ else
+ Proj := No_Project;
+ end if;
+
+ Add_It := Proj /= No_Project;
+
+ -- If the source is in the
+ -- project or a project it
+ -- extends, we may put it in the
+ -- library.
+
+ if Add_It then
+ Add_It := Check_Project (Proj);
+ end if;
+
+ -- But we don't, if the ALI file
+ -- does not correspond to the
+ -- unit.
+
+ if Add_It then
+ declare
+ F : constant String :=
+ Ext_To
+ (Get_Name_String
+ (Fname), "ali");
+ begin
+ Add_It := F = ALI_File;
+ end;
+ end if;
+
+ exit when Add_It;
+ end loop;
+ end if;
- if Add_It then
- Objects_Htable.Set (Id, True);
- Objects.Append
- (new String'(Object_Path));
+ if Add_It then
+ Objects_Htable.Set (Id, True);
+ Objects.Append
+ (new String'(Object_Path));
- -- Record the ALI file
+ -- Record the ALI file
- ALIs.Append (new String'(ALI_Path));
+ ALIs.Append (new String'(ALI_Path));
- -- Find out if for this ALI file,
- -- libgnarl or libdecgnat or
- -- g-trasym.obj (on OpenVMS) is
- -- necessary.
+ -- Find out if for this ALI file,
+ -- libgnarl or libdecgnat or
+ -- g-trasym.obj (on OpenVMS) is
+ -- necessary.
- Check_Libs (ALI_Path, True);
- end if;
+ Check_Libs (ALI_Path, True);
+ end if;
- elsif There_Are_Foreign_Sources then
- Objects.Append (new String'(Object_Path));
- end if;
- end;
+ elsif There_Are_Foreign_Sources then
+ Objects.Append
+ (new String'(Object_Path));
+ end if;
+ end;
+ end if;
end if;
- end if;
- end;
- end if;
- end loop;
+ end;
+ end if;
+ end loop;
- Close (Dir => Object_Dir);
+ Close (Dir => Object_Dir);
- exception
- when Directory_Error =>
- Com.Fail ("cannot find object directory """,
- Get_Name_String (Data.Object_Directory),
- """");
- end;
+ exception
+ when Directory_Error =>
+ Com.Fail ("cannot find object directory """,
+ Get_Name_String
+ (Data.Object_Directory.Display_Name),
+ """");
+ end;
+ end if;
exit when Data.Extends = No_Project;
begin
Get_Name_String
- (In_Tree.Projects.Table (For_Project).Library_Dir);
+ (In_Tree.Projects.Table (For_Project).Library_Dir.Name);
Change_Dir (Name_Buffer (1 .. Name_Len));
exception
Copy_ALI_Files
(Files => Ali_Files.all,
- To => In_Tree.Projects.Table (For_Project).Library_ALI_Dir,
+ To => In_Tree.Projects.Table
+ (For_Project).Library_ALI_Dir.Name,
Interfaces => Arguments (1 .. Argument_Number));
-- Copy interface sources if Library_Src_Dir specified
if Standalone
and then In_Tree.Projects.Table
- (For_Project).Library_Src_Dir /= No_Path
+ (For_Project).Library_Src_Dir /= No_Path_Information
then
-- Clean the interface copy directory: remove any source that
-- could be a source of the project.
begin
Get_Name_String
- (In_Tree.Projects.Table (For_Project).Library_Src_Dir);
+ (In_Tree.Projects.Table (For_Project).Library_Src_Dir.Name);
Change_Dir (Name_Buffer (1 .. Name_Len));
exception
In_Tree => In_Tree,
Interfaces => Arguments (1 .. Argument_Number),
To_Dir => In_Tree.Projects.Table
- (For_Project).Display_Library_Src_Dir);
+ (For_Project).Library_Src_Dir.Display_Name);
end if;
end if;
Lib_Name : constant File_Name_Type :=
Library_File_Name_For (For_Project, In_Tree);
begin
- Change_Dir (Get_Name_String (Data.Library_Dir));
+ Change_Dir (Get_Name_String (Data.Library_Dir.Name));
Lib_TS := File_Stamp (Lib_Name);
In_Tree.Projects.Table (For_Project).Library_TS := Lib_TS;
end;
if not Data.Externally_Built
and then not Data.Need_To_Build_Lib
- and then Data.Object_Directory /= No_Path
+ and then Data.Object_Directory /= No_Path_Information
then
declare
Obj_TS : Time_Stamp_Type;
-- If the library file does not exist, then the time stamp will
-- be Empty_Time_Stamp, earlier than any other time stamp.
- Change_Dir (Get_Name_String (Data.Object_Directory));
+ Change_Dir (Get_Name_String (Data.Object_Directory.Name));
Open (Dir => Object_Dir, Dir_Name => ".");
-- For all entries in the object directory
and then Data.File_Names (J).Name = File_Name
then
Copy_File
- (Get_Name_String (Data.File_Names (J).Path),
+ (Get_Name_String (Data.File_Names (J).Path.Name),
Target,
Success,
Mode => Overwrite,
Change_Dir
(Get_Name_String
- (In_Tree.Projects.Table
- (For_Project).Object_Directory));
+ (In_Tree.Projects.Table (For_Project).Object_Directory.Name));
for Index in Interfaces'Range loop
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- 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- --
declare
Lib_Dir : constant String :=
Get_Name_String
- (In_Tree.Projects.Table (Project).Library_Dir);
+ (In_Tree.Projects.Table (Project).Library_Dir.Name);
Lib_Name : constant String :=
Get_Name_String
(In_Tree.Projects.Table (Project).Library_Name);
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, 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- --
if (Data.Library and then Including_Libraries)
or else
- (Data.Object_Directory /= No_Path
+ (Data.Object_Directory /= No_Path_Information
and then
(not Including_Libraries or else not Data.Library))
then
-- files; otherwise add the object directory.
if Data.Library then
- if Data.Object_Directory = No_Path
+ if Data.Object_Directory = No_Path_Information
or else
- Contains_ALI_Files (Data.Library_ALI_Dir)
+ Contains_ALI_Files (Data.Library_ALI_Dir.Name)
then
- Add_To_Path (Get_Name_String (Data.Library_ALI_Dir));
+ Add_To_Path
+ (Get_Name_String (Data.Library_ALI_Dir.Name));
else
- Add_To_Path (Get_Name_String (Data.Object_Directory));
+ Add_To_Path
+ (Get_Name_String (Data.Object_Directory.Name));
end if;
else
-- For a non library project, add the object directory
- Add_To_Path (Get_Name_String (Data.Object_Directory));
+ Add_To_Path
+ (Get_Name_String (Data.Object_Directory.Name));
end if;
end if;
-- If we don't know the path name of the body of this unit,
-- we compute it, and we store it.
- if Data.File_Names (Body_Part).Path = No_Path then
+ if Data.File_Names (Body_Part).Path = No_Path_Information then
declare
Current_Source : String_List_Id :=
In_Tree.Projects.Table
begin
-- By default, put the file name
- Data.File_Names (Body_Part).Path :=
+ Data.File_Names (Body_Part).Path.Name :=
Path_Name_Type (Data.File_Names (Body_Part).Name);
-- For each source directory
if Path /= null then
Name_Len := Path'Length;
Name_Buffer (1 .. Name_Len) := Path.all;
- Data.File_Names (Body_Part).Path := Name_Enter;
+ Data.File_Names (Body_Part).Path.Name := Name_Enter;
exit;
else
-- Returned the stored value
- return Namet.Get_Name_String (Data.File_Names (Body_Part).Path);
+ return Namet.Get_Name_String (Data.File_Names (Body_Part).Path.Name);
end Body_Path_Name_Of;
------------------------
-- If there is a spec, put it in the mapping
if Data.Name /= No_File then
- if Data.Path = Slash then
+ if Data.Path.Name = Slash then
Fmap.Add_Forbidden_File_Name (Data.Name);
else
Fmap.Add_To_File_Map
(Unit_Name => Unit_Name_Type (The_Unit_Data.Name),
File_Name => Data.Name,
- Path_Name => File_Name_Type (Data.Path));
+ Path_Name => File_Name_Type (Data.Path.Name));
end if;
end if;
-- If there is a body (or subunit) put it in the mapping
if Data.Name /= No_File then
- if Data.Path = Slash then
+ if Data.Path.Name = Slash then
Fmap.Add_Forbidden_File_Name (Data.Name);
else
Fmap.Add_To_File_Map
(Unit_Name => Unit_Name_Type (The_Unit_Data.Name),
File_Name => Data.Name,
- Path_Name => File_Name_Type (Data.Path));
+ Path_Name => File_Name_Type (Data.Path.Name));
end if;
end if;
end if;
-- Line with the path name
- Get_Name_String (Data.Path);
+ Get_Name_String (Data.Path.Name);
Put_Name_Buffer;
end Put_Data;
if Src_Data.Language_Name = Language
and then not Src_Data.Locally_Removed
and then Src_Data.Replaced_By = No_Source
- and then Src_Data.Path /= No_Path
+ and then Src_Data.Path.Name /= No_Path
then
if Src_Data.Unit /= No_Name then
Get_Name_String (Src_Data.Unit);
Get_Name_String (Src_Data.File);
Put_Name_Buffer;
- Get_Name_String (Src_Data.Path);
+ Get_Name_String (Src_Data.Path.Name);
Put_Name_Buffer;
end if;
if Full_Path then
return Get_Name_String
- (Unit.File_Names (Body_Part).Path);
+ (Unit.File_Names (Body_Part).Path.Name);
else
return Get_Name_String (Current_Name);
if Full_Path then
return Get_Name_String
- (Unit.File_Names (Body_Part).Path);
+ (Unit.File_Names (Body_Part).Path.Name);
else
return Extended_Body_Name;
if Full_Path then
return Get_Name_String
- (Unit.File_Names (Specification).Path);
+ (Unit.File_Names (Specification).Path.Name);
else
return Get_Name_String (Current_Name);
end if;
if Full_Path then
return Get_Name_String
- (Unit.File_Names (Specification).Path);
+ (Unit.File_Names (Specification).Path.Name);
else
return Extended_Spec_Name;
end if;
-- If there is an object directory, call Action with its name
- if Data.Object_Directory /= No_Path then
- Get_Name_String (Data.Display_Object_Dir);
+ if Data.Object_Directory /= No_Path_Information then
+ Get_Name_String (Data.Object_Directory.Display_Name);
Action (Name_Buffer (1 .. Name_Len));
end if;
and then
Namet.Get_Name_String
(Unit.File_Names (Specification).Name) = Original_Name)
- or else (Unit.File_Names (Specification).Path /= No_Path
+ or else (Unit.File_Names (Specification).Path /=
+ No_Path_Information
and then
Namet.Get_Name_String
- (Unit.File_Names (Specification).Path) =
+ (Unit.File_Names (Specification).Path.Name) =
Original_Name)
then
Project := Ultimate_Extension_Of
(Project => Unit.File_Names (Specification).Project,
In_Tree => In_Tree);
- Path := Unit.File_Names (Specification).Display_Path;
+ Path := Unit.File_Names (Specification).Path.Display_Name;
if Current_Verbosity > Default then
Write_Str ("Done: Specification.");
and then
Namet.Get_Name_String
(Unit.File_Names (Body_Part).Name) = Original_Name)
- or else (Unit.File_Names (Body_Part).Path /= No_Path
+ or else (Unit.File_Names (Body_Part).Path /= No_Path_Information
and then Namet.Get_Name_String
- (Unit.File_Names (Body_Part).Path) =
+ (Unit.File_Names (Body_Part).Path.Name) =
Original_Name)
then
Project := Ultimate_Extension_Of
(Project => Unit.File_Names (Body_Part).Project,
In_Tree => In_Tree);
- Path := Unit.File_Names (Body_Part).Display_Path;
+ Path := Unit.File_Names (Body_Part).Path.Display_Name;
if Current_Verbosity > Default then
Write_Str ("Done: Body.");
Write_Str (" Project: ");
Get_Name_String
(In_Tree.Projects.Table
- (Unit.File_Names (Specification).Project).Path_Name);
+ (Unit.File_Names (Specification).Project).Path.Name);
Write_Line (Name_Buffer (1 .. Name_Len));
end if;
Write_Str (" Project: ");
Get_Name_String
(In_Tree.Projects.Table
- (Unit.File_Names (Body_Part).Project).Path_Name);
+ (Unit.File_Names (Body_Part).Project).Path.Name);
Write_Line (Name_Buffer (1 .. Name_Len));
end if;
if (Data.Library and Including_Libraries)
or else
- (Data.Object_Directory /= No_Path
+ (Data.Object_Directory /= No_Path_Information
and then
(not Including_Libraries or else not Data.Library))
then
-- otherwise add the object directory.
if Data.Library then
- if Data.Object_Directory = No_Path
- or else Contains_ALI_Files (Data.Library_ALI_Dir)
+ if Data.Object_Directory = No_Path_Information
+ or else Contains_ALI_Files
+ (Data.Library_ALI_Dir.Name)
then
Add_To_Object_Path
- (Data.Library_ALI_Dir, In_Tree);
+ (Data.Library_ALI_Dir.Name, In_Tree);
else
Add_To_Object_Path
- (Data.Object_Directory, In_Tree);
+ (Data.Object_Directory.Name, In_Tree);
end if;
-- For a non-library project, add the object
and then There_Are_Ada_Sources (In_Tree, Project)
then
Add_To_Object_Path
- (Data.Object_Directory, In_Tree);
+ (Data.Object_Directory.Name, In_Tree);
end if;
end if;
end if;
Data : Unit_Data := In_Tree.Units.Table (Unit);
begin
- if Data.File_Names (Specification).Path = No_Path then
+ if Data.File_Names (Specification).Path.Name = No_Path then
declare
Current_Source : String_List_Id :=
In_Tree.Projects.Table
Path : GNAT.OS_Lib.String_Access;
begin
- Data.File_Names (Specification).Path :=
+ Data.File_Names (Specification).Path.Name :=
Path_Name_Type (Data.File_Names (Specification).Name);
while Current_Source /= Nil_String loop
if Path /= null then
Name_Len := Path'Length;
Name_Buffer (1 .. Name_Len) := Path.all;
- Data.File_Names (Specification).Path := Name_Enter;
+ Data.File_Names (Specification).Path.Name := Name_Enter;
exit;
else
Current_Source :=
end;
end if;
- return Namet.Get_Name_String (Data.File_Names (Specification).Path);
+ return Namet.Get_Name_String (Data.File_Names (Specification).Path.Name);
end Spec_Path_Name_Of;
---------------------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, 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- --
function Ada_Include_Path
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return String_Access;
- -- Get the ADA_INCLUDE_PATH of a Project file. For the first call, compute
- -- it and cache it.
+ -- Get the source search path of a Project file. For the first call,
+ -- compute it and cache it.
function Ada_Include_Path
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
Recursive : Boolean) return String;
- -- Get the ADA_INCLUDE_PATH of a Project file. If Recursive it True,
+ -- Get the source search path of a Project file. If Recursive it True,
-- get all the source directories of the imported and modified project
-- files (recursively). If Recursive is False, just get the path for the
-- source directories of Project. Note: the resulting String may be empty
end if;
if Path /= No_Path then
- Src_Data.Path := Path;
- Src_Data.Display_Path := Display_Path;
+ Src_Data.Path := (Path, Display_Path);
Source_Paths_Htable.Set (In_Tree.Source_Paths_HT, Path, Id);
end if;
-- Compute the object path name
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String (Data.Object_Directory.Display_Name);
if Name_Buffer (Name_Len) /= Directory_Separator
and then Name_Buffer (Name_Len) /= '/'
-- Compute the dependency path name
- Get_Name_String (Data.Display_Object_Dir);
+ Get_Name_String (Data.Object_Directory.Display_Name);
if Name_Buffer (Name_Len) /= Directory_Separator
and then Name_Buffer (Name_Len) /= '/'
if Current_Verbosity = High then
Write_Str (" interface: ");
- Write_Line (Get_Name_String (Src_Data.Path));
+ Write_Line (Get_Name_String (Src_Data.Path.Name));
end if;
end if;
-- inherit library directory.
Data.Library_Dir := Extended_Data.Library_Dir;
- Data.Display_Library_Dir :=
- Extended_Data.Display_Library_Dir;
Library_Directory_Present := True;
end if;
end if;
else
-- Find path name (unless inherited), check that it is a directory
- if Data.Library_Dir = No_Path then
+ if Data.Library_Dir = No_Path_Information then
Locate_Directory
(Project,
In_Tree,
File_Name_Type (Lib_Dir.Value),
- Data.Display_Directory,
- Data.Library_Dir,
- Data.Display_Library_Dir,
+ Data.Directory.Display_Name,
+ Data.Library_Dir.Name,
+ Data.Library_Dir.Display_Name,
Create => "library",
Current_Dir => Current_Dir,
Location => Lib_Dir.Location);
end if;
- if Data.Library_Dir = No_Path then
+ if Data.Library_Dir = No_Path_Information then
-- Get the absolute name of the library directory that
-- does not exist, to report an error.
File_Name_Type (Lib_Dir.Value);
else
- Get_Name_String (Data.Display_Directory);
+ Get_Name_String (Data.Directory.Display_Name);
if Name_Buffer (Name_Len) /= Directory_Separator then
Name_Len := Name_Len + 1;
-- The library directory cannot be the same as the Object
-- directory.
- elsif Data.Library_Dir = Data.Object_Directory then
+ elsif Data.Library_Dir.Name = Data.Object_Directory.Name then
Error_Msg
(Project, In_Tree,
"library directory cannot be the same " &
"as object directory",
Lib_Dir.Location);
- Data.Library_Dir := No_Path;
- Data.Display_Library_Dir := No_Path;
+ Data.Library_Dir := No_Path_Information;
else
declare
Dir_Elem := In_Tree.String_Elements.Table (Dirs_Id);
Dirs_Id := Dir_Elem.Next;
- if Data.Library_Dir = Path_Name_Type (Dir_Elem.Value) then
+ if
+ Data.Library_Dir.Name = Path_Name_Type (Dir_Elem.Value)
+ then
Err_Vars.Error_Msg_File_1 :=
File_Name_Type (Dir_Elem.Value);
Error_Msg
In_Tree.String_Elements.Table (Dirs_Id);
Dirs_Id := Dir_Elem.Next;
- if Data.Library_Dir =
+ if Data.Library_Dir.Name =
Path_Name_Type (Dir_Elem.Value)
then
Err_Vars.Error_Msg_File_1 :=
end if;
if not OK then
- Data.Library_Dir := No_Path;
- Data.Display_Library_Dir := No_Path;
+ Data.Library_Dir := No_Path_Information;
elsif Current_Verbosity = High then
-- Display the Library directory in high verbosity
Write_Str ("Library directory =""");
- Write_Str (Get_Name_String (Data.Display_Library_Dir));
+ Write_Str
+ (Get_Name_String (Data.Library_Dir.Display_Name));
Write_Line ("""");
end if;
end;
end if;
Data.Library :=
- Data.Library_Dir /= No_Path
+ Data.Library_Dir /= No_Path_Information
and then
Data.Library_Name /= No_Name;
Write_Line ("No library ALI directory specified");
end if;
Data.Library_ALI_Dir := Data.Library_Dir;
- Data.Display_Library_ALI_Dir := Data.Display_Library_Dir;
else
-- Find path name, check that it is a directory
(Project,
In_Tree,
File_Name_Type (Lib_ALI_Dir.Value),
- Data.Display_Directory,
- Data.Library_ALI_Dir,
- Data.Display_Library_ALI_Dir,
+ Data.Directory.Display_Name,
+ Data.Library_ALI_Dir.Name,
+ Data.Library_ALI_Dir.Display_Name,
Create => "library ALI",
Current_Dir => Current_Dir,
Location => Lib_ALI_Dir.Location);
- if Data.Library_ALI_Dir = No_Path then
+ if Data.Library_ALI_Dir = No_Path_Information then
-- Get the absolute name of the library ALI directory that
-- does not exist, to report an error.
File_Name_Type (Lib_Dir.Value);
else
- Get_Name_String (Data.Display_Directory);
+ Get_Name_String (Data.Directory.Display_Name);
if Name_Buffer (Name_Len) /= Directory_Separator then
Name_Len := Name_Len + 1;
"library 'A'L'I directory cannot be the same " &
"as object directory",
Lib_ALI_Dir.Location);
- Data.Library_ALI_Dir := No_Path;
- Data.Display_Library_ALI_Dir := No_Path;
+ Data.Library_ALI_Dir := No_Path_Information;
else
declare
Dir_Elem := In_Tree.String_Elements.Table (Dirs_Id);
Dirs_Id := Dir_Elem.Next;
- if Data.Library_ALI_Dir =
+ if Data.Library_ALI_Dir.Name =
Path_Name_Type (Dir_Elem.Value)
then
Err_Vars.Error_Msg_File_1 :=
In_Tree.String_Elements.Table (Dirs_Id);
Dirs_Id := Dir_Elem.Next;
- if Data.Library_ALI_Dir =
+ if Data.Library_ALI_Dir.Name =
Path_Name_Type (Dir_Elem.Value)
then
Err_Vars.Error_Msg_File_1 :=
end if;
if not OK then
- Data.Library_ALI_Dir := No_Path;
- Data.Display_Library_ALI_Dir := No_Path;
+ Data.Library_ALI_Dir := No_Path_Information;
elsif Current_Verbosity = High then
Write_Str ("Library ALI directory =""");
Write_Str
- (Get_Name_String (Data.Display_Library_ALI_Dir));
+ (Get_Name_String
+ (Data.Library_ALI_Dir.Display_Name));
Write_Line ("""");
end if;
end;
In_Tree.Units.Table (The_Unit_Id);
if The_Unit_Data.File_Names (Body_Part).Name /= No_File
- and then The_Unit_Data.File_Names (Body_Part).Path /=
- Slash
+ and then The_Unit_Data.File_Names
+ (Body_Part).Path.Name /= Slash
then
if Check_Project
(The_Unit_Data.File_Names (Body_Part).Project,
Src_Ind := Sinput.P.Load_Project_File
(Get_Name_String
(The_Unit_Data.File_Names
- (Body_Part).Path));
+ (Body_Part).Path.Name));
if Sinput.P.Source_File_Is_Subunit
(Src_Ind)
elsif The_Unit_Data.File_Names
(Specification).Name /= No_File
and then The_Unit_Data.File_Names
- (Specification).Path /= Slash
+ (Specification).Path.Name /= Slash
and then Check_Project
(The_Unit_Data.File_Names
(Specification).Project,
(Project,
In_Tree,
Dir_Id,
- Data.Display_Directory,
- Data.Library_Src_Dir,
- Data.Display_Library_Src_Dir,
+ Data.Directory.Display_Name,
+ Data.Library_Src_Dir.Name,
+ Data.Library_Src_Dir.Display_Name,
Create => "library source copy",
Current_Dir => Current_Dir,
Location => Lib_Src_Dir.Location);
-- If directory does not exist, report an error
- if Data.Library_Src_Dir = No_Path then
+ if Data.Library_Src_Dir = No_Path_Information then
-- Get the absolute name of the library directory that does
-- not exist, to report an error.
Err_Vars.Error_Msg_File_1 := Dir_Id;
else
- Get_Name_String (Data.Directory);
+ Get_Name_String (Data.Directory.Name);
if Name_Buffer (Name_Len) /=
Directory_Separator
"directory to copy interfaces cannot be " &
"the object directory",
Lib_Src_Dir.Location);
- Data.Library_Src_Dir := No_Path;
+ Data.Library_Src_Dir := No_Path_Information;
else
declare
-- Report error if it is one of the source directories
- if Data.Library_Src_Dir =
+ if Data.Library_Src_Dir.Name =
Path_Name_Type (Src_Dir.Value)
then
Error_Msg
"directory to copy interfaces cannot " &
"be one of the source directories",
Lib_Src_Dir.Location);
- Data.Library_Src_Dir := No_Path;
+ Data.Library_Src_Dir := No_Path_Information;
exit;
end if;
Src_Dirs := Src_Dir.Next;
end loop;
- if Data.Library_Src_Dir /= No_Path then
+ if Data.Library_Src_Dir /= No_Path_Information then
-- It cannot be a source directory of any other
-- project either.
-- Report error if it is one of the source
-- directories
- if Data.Library_Src_Dir =
+ if Data.Library_Src_Dir.Name =
Path_Name_Type (Src_Dir.Value)
then
Error_Msg_File_1 :=
"be the same as source directory { of " &
"project %%",
Lib_Src_Dir.Location);
- Data.Library_Src_Dir := No_Path;
+ Data.Library_Src_Dir := No_Path_Information;
exit Project_Loop;
end if;
-- In high verbosity, if there is a valid Library_Src_Dir,
-- display its path name.
- if Data.Library_Src_Dir /= No_Path
+ if Data.Library_Src_Dir /= No_Path_Information
and then Current_Verbosity = High
then
Write_Str ("Directory to copy interfaces =""");
- Write_Str (Get_Name_String (Data.Library_Src_Dir));
+ Write_Str (Get_Name_String (Data.Library_Src_Dir.Name));
Write_Line ("""");
end if;
end if;
else
if not Is_Absolute_Path (Name_Buffer (1 .. Name_Len)) then
Name_Len := 0;
- Add_Str_To_Name_Buffer (Get_Name_String (Data.Directory));
+ Add_Str_To_Name_Buffer
+ (Get_Name_String (Data.Directory.Name));
Add_Char_To_Name_Buffer (Directory_Separator);
Add_Str_To_Name_Buffer
(Get_Name_String (Lib_Ref_Symbol_File.Value));
Symb_Path : constant String :=
Normalize_Pathname
(Get_Name_String
- (Data.Object_Directory) &
+ (Data.Object_Directory.Name) &
Directory_Separator &
Name_Buffer (1 .. Name_Len),
Directory => Current_Dir,
Normalize_Pathname
(Name => Get_Name_String (Base_Dir),
Directory =>
- Get_Name_String (Data.Display_Directory),
+ Get_Name_String (Data.Directory.Display_Name),
Resolve_Links => False,
Case_Sensitive => True);
(Project => Project,
In_Tree => In_Tree,
Name => From,
- Parent => Data.Display_Directory,
+ Parent => Data.Directory.Display_Name,
Dir => Path_Name,
Display => Display_Path_Name,
Current_Dir => Current_Dir);
-- We set the object directory to its default
Data.Object_Directory := Data.Directory;
- Data.Display_Object_Dir := Data.Display_Directory;
if Object_Dir.Value /= Empty_String then
Get_Name_String (Object_Dir.Value);
(Project,
In_Tree,
File_Name_Type (Object_Dir.Value),
- Data.Display_Directory,
- Data.Object_Directory,
- Data.Display_Object_Dir,
+ Data.Directory.Display_Name,
+ Data.Object_Directory.Name,
+ Data.Object_Directory.Display_Name,
Create => "object",
Location => Object_Dir.Location,
Current_Dir => Current_Dir);
- if Data.Object_Directory = No_Path then
+ if Data.Object_Directory = No_Path_Information then
-- The object directory does not exist, report an error if the
-- project is not externally built.
-- tools that recover from errors; for example, these tools
-- could create the non existent directory.
- Data.Display_Object_Dir := Path_Name_Type (Object_Dir.Value);
+ Data.Object_Directory.Display_Name :=
+ Path_Name_Type (Object_Dir.Value);
if Osint.File_Names_Case_Sensitive then
- Data.Object_Directory := Path_Name_Type (Object_Dir.Value);
+ Data.Object_Directory.Name :=
+ Path_Name_Type (Object_Dir.Value);
else
Get_Name_String (Object_Dir.Value);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
- Data.Object_Directory := Name_Find;
+ Data.Object_Directory.Name := Name_Find;
end if;
end if;
end if;
(Project,
In_Tree,
Name_Find,
- Data.Display_Directory,
- Data.Object_Directory,
- Data.Display_Object_Dir,
+ Data.Directory.Name,
+ Data.Object_Directory.Name,
+ Data.Object_Directory.Display_Name,
Create => "object",
Location => Object_Dir.Location,
Current_Dir => Current_Dir);
end if;
if Current_Verbosity = High then
- if Data.Object_Directory = No_Path then
+ if Data.Object_Directory = No_Path_Information then
Write_Line ("No object directory");
else
Write_Str ("Object directory: """);
- Write_Str (Get_Name_String (Data.Display_Object_Dir));
+ Write_Str (Get_Name_String (Data.Object_Directory.Display_Name));
Write_Line ("""");
end if;
end if;
-- We set the object directory to its default
Data.Exec_Directory := Data.Object_Directory;
- Data.Display_Exec_Dir := Data.Display_Object_Dir;
if Exec_Dir.Value /= Empty_String then
Get_Name_String (Exec_Dir.Value);
(Project,
In_Tree,
File_Name_Type (Exec_Dir.Value),
- Data.Display_Directory,
- Data.Exec_Directory,
- Data.Display_Exec_Dir,
+ Data.Directory.Name,
+ Data.Exec_Directory.Name,
+ Data.Exec_Directory.Display_Name,
Create => "exec",
Location => Exec_Dir.Location,
Current_Dir => Current_Dir);
- if Data.Exec_Directory = No_Path then
+ if Data.Exec_Directory = No_Path_Information then
Err_Vars.Error_Msg_File_1 := File_Name_Type (Exec_Dir.Value);
Error_Msg
(Project, In_Tree,
end if;
if Current_Verbosity = High then
- if Data.Exec_Directory = No_Path then
+ if Data.Exec_Directory = No_Path_Information then
Write_Line ("No exec directory");
else
Write_Str ("Exec directory: """);
- Write_Str (Get_Name_String (Data.Display_Exec_Dir));
+ Write_Str (Get_Name_String (Data.Exec_Directory.Display_Name));
Write_Line ("""");
end if;
end if;
if Data.Extends = No_Project
and then Data.Object_Directory = Data.Directory
then
- Data.Object_Directory := No_Path;
+ Data.Object_Directory := No_Path_Information;
end if;
elsif Source_Dirs.Default then
Data.Source_Dirs := String_Element_Table.Last
(In_Tree.String_Elements);
In_Tree.String_Elements.Table (Data.Source_Dirs) :=
- (Value => Name_Id (Data.Directory),
- Display_Value => Name_Id (Data.Display_Directory),
+ (Value => Name_Id (Data.Directory.Name),
+ Display_Value => Name_Id (Data.Directory.Display_Name),
Location => No_Location,
Flag => False,
Next => Nil_String,
if Current_Verbosity = High then
Write_Line ("Single source directory:");
Write_Str (" """);
- Write_Str (Get_Name_String (Data.Display_Directory));
+ Write_Str (Get_Name_String (Data.Directory.Display_Name));
Write_Line ("""");
end if;
if Data.Extends = No_Project
and then Data.Object_Directory = Data.Directory
then
- Data.Object_Directory := No_Path;
+ Data.Object_Directory := No_Path_Information;
end if;
Data.Source_Dirs := Nil_String;
Path_Name_Of
(File_Name_Type
(Excluded_Source_List_File.Value),
- Data.Directory);
+ Data.Directory.Name);
begin
if Source_File_Path_Name'Length = 0 then
if Data.Extends = No_Project
and then Data.Object_Directory = Data.Directory
then
- Data.Object_Directory := No_Path;
+ Data.Object_Directory := No_Path_Information;
end if;
end if;
end if;
declare
Source_File_Path_Name : constant String :=
Path_Name_Of
- (File_Name_Type (Source_List_File.Value), Data.Directory);
+ (File_Name_Type (Source_List_File.Value), Data.Directory.Name);
begin
if Source_File_Path_Name'Length = 0 then
Src_Data := In_Tree.Sources.Table (Source);
if Src_Data.Naming_Exception
- and then Src_Data.Path = No_Path
+ and then Src_Data.Path = No_Path_Information
then
if Src_Data.Unit /= No_Name then
Error_Msg_Name_1 := Name_Id (Src_Data.Display_File);
Check_Name := True;
else
- In_Tree.Sources.Table (Name_Loc.Source).Path := Path_Id;
- In_Tree.Sources.Table
- (Name_Loc.Source).Display_Path := Display_Path_Id;
+ In_Tree.Sources.Table (Name_Loc.Source).Path :=
+ (Path_Id, Display_Path_Id);
Source_Paths_Htable.Set
(In_Tree.Source_Paths_HT,
Error_Msg_Name_1 :=
In_Tree.Projects.Table (Src_Data.Project).Name;
- Error_Msg_Name_2 := Name_Id (Src_Data.Display_Path);
+ Error_Msg_Name_2 := Name_Id (Src_Data.Path.Display_Name);
Error_Msg
(Project, In_Tree, "\ project %%, %%", No_Location);
if Extended = Project
or else Project_Extends (Project, Extended, In_Tree)
then
- Unit.File_Names (Kind).Path := Slash;
+ Unit.File_Names (Kind).Path.Name := Slash;
Unit.File_Names (Kind).Needs_Pragma := False;
In_Tree.Units.Table (Index) := Unit;
Add_Forbidden_File_Name
Src_Ind : constant Source_File_Index :=
Sinput.P.Load_Project_File
(Get_Name_String
- (Src_Data.Path));
+ (Src_Data.Path.Name));
begin
if Sinput.P.Source_File_Is_Subunit
if (The_Unit_Data.File_Names (Unit_Kind).Name =
Canonical_File_Name
and then
- The_Unit_Data.File_Names (Unit_Kind).Path = Slash)
+ The_Unit_Data.File_Names
+ (Unit_Kind).Path.Name = Slash)
or else The_Unit_Data.File_Names (Unit_Kind).Name = No_File
or else Project_Extends
(Data.Extends,
The_Unit_Data.File_Names (Unit_Kind).Project,
In_Tree)
then
- if The_Unit_Data.File_Names (Unit_Kind).Path = Slash then
+ if
+ The_Unit_Data.File_Names (Unit_Kind).Path.Name = Slash
+ then
Remove_Forbidden_File_Name
(The_Unit_Data.File_Names (Unit_Kind).Name);
end if;
(Name => Canonical_File_Name,
Index => Unit_Ind,
Display_Name => File_Name,
- Path => Canonical_Path_Name,
- Display_Path => Path_Name,
+ Path => (Canonical_Path_Name, Path_Name),
Project => Project,
Needs_Pragma => Needs_Pragma);
In_Tree.Units.Table (The_Unit) := The_Unit_Data;
elsif The_Unit_Data.File_Names (Unit_Kind).Project = Project
and then (Data.Known_Order_Of_Source_Dirs
or else
- The_Unit_Data.File_Names (Unit_Kind).Path =
- Canonical_Path_Name)
+ The_Unit_Data.File_Names
+ (Unit_Kind).Path.Name = Canonical_Path_Name)
then
if Previous_Source = Nil_String then
Data.Ada_Sources := Nil_String;
(The_Unit_Data.File_Names (Unit_Kind).Project).Name;
Err_Vars.Error_Msg_File_1 :=
File_Name_Type
- (The_Unit_Data.File_Names (Unit_Kind).Path);
+ (The_Unit_Data.File_Names (Unit_Kind).Path.Name);
Error_Msg
(Project, In_Tree,
"\ project file %%, {", The_Location);
(Name => Canonical_File_Name,
Index => Unit_Ind,
Display_Name => File_Name,
- Path => Canonical_Path_Name,
- Display_Path => Path_Name,
+ Path => (Canonical_Path_Name, Path_Name),
Project => Project,
Needs_Pragma => Needs_Pragma);
In_Tree.Units.Table (The_Unit) := The_Unit_Data;
declare
Object_Dir : constant Path_Name_Type :=
In_Tree.Projects.Table
- (Project).Object_Directory;
+ (Project).Object_Directory.Name;
begin
for Index in
Project_Table.First .. Project_Table.Last (In_Tree.Projects)
loop
if In_Tree.Projects.Table (Index).Virtual then
- In_Tree.Projects.Table (Index).Object_Directory :=
+ In_Tree.Projects.Table (Index).Object_Directory.Name :=
Object_Dir;
end if;
end loop;
Extending := In_Tree.Projects.Table (Proj).Extended_By;
if Extending /= No_Project then
- Obj_Dir := In_Tree.Projects.Table (Proj).Object_Directory;
+ Obj_Dir := In_Tree.Projects.Table (Proj).Object_Directory.Name;
-- Check that a project being extended does not share its
-- object directory with any project that extends it, directly
if In_Tree.Projects.Table (Extending2).Ada_Sources /=
Nil_String
and then
- In_Tree.Projects.Table (Extending2).Object_Directory =
- Obj_Dir
+ In_Tree.Projects.Table
+ (Extending2).Object_Directory.Name = Obj_Dir
then
if In_Tree.Projects.Table (Extending2).Virtual then
Error_Msg_Name_1 :=
Processed_Data.Display_Name := Name_Find;
end if;
- Processed_Data.Display_Path_Name :=
+ Processed_Data.Path.Display_Name :=
Path_Name_Of (From_Project_Node, From_Project_Node_Tree);
- Get_Name_String (Processed_Data.Display_Path_Name);
+ Get_Name_String (Processed_Data.Path.Display_Name);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
- Processed_Data.Path_Name := Name_Find;
+ Processed_Data.Path.Name := Name_Find;
Processed_Data.Location :=
Location_Of (From_Project_Node, From_Project_Node_Tree);
- Processed_Data.Display_Directory :=
+ Processed_Data.Directory.Display_Name :=
Directory_Of (From_Project_Node, From_Project_Node_Tree);
- Get_Name_String (Processed_Data.Display_Directory);
+ Get_Name_String (Processed_Data.Directory.Display_Name);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
- Processed_Data.Directory := Name_Find;
+ Processed_Data.Directory.Name := Name_Find;
Processed_Data.Extended_By := Extended_By;
First_Referred_By => No_Project,
Name => No_Name,
Display_Name => No_Name,
- Path_Name => No_Path,
- Display_Path_Name => No_Path,
+ Path => No_Path_Information,
Virtual => False,
Location => No_Location,
Mains => Nil_String,
- Directory => No_Path,
- Display_Directory => No_Path,
+ Directory => No_Path_Information,
Dir_Path => null,
Library => False,
- Library_Dir => No_Path,
- Display_Library_Dir => No_Path,
- Library_Src_Dir => No_Path,
- Display_Library_Src_Dir => No_Path,
- Library_ALI_Dir => No_Path,
- Display_Library_ALI_Dir => No_Path,
+ Library_Dir => No_Path_Information,
+ Library_Src_Dir => No_Path_Information,
+ Library_ALI_Dir => No_Path_Information,
Library_Name => No_Name,
Library_Kind => Static,
Lib_Internal_Name => No_Name,
Include_Language => No_Language_Index,
Source_Dirs => Nil_String,
Known_Order_Of_Source_Dirs => True,
- Object_Directory => No_Path,
- Display_Object_Dir => No_Path,
+ Object_Directory => No_Path_Information,
Library_TS => Empty_Time_Stamp,
- Exec_Directory => No_Path,
- Display_Exec_Dir => No_Path,
+ Exec_Directory => No_Path_Information,
Extends => No_Project,
Extended_By => No_Project,
Naming => Std_Naming_Data,
function Empty_String return Name_Id;
-- Return the id for an empty string ""
+ type Path_Information is record
+ Name : Path_Name_Type := No_Path;
+ Display_Name : Path_Name_Type := No_Path;
+ end record;
+
+ No_Path_Information : constant Path_Information := (No_Path, No_Path);
+
type Project_Id is new Nat;
No_Project : constant Project_Id := 0;
-- Id of a Project File
Display_File : File_Name_Type := No_File;
-- File name of the source, for display purposes
- Path : Path_Name_Type := No_Path;
- -- Canonical path name of the source
-
- Display_Path : Path_Name_Type := No_Path;
- -- Path name of the source, for display purposes
+ Path : Path_Information := No_Path_Information;
+ -- Path name of the source
Source_TS : Time_Stamp_Type := Empty_Time_Stamp;
-- Time stamp of the source file
Replaced_By => No_Source,
File => No_File,
Display_File => No_File,
- Path => No_Path,
- Display_Path => No_Path,
+ Path => No_Path_Information,
Source_TS => Empty_Time_Stamp,
Object_Project => No_Project,
Object_Exists => True,
-- separator.
type Project_Data is record
+
+ -------------
+ -- General --
+ -------------
+
+ Name : Name_Id := No_Name;
+ -- The name of the project
+
+ Display_Name : Name_Id := No_Name;
+ -- The name of the project with the spelling of its declaration
+
Qualifier : Project_Qualifier := Unspecified;
-- The eventual qualifier for this project
-- True if the project is externally built. In such case, the Project
-- Manager will not modify anything in this project.
+ Config : Project_Configuration;
+
+ Path : Path_Information := No_Path_Information;
+ -- The path name of the project file
+
+ Virtual : Boolean := False;
+ -- True for virtual extending projects
+
+ Location : Source_Ptr := No_Location;
+ -- The location in the project file source of the reserved word project
+
+ Naming : Naming_Data := Standard_Naming_Data;
+ -- The naming scheme of this project file
+
+ ---------------
+ -- Languages --
+ ---------------
+
Languages : Name_List_Index := No_Name_List;
-- The list of languages of the sources of this project
- Config : Project_Configuration;
+ Include_Language : Language_Index := No_Language_Index;
+
+ First_Language_Processing : Language_Index := No_Language_Index;
+ -- First index of the language data in the project
+
+ Unit_Based_Language_Name : Name_Id := No_Name;
+ Unit_Based_Language_Index : Language_Index := No_Language_Index;
+ -- The name and index, if any, of the unit-based language of some
+ -- sources of the project. There may be only one unit-based language
+ -- in one project.
+
+ --------------
+ -- Projects --
+ --------------
First_Referred_By : Project_Id := No_Project;
-- The project, if any, that was the first to be known as importing or
-- extending this project
- Name : Name_Id := No_Name;
- -- The name of the project
+ Mains : String_List_Id := Nil_String;
+ -- List of mains specified by attribute Main
- Display_Name : Name_Id := No_Name;
- -- The name of the project with the spelling of its declaration
+ Extends : Project_Id := No_Project;
+ -- The reference of the project file, if any, that this project file
+ -- extends.
- Path_Name : Path_Name_Type := No_Path;
- -- The path name of the project file
+ Extended_By : Project_Id := No_Project;
+ -- The reference of the project file, if any, that extends this project
+ -- file.
- Display_Path_Name : Path_Name_Type := No_Path;
- -- The path name used for display purposes. May be different from
- -- Path_Name for platforms where the file names are case-insensitive.
+ Decl : Declarations := No_Declarations;
+ -- The declarations (variables, attributes and packages) of this project
+ -- file.
- Virtual : Boolean := False;
- -- True for virtual extending projects
+ Imported_Projects : Project_List := Empty_Project_List;
+ -- The list of all directly imported projects, if any
- Location : Source_Ptr := No_Location;
- -- The location in the project file source of the reserved word project
+ All_Imported_Projects : Project_List := Empty_Project_List;
+ -- The list of all projects imported directly or indirectly, if any
- Mains : String_List_Id := Nil_String;
- -- List of mains specified by attribute Main
+ -----------------
+ -- Directories --
+ -----------------
- Directory : Path_Name_Type := No_Path;
+ Directory : Path_Information := No_Path_Information;
-- Path name of the directory where the project file resides
- Display_Directory : Path_Name_Type := No_Path;
- -- The path name of the project directory, for display purposes. May be
- -- different from Directory for platforms where the file names are
- -- case-insensitive.
-
Dir_Path : String_Access;
- -- Same as Directory, but as an access to String
+ -- Same as Directory.Name, but as an access to String
+
+ Object_Directory : Path_Information := No_Path_Information;
+ -- The path name of the object directory of this project file
+
+ Exec_Directory : Path_Information := No_Path_Information;
+ -- The path name of the exec directory of this project file. Default is
+ -- equal to Object_Directory.
+
+ -------------
+ -- Library --
+ -------------
+
+ Library : Boolean := False;
+ -- True if this is a library project
+
+ Library_Name : Name_Id := No_Name;
+ -- If a library project, name of the library
- Library_Dir : Path_Name_Type := No_Path;
+ Library_Kind : Lib_Kind := Static;
+ -- If a library project, kind of library
+
+ Library_Dir : Path_Information := No_Path_Information;
-- If a library project, path name of the directory where the library
-- resides.
- Display_Library_Dir : Path_Name_Type := No_Path;
- -- The path name of the library directory, for display purposes. May be
- -- different from Library_Dir for platforms where the file names are
- -- case-insensitive.
-
Library_TS : Time_Stamp_Type := Empty_Time_Stamp;
-- The timestamp of a library file in a library project
- Library_Src_Dir : Path_Name_Type := No_Path;
+ Library_Src_Dir : Path_Information := No_Path_Information;
-- If a Stand-Alone Library project, path name of the directory where
-- the sources of the interfaces of the library are copied. By default,
-- if attribute Library_Src_Dir is not specified, sources of the
-- interfaces are not copied anywhere.
- Display_Library_Src_Dir : Path_Name_Type := No_Path;
- -- The path name of the library source directory, for display purposes.
- -- May be different from Library_Src_Dir for platforms where the file
- -- names are case-insensitive.
-
- Library_ALI_Dir : Path_Name_Type := No_Path;
+ Library_ALI_Dir : Path_Information := No_Path_Information;
-- In a library project, path name of the directory where the ALI files
-- are copied. If attribute Library_ALI_Dir is not specified, ALI files
-- are copied in the Library_Dir.
- Display_Library_ALI_Dir : Path_Name_Type := No_Path;
- -- The path name of the library ALI directory, for display purposes. May
- -- be different from Library_ALI_Dir for platforms where the file names
- -- are case-insensitive.
-
- Library : Boolean := False;
- -- True if this is a library project
-
- Library_Name : Name_Id := No_Name;
- -- If a library project, name of the library
-
- Library_Kind : Lib_Kind := Static;
- -- If a library project, kind of library
-
Lib_Internal_Name : Name_Id := No_Name;
-- If a library project, internal name store inside the library
-- For non static Stand-Alone Library Project Files, indicate if
-- the library initialisation should be automatic.
- Libgnarl_Needed : Yes_No_Unknown := Unknown;
- -- Set to True when libgnarl is needed to link
-
Symbol_Data : Symbol_Record := No_Symbols;
-- Symbol file name, reference symbol file name, symbol policy
+ Need_To_Build_Lib : Boolean := False;
+ -- Indicates that the library of a Library Project needs to be built or
+ -- rebuilt.
+
+ -------------
+ -- Sources --
+ -------------
+
Ada_Sources : String_List_Id := Nil_String;
-- The list of all the Ada source file names (gnatmake only)
-- True if attribute Interfaces is declared for the project or any
-- project it extends.
- Unit_Based_Language_Name : Name_Id := No_Name;
- Unit_Based_Language_Index : Language_Index := No_Language_Index;
- -- The name and index, if any, of the unit-based language of some
- -- sources of the project. There may be only one unit-based language
- -- in one project.
-
Imported_Directories_Switches : Argument_List_Access := null;
-- List of the source search switches (-I<source dir>) to be used when
-- compiling.
Include_Path : String_Access := null;
- -- Value of the environment variable to indicate the source search path,
- -- instead of a list of switches (Imported_Directories_Switches).
+ -- The search source path for the project. Used as the value for an
+ -- environment variable, specified by attribute Include_Path
+ -- (<language>). The names of the environment variables are in component
+ -- Include_Path of the records Language_Config.
Include_Path_File : Path_Name_Type := No_Path;
-- The path name of the of the source search directory file
Include_Data_Set : Boolean := False;
-- Set True when Imported_Directories_Switches or Include_Path are set
- Include_Language : Language_Index := No_Language_Index;
-
Source_Dirs : String_List_Id := Nil_String;
-- The list of all the source directories
-- the ordering of the source subdirs depend on the OS. If True,
-- duplicate file names in the same project file are allowed.
- Object_Directory : Path_Name_Type := No_Path;
- -- The path name of the object directory of this project file
-
- Display_Object_Dir : Path_Name_Type := No_Path;
- -- The path name of the object directory, for display purposes. May be
- -- different from Object_Directory for platforms where the file names
- -- are case-insensitive.
-
- Exec_Directory : Path_Name_Type := No_Path;
- -- The path name of the exec directory of this project file. Default is
- -- equal to Object_Directory.
-
- Display_Exec_Dir : Path_Name_Type := No_Path;
- -- The path name of the exec directory, for display purposes. May be
- -- different from Exec_Directory for platforms where the file names are
- -- case-insensitive.
-
- Extends : Project_Id := No_Project;
- -- The reference of the project file, if any, that this project file
- -- extends.
-
- Extended_By : Project_Id := No_Project;
- -- The reference of the project file, if any, that extends this project
- -- file.
-
- Naming : Naming_Data := Standard_Naming_Data;
- -- The naming scheme of this project file
+ Ada_Include_Path : String_Access := null;
+ -- The cached value of source search path for this project file. Set by
+ -- the first call to Prj.Env.Ada_Include_Path for the project. Do not
+ -- use this field directly outside of the project manager, use
+ -- Prj.Env.Ada_Include_Path instead.
- First_Language_Processing : Language_Index := No_Language_Index;
- -- First index of the language data in the project
+ -------------
+ -- Linking --
+ -------------
- Decl : Declarations := No_Declarations;
- -- The declarations (variables, attributes and packages) of this project
- -- file.
+ Linker_Name : File_Name_Type := No_File;
+ -- Value of attribute Language_Processing'Linker in the project file
- Imported_Projects : Project_List := Empty_Project_List;
- -- The list of all directly imported projects, if any
+ Linker_Path : Path_Name_Type := No_Path;
+ -- Path of linker when attribute Language_Processing'Linker is specified
- All_Imported_Projects : Project_List := Empty_Project_List;
- -- The list of all projects imported directly or indirectly, if any
+ Minimum_Linker_Options : Name_List_Index := No_Name_List;
+ -- List of options specified in attribute
+ -- Language_Processing'Minimum_Linker_Options.
- Ada_Include_Path : String_Access := null;
- -- The cached value of ADA_INCLUDE_PATH for this project file. Do not
- -- use this field directly outside of the compiler, use
- -- Prj.Env.Ada_Include_Path instead.
+ -------------------
+ -- Miscellaneous --
+ -------------------
Ada_Objects_Path : String_Access := null;
-- The cached value of ADA_OBJECTS_PATH for this project file. Do not
-- use this field directly outside of the compiler, use
-- Prj.Env.Ada_Objects_Path instead.
+ Libgnarl_Needed : Yes_No_Unknown := Unknown;
+ -- Set to True when libgnarl is needed to link
+
Objects_Path : String_Access := null;
-- The cached value of the object dir path, used during the binding
-- phase of gprbuild.
-- An indication that the configuration pragmas file is a temporary file
-- that must be deleted at the end.
- Linker_Name : File_Name_Type := No_File;
- -- Value of attribute Language_Processing'Linker in the project file
-
- Linker_Path : Path_Name_Type := No_Path;
- -- Path of linker when attribute Language_Processing'Linker is specified
-
- Minimum_Linker_Options : Name_List_Index := No_Name_List;
- -- List of options specified in attribute
- -- Language_Processing'Minimum_Linker_Options.
-
Config_Checked : Boolean := False;
-- A flag to avoid checking repetitively the configuration pragmas file
-- A flag to mark a project as "visited" to avoid processing the same
-- project several time.
- Need_To_Build_Lib : Boolean := False;
- -- Indicates that the library of a Library Project needs to be built or
- -- rebuilt.
-
Depth : Natural := 0;
-- The maximum depth of a project in the project graph. Depth of main
-- project is 0.
type Spec_Or_Body is (Specification, Body_Part);
type File_Name_Data is record
- Name : File_Name_Type := No_File;
- Index : Int := 0;
- Display_Name : File_Name_Type := No_File;
- Path : Path_Name_Type := No_Path;
- Display_Path : Path_Name_Type := No_Path;
- Project : Project_Id := No_Project;
- Needs_Pragma : Boolean := False;
+ Name : File_Name_Type := No_File;
+ Index : Int := 0;
+ Display_Name : File_Name_Type := No_File;
+ Path : Path_Information := No_Path_Information;
+ Project : Project_Id := No_Project;
+ Needs_Pragma : Boolean := False;
end record;
-- File and Path name of a spec or body