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
-- 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);
......@@ -551,10 +551,10 @@ package body Clean is
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);
......@@ -663,10 +663,11 @@ package body Clean is
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);
......@@ -863,10 +864,11 @@ package body Clean is
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);
......@@ -1089,16 +1091,16 @@ package body Clean is
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;
......@@ -1156,10 +1158,12 @@ package body Clean is
-- 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);
......@@ -1193,9 +1197,9 @@ package body Clean is
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;
......
......@@ -551,7 +551,7 @@ package body Makegpr is
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,
......@@ -565,7 +565,7 @@ package body Makegpr is
("-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),
......@@ -617,7 +617,7 @@ package body Makegpr is
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,
......@@ -1069,13 +1069,13 @@ package body Makegpr is
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;
......@@ -1647,7 +1647,8 @@ package body Makegpr is
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
......@@ -1709,7 +1710,7 @@ package body Makegpr is
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 => "",
......@@ -2460,13 +2461,13 @@ package body Makegpr is
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;
......@@ -2567,7 +2568,7 @@ package body Makegpr is
-- 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
......@@ -2774,13 +2775,13 @@ package body Makegpr is
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;
......@@ -3351,7 +3352,7 @@ package body Makegpr is
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;
......@@ -3513,7 +3514,7 @@ package body Makegpr is
-- 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;
......@@ -3576,7 +3577,8 @@ package body Makegpr is
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;
......@@ -3641,7 +3643,7 @@ package body Makegpr is
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
......@@ -3699,7 +3701,7 @@ package body Makegpr is
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
......
......@@ -442,7 +442,7 @@ package body Makeutl is
new String'
(Get_Name_String
(In_Tree.Projects.Table
(Proj). Directory));
(Proj).Directory.Name));
end if;
while Options /= Nil_String loop
......
......@@ -6,7 +6,7 @@
-- --
-- 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- --
......@@ -340,7 +340,7 @@ package body MLib.Tgt is
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);
......
......@@ -6,7 +6,7 @@
-- --
-- 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- --
......@@ -85,14 +85,14 @@ package Prj.Env is
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
......
......@@ -2315,13 +2315,13 @@ package body Prj.Proc is
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;
......@@ -2338,7 +2338,7 @@ package body Prj.Proc is
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
......@@ -2351,8 +2351,8 @@ package body Prj.Proc is
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 :=
......@@ -2562,20 +2562,20 @@ package body Prj.Proc is
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;
......
......@@ -95,21 +95,16 @@ package body Prj is
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,
......@@ -131,11 +126,9 @@ package body Prj is
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,
......
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