Commit 3b3c0430 by Vincent Celier Committed by Arnaud Charlet

2008-05-27 Vincent Celier <celier@adacore.com>

	* gnatcmd.adb, prj-proc.adb, make.adb, mlib-prj.adb, prj.adb,
	prj.ads, makegpr.adb, makeutl.adb, clean.adb, prj-nmsc.adb,
	mlib-tgt.adb, prj-env.adb, prj-env.ads:
	(Path_Information): New record type
	Use component of type Path_Information when there are two paths, one in
	canonical format and one in display format.
	Update the project manager to these new components.

From-SVN: r136008
parent d153b458
...@@ -346,7 +346,7 @@ package body Clean is ...@@ -346,7 +346,7 @@ package body Clean is
-- The name of the archive dependency file for this project -- The name of the archive dependency file for this project
Obj_Dir : constant String := Obj_Dir : constant String :=
Get_Name_String (Data.Display_Object_Dir); Get_Name_String (Data.Object_Directory.Display_Name);
begin begin
Change_Dir (Obj_Dir); Change_Dir (Obj_Dir);
...@@ -551,10 +551,10 @@ package body Clean is ...@@ -551,10 +551,10 @@ package body Clean is
Unit : Unit_Data; Unit : Unit_Data;
begin 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 declare
Directory : constant String := Directory : constant String :=
Get_Name_String (Data.Display_Library_Src_Dir); Get_Name_String (Data.Library_Src_Dir.Display_Name);
begin begin
Change_Dir (Directory); Change_Dir (Directory);
...@@ -663,10 +663,11 @@ package body Clean is ...@@ -663,10 +663,11 @@ package body Clean is
declare declare
Lib_Directory : constant String := Lib_Directory : constant String :=
Get_Name_String (Data.Display_Library_Dir); Get_Name_String
(Data.Library_Dir.Display_Name);
Lib_ALI_Directory : constant String := Lib_ALI_Directory : constant String :=
Get_Name_String Get_Name_String
(Data.Display_Library_ALI_Dir); (Data.Library_ALI_Dir.Display_Name);
begin begin
Canonical_Case_File_Name (Archive_Name); Canonical_Case_File_Name (Archive_Name);
...@@ -863,10 +864,11 @@ package body Clean is ...@@ -863,10 +864,11 @@ package body Clean is
Processed_Projects.Increment_Last; Processed_Projects.Increment_Last;
Processed_Projects.Table (Processed_Projects.Last) := Project; Processed_Projects.Table (Processed_Projects.Last) := Project;
if Data.Object_Directory /= No_Path then if Data.Object_Directory /= No_Path_Information then
declare declare
Obj_Dir : constant String := Obj_Dir : constant String :=
Get_Name_String (Data.Display_Object_Dir); Get_Name_String
(Data.Object_Directory.Display_Name);
begin begin
Change_Dir (Obj_Dir); Change_Dir (Obj_Dir);
...@@ -1089,16 +1091,16 @@ package body Clean is ...@@ -1089,16 +1091,16 @@ package body Clean is
if not Compile_Only then if not Compile_Only then
Clean_Library_Directory (Project); 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); Clean_Interface_Copy_Directory (Project);
end if; end if;
end if; end if;
if Data.Standalone_Library and then if Data.Standalone_Library and then
Data.Object_Directory /= No_Path Data.Object_Directory /= No_Path_Information
then then
Delete_Binder_Generated_Files 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)); File_Name_Type (Data.Library_Name));
end if; end if;
end if; end if;
...@@ -1156,10 +1158,12 @@ package body Clean is ...@@ -1156,10 +1158,12 @@ package body Clean is
-- The executables are deleted only if switch -c is not specified -- 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 declare
Exec_Dir : constant String := Exec_Dir : constant String :=
Get_Name_String (Data.Display_Exec_Dir); Get_Name_String (Data.Exec_Directory.Display_Name);
begin begin
Change_Dir (Exec_Dir); Change_Dir (Exec_Dir);
...@@ -1193,9 +1197,9 @@ package body Clean is ...@@ -1193,9 +1197,9 @@ package body Clean is
end; end;
end if; end if;
if Data.Object_Directory /= No_Path then if Data.Object_Directory /= No_Path_Information then
Delete_Binder_Generated_Files Delete_Binder_Generated_Files
(Get_Name_String (Data.Display_Object_Dir), (Get_Name_String (Data.Object_Directory.Display_Name),
Strip_Suffix (Main_Source_File)); Strip_Suffix (Main_Source_File));
end if; end if;
end loop; end loop;
......
...@@ -551,7 +551,7 @@ package body Makegpr is ...@@ -551,7 +551,7 @@ package body Makegpr is
if not For_Gnatmake then if not For_Gnatmake then
if Data.Library_Kind = Static then if Data.Library_Kind = Static then
Add_Argument Add_Argument
(Get_Name_String (Data.Display_Library_Dir) & (Get_Name_String (Data.Library_Dir.Display_Name) &
Directory_Separator & Directory_Separator &
"lib" & Get_Name_String (Data.Library_Name) & "lib" & Get_Name_String (Data.Library_Name) &
'.' & Archive_Ext, '.' & Archive_Ext,
...@@ -565,7 +565,7 @@ package body Makegpr is ...@@ -565,7 +565,7 @@ package body Makegpr is
("-l" & Get_Name_String (Data.Library_Name), ("-l" & Get_Name_String (Data.Library_Name),
Verbose_Mode); Verbose_Mode);
Get_Name_String (Data.Display_Library_Dir); Get_Name_String (Data.Library_Dir.Display_Name);
Add_Argument Add_Argument
("-L" & Name_Buffer (1 .. Name_Len), ("-L" & Name_Buffer (1 .. Name_Len),
...@@ -617,7 +617,7 @@ package body Makegpr is ...@@ -617,7 +617,7 @@ package body Makegpr is
elsif Project = Main_Project and then Global_Archive_Exists then elsif Project = Main_Project and then Global_Archive_Exists then
Add_Argument Add_Argument
(Get_Name_String (Data.Display_Object_Dir) & (Get_Name_String (Data.Object_Directory.Display_Name) &
Directory_Separator & Directory_Separator &
"lib" & Get_Name_String (Data.Display_Name) "lib" & Get_Name_String (Data.Display_Name)
& '.' & Archive_Ext, & '.' & Archive_Ext,
...@@ -1069,13 +1069,13 @@ package body Makegpr is ...@@ -1069,13 +1069,13 @@ package body Makegpr is
if Project_Of_Current_Object_Directory /= Main_Project then if Project_Of_Current_Object_Directory /= Main_Project then
Project_Of_Current_Object_Directory := Main_Project; 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 if Verbose_Mode then
Write_Str ("Changing to object directory of """); Write_Str ("Changing to object directory of """);
Write_Name (Data.Display_Name); Write_Name (Data.Display_Name);
Write_Str (""": """); Write_Str (""": """);
Write_Name (Data.Display_Object_Dir); Write_Name (Data.Object_Directory.Display_Name);
Write_Line (""""); Write_Line ("""");
end if; end if;
end if; end if;
...@@ -1647,7 +1647,8 @@ package body Makegpr is ...@@ -1647,7 +1647,8 @@ package body Makegpr is
MLib.Build_Library MLib.Build_Library
(Ofiles => Arguments (1 .. Last_Argument), (Ofiles => Arguments (1 .. Last_Argument),
Output_File => Get_Name_String (Data.Library_Name), 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 else
-- Link with g++ if C++ is one of the languages, otherwise -- Link with g++ if C++ is one of the languages, otherwise
...@@ -1709,7 +1710,7 @@ package body Makegpr is ...@@ -1709,7 +1710,7 @@ package body Makegpr is
Options => Lib_Opts.all, Options => Lib_Opts.all,
Interfaces => No_Argument, Interfaces => No_Argument,
Lib_Filename => Get_Name_String (Data.Library_Name), 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, Symbol_Data => No_Symbols,
Driver_Name => Driver_Name, Driver_Name => Driver_Name,
Lib_Version => "", Lib_Version => "",
...@@ -2460,13 +2461,13 @@ package body Makegpr is ...@@ -2460,13 +2461,13 @@ package body Makegpr is
if Project_Of_Current_Object_Directory /= Main_Project then if Project_Of_Current_Object_Directory /= Main_Project then
Project_Of_Current_Object_Directory := Main_Project; 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 if Verbose_Mode then
Write_Str ("Changing to object directory of """); Write_Str ("Changing to object directory of """);
Write_Name (Data.Name); Write_Name (Data.Name);
Write_Str (""": """); Write_Str (""": """);
Write_Name (Data.Display_Object_Dir); Write_Name (Data.Object_Directory.Display_Name);
Write_Line (""""); Write_Line ("""");
end if; end if;
end if; end if;
...@@ -2567,7 +2568,7 @@ package body Makegpr is ...@@ -2567,7 +2568,7 @@ package body Makegpr is
-- Specify the project file -- Specify the project file
Add_Argument (Dash_P, True); 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 -- Add the saved switches, if any
...@@ -2774,13 +2775,13 @@ package body Makegpr is ...@@ -2774,13 +2775,13 @@ package body Makegpr is
if Project_Of_Current_Object_Directory /= Project then if Project_Of_Current_Object_Directory /= Project then
Project_Of_Current_Object_Directory := Project; 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 if Verbose_Mode then
Write_Str ("Changing to object directory of """); Write_Str ("Changing to object directory of """);
Write_Name (Data.Display_Name); Write_Name (Data.Display_Name);
Write_Str (""": """); Write_Str (""": """);
Write_Name (Data.Display_Object_Dir); Write_Name (Data.Object_Directory.Display_Name);
Write_Line (""""); Write_Line ("""");
end if; end if;
end if; end if;
...@@ -3351,7 +3352,7 @@ package body Makegpr is ...@@ -3351,7 +3352,7 @@ package body Makegpr is
if not Compile_Only if not Compile_Only
and then not Data.Library and then not Data.Library
and then Data.Object_Directory /= No_Path and then Data.Object_Directory /= No_Path_Information
then then
Build_Global_Archive; Build_Global_Archive;
Link_Executables; Link_Executables;
...@@ -3513,7 +3514,7 @@ package body Makegpr is ...@@ -3513,7 +3514,7 @@ package body Makegpr is
-- True if main sources were specified on the command line -- True if main sources were specified on the command line
Object_Dir : constant String := 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 -- Path of the object directory of the main project
Source_Id : Other_Source_Id; Source_Id : Other_Source_Id;
...@@ -3576,7 +3577,8 @@ package body Makegpr is ...@@ -3576,7 +3577,8 @@ package body Makegpr is
if Data.Other_Sources_Present then if Data.Other_Sources_Present then
declare declare
Archive_Path : constant String := Get_Name_String 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) & "lib" & Get_Name_String (Prj_Data.Display_Name)
& '.' & Archive_Ext; & '.' & Archive_Ext;
Archive_TS : Time_Stamp_Type; Archive_TS : Time_Stamp_Type;
...@@ -3641,7 +3643,7 @@ package body Makegpr is ...@@ -3641,7 +3643,7 @@ package body Makegpr is
Executable_Path : constant String := Executable_Path : constant String :=
Get_Name_String Get_Name_String
(Data.Display_Exec_Dir) & (Data.Exec_Directory.Display_Name) &
Directory_Separator & Executable_Name; Directory_Separator & Executable_Name;
-- Path name of the executable -- Path name of the executable
...@@ -3699,7 +3701,7 @@ package body Makegpr is ...@@ -3699,7 +3701,7 @@ package body Makegpr is
Add_Argument (Dash_o, True); Add_Argument (Dash_o, True);
Add_Argument Add_Argument
(Get_Name_String (Data.Display_Exec_Dir) & (Get_Name_String (Data.Exec_Directory.Display_Name) &
Directory_Separator & Directory_Separator &
Get_Name_String Get_Name_String
(Executable_Of (Executable_Of
......
...@@ -442,7 +442,7 @@ package body Makeutl is ...@@ -442,7 +442,7 @@ package body Makeutl is
new String' new String'
(Get_Name_String (Get_Name_String
(In_Tree.Projects.Table (In_Tree.Projects.Table
(Proj). Directory)); (Proj).Directory.Name));
end if; end if;
while Options /= Nil_String loop while Options /= Nil_String loop
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -340,7 +340,7 @@ package body MLib.Tgt is ...@@ -340,7 +340,7 @@ package body MLib.Tgt is
declare declare
Lib_Dir : constant String := Lib_Dir : constant String :=
Get_Name_String Get_Name_String
(In_Tree.Projects.Table (Project).Library_Dir); (In_Tree.Projects.Table (Project).Library_Dir.Name);
Lib_Name : constant String := Lib_Name : constant String :=
Get_Name_String Get_Name_String
(In_Tree.Projects.Table (Project).Library_Name); (In_Tree.Projects.Table (Project).Library_Name);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -85,14 +85,14 @@ package Prj.Env is ...@@ -85,14 +85,14 @@ package Prj.Env is
function Ada_Include_Path function Ada_Include_Path
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref) return String_Access; In_Tree : Project_Tree_Ref) return String_Access;
-- Get the ADA_INCLUDE_PATH of a Project file. For the first call, compute -- Get the source search path of a Project file. For the first call,
-- it and cache it. -- compute it and cache it.
function Ada_Include_Path function Ada_Include_Path
(Project : Project_Id; (Project : Project_Id;
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Recursive : Boolean) return String; 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 -- get all the source directories of the imported and modified project
-- files (recursively). If Recursive is False, just get the path for the -- files (recursively). If Recursive is False, just get the path for the
-- source directories of Project. Note: the resulting String may be empty -- source directories of Project. Note: the resulting String may be empty
......
...@@ -2315,13 +2315,13 @@ package body Prj.Proc is ...@@ -2315,13 +2315,13 @@ package body Prj.Proc is
declare declare
Object_Dir : constant Path_Name_Type := Object_Dir : constant Path_Name_Type :=
In_Tree.Projects.Table In_Tree.Projects.Table
(Project).Object_Directory; (Project).Object_Directory.Name;
begin begin
for Index in for Index in
Project_Table.First .. Project_Table.Last (In_Tree.Projects) Project_Table.First .. Project_Table.Last (In_Tree.Projects)
loop loop
if In_Tree.Projects.Table (Index).Virtual then 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; Object_Dir;
end if; end if;
end loop; end loop;
...@@ -2338,7 +2338,7 @@ package body Prj.Proc is ...@@ -2338,7 +2338,7 @@ package body Prj.Proc is
Extending := In_Tree.Projects.Table (Proj).Extended_By; Extending := In_Tree.Projects.Table (Proj).Extended_By;
if Extending /= No_Project then 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 -- Check that a project being extended does not share its
-- object directory with any project that extends it, directly -- object directory with any project that extends it, directly
...@@ -2351,8 +2351,8 @@ package body Prj.Proc is ...@@ -2351,8 +2351,8 @@ package body Prj.Proc is
if In_Tree.Projects.Table (Extending2).Ada_Sources /= if In_Tree.Projects.Table (Extending2).Ada_Sources /=
Nil_String Nil_String
and then and then
In_Tree.Projects.Table (Extending2).Object_Directory = In_Tree.Projects.Table
Obj_Dir (Extending2).Object_Directory.Name = Obj_Dir
then then
if In_Tree.Projects.Table (Extending2).Virtual then if In_Tree.Projects.Table (Extending2).Virtual then
Error_Msg_Name_1 := Error_Msg_Name_1 :=
...@@ -2562,20 +2562,20 @@ package body Prj.Proc is ...@@ -2562,20 +2562,20 @@ package body Prj.Proc is
Processed_Data.Display_Name := Name_Find; Processed_Data.Display_Name := Name_Find;
end if; end if;
Processed_Data.Display_Path_Name := Processed_Data.Path.Display_Name :=
Path_Name_Of (From_Project_Node, From_Project_Node_Tree); 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)); Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Processed_Data.Path_Name := Name_Find; Processed_Data.Path.Name := Name_Find;
Processed_Data.Location := Processed_Data.Location :=
Location_Of (From_Project_Node, From_Project_Node_Tree); 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); 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)); 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; Processed_Data.Extended_By := Extended_By;
......
...@@ -95,21 +95,16 @@ package body Prj is ...@@ -95,21 +95,16 @@ package body Prj is
First_Referred_By => No_Project, First_Referred_By => No_Project,
Name => No_Name, Name => No_Name,
Display_Name => No_Name, Display_Name => No_Name,
Path_Name => No_Path, Path => No_Path_Information,
Display_Path_Name => No_Path,
Virtual => False, Virtual => False,
Location => No_Location, Location => No_Location,
Mains => Nil_String, Mains => Nil_String,
Directory => No_Path, Directory => No_Path_Information,
Display_Directory => No_Path,
Dir_Path => null, Dir_Path => null,
Library => False, Library => False,
Library_Dir => No_Path, Library_Dir => No_Path_Information,
Display_Library_Dir => No_Path, Library_Src_Dir => No_Path_Information,
Library_Src_Dir => No_Path, Library_ALI_Dir => No_Path_Information,
Display_Library_Src_Dir => No_Path,
Library_ALI_Dir => No_Path,
Display_Library_ALI_Dir => No_Path,
Library_Name => No_Name, Library_Name => No_Name,
Library_Kind => Static, Library_Kind => Static,
Lib_Internal_Name => No_Name, Lib_Internal_Name => No_Name,
...@@ -131,11 +126,9 @@ package body Prj is ...@@ -131,11 +126,9 @@ package body Prj is
Include_Language => No_Language_Index, Include_Language => No_Language_Index,
Source_Dirs => Nil_String, Source_Dirs => Nil_String,
Known_Order_Of_Source_Dirs => True, Known_Order_Of_Source_Dirs => True,
Object_Directory => No_Path, Object_Directory => No_Path_Information,
Display_Object_Dir => No_Path,
Library_TS => Empty_Time_Stamp, Library_TS => Empty_Time_Stamp,
Exec_Directory => No_Path, Exec_Directory => No_Path_Information,
Display_Exec_Dir => No_Path,
Extends => No_Project, Extends => No_Project,
Extended_By => No_Project, Extended_By => No_Project,
Naming => Std_Naming_Data, Naming => Std_Naming_Data,
......
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