aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/mlib-prj.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 11:28:10 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 11:28:10 +0200
commit94fb7608441bd960315df71ce953d9a88a9f74a3 (patch)
treee80bc0010abd61710289dc0d21c3388988b71aeb /gcc/ada/mlib-prj.adb
parentc5ecd6b73c89668590555d62b39f954618c27978 (diff)
downloadgcc-94fb7608441bd960315df71ce953d9a88a9f74a3.zip
gcc-94fb7608441bd960315df71ce953d9a88a9f74a3.tar.gz
gcc-94fb7608441bd960315df71ce953d9a88a9f74a3.tar.bz2
[multiple changes]
2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: When reading a P statement SCO without a pragma name (from an older ALI file), ensure that the Pragma_Name component is set to Unknown_Pragma (not left uninitialized). 2011-08-29 Vincent Celier <celier@adacore.com> * makeutl.adb (Get_Directories): New procedure moved from Buildgpr and modified to compute correctly the object path of a SAL project that is extending another library project. (Write_Path_File): New procedure. * makeutl.ads (Directories): New table moved from Buildgpr (Get_Directories): New procedure moved from Buildgpr (Write_Path_File): New procedure * mlib-prj.adb (Build_Library): Use Makeutl.Get_Directories to set the paths before binding SALs, instead of Set_Ada_Paths. * prj-env.adb (Set_Path_File_Var): Procedure has been moved to package Prj. * prj.adb (Set_Path_File_Var): New procedure moved from Prj.Env (Current_Source_Path_File_Of): New function (Set_Current_Object_Path_File_Of): New procedure (Current_Source_Object_File_Of): New function (Set_Current_Object_Path_File_Of): New procedure * prj.ads (Set_Path_File_Var): New procedure moved from Prj.Env (Current_Source_Path_File_Of): New function (Set_Current_Object_Path_File_Of): New procedure (Current_Source_Object_File_Of): New function (Set_Current_Object_Path_File_Of): New procedure 2011-08-29 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_N_Assignment_Statement): For an assignment to a packed entity, use a bit-field assignment only if there is no change of representation. From-SVN: r178177
Diffstat (limited to 'gcc/ada/mlib-prj.adb')
-rw-r--r--gcc/ada/mlib-prj.adb58
1 files changed, 54 insertions, 4 deletions
diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb
index 9ac12e7..b01ad9d 100644
--- a/gcc/ada/mlib-prj.adb
+++ b/gcc/ada/mlib-prj.adb
@@ -25,6 +25,7 @@
with ALI; use ALI;
with Gnatvsn; use Gnatvsn;
+with Makeutl; use Makeutl;
with MLib.Fil; use MLib.Fil;
with MLib.Tgt; use MLib.Tgt;
with MLib.Utl; use MLib.Utl;
@@ -802,6 +803,9 @@ package body MLib.Prj is
end loop;
end Process_Imported_Libraries;
+ Path_FD : File_Descriptor := Invalid_FD;
+ -- Used for setting the source and object paths
+
-- Start of processing for Build_Library
begin
@@ -1044,10 +1048,56 @@ package body MLib.Prj is
-- Set the paths
- Set_Ada_Paths
- (Project => For_Project,
- In_Tree => In_Tree,
- Including_Libraries => True);
+ -- First the source path
+
+ if For_Project.Include_Path_File = No_Path then
+ Get_Directories
+ (Project_Tree => In_Tree,
+ For_Project => For_Project,
+ Activity => Compilation,
+ Languages => Ada_Only);
+
+ Create_New_Path_File
+ (In_Tree.Shared, Path_FD, For_Project.Include_Path_File);
+
+ Write_Path_File (Path_FD);
+ Path_FD := Invalid_FD;
+
+ end if;
+
+ if Current_Source_Path_File_Of (In_Tree.Shared) /=
+ For_Project.Include_Path_File
+ then
+ Set_Current_Source_Path_File_Of
+ (In_Tree.Shared,
+ For_Project.Include_Path_File);
+ Set_Path_File_Var
+ (Project_Include_Path_File,
+ Get_Name_String (For_Project.Include_Path_File));
+ end if;
+
+ -- Then, the object path
+
+ Get_Directories
+ (Project_Tree => In_Tree,
+ For_Project => For_Project,
+ Activity => SAL_Binding,
+ Languages => Ada_Only);
+
+ declare
+ Path_File_Name : Path_Name_Type;
+ begin
+ Create_New_Path_File (In_Tree.Shared, Path_FD, Path_File_Name);
+
+ Write_Path_File (Path_FD);
+ Path_FD := Invalid_FD;
+
+ Set_Path_File_Var
+ (Project_Objects_Path_File,
+ Get_Name_String (Path_File_Name));
+ Set_Current_Source_Path_File_Of
+ (In_Tree.Shared, Path_File_Name);
+ end;
-- Display the gnatbind command, if not in quiet output