diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-31 11:51:11 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-31 11:51:11 +0200 |
commit | 972fb59e54c1df4e076e113721be78ff6ce1c391 (patch) | |
tree | 1d11510d5f74450666c6630879163f3d73af5326 /gcc/ada/prj-nmsc.adb | |
parent | c1c8247201bd938d49716db8edc2767ff2a4d7d5 (diff) | |
download | gcc-972fb59e54c1df4e076e113721be78ff6ce1c391.zip gcc-972fb59e54c1df4e076e113721be78ff6ce1c391.tar.gz gcc-972fb59e54c1df4e076e113721be78ff6ce1c391.tar.bz2 |
[multiple changes]
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Has_Preelaborable_Initialization): Check that
type is tagged before checking whether a user-defined Initialize
procedure is present.
2014-07-31 Gary Dismukes <dismukes@adacore.com>
* a-ngelfu.ads (Sqrt): Augment postcondition.
2014-07-31 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb (Check_Library_Attributes): An aggegate library
directory and ALI directory must be different than all object
and library directories of aggregated projects.
2014-07-31 Vincent Celier <celier@adacore.com>
* prj-pars.adb, prj-conf.ads, prj-conf.adb (Locate_Runtime): Move spec
to package body, as it is not called from outside. Remove argument
Project_Tree, no longer used. When runtime cannot be found,
call Raise_Invalid_Config instead of failing the program.
From-SVN: r213330
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 19c12de..96d3777 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -3028,6 +3028,76 @@ package body Prj.Nmsc is procedure Check_Library (Proj : Project_Id; Extends : Boolean); -- Check if an imported or extended project if also a library project + procedure Check_Aggregate_Library_Dirs; + + ---------------------------------- + -- Check_Aggregate_Library_Dirs -- + ---------------------------------- + + procedure Check_Aggregate_Library_Dirs is + procedure Process_Aggregate (Proj : Project_Id); + + procedure Process_Aggregate (Proj : Project_Id) is + + Agg : Aggregated_Project_List := Proj.Aggregated_Projects; + + begin + while Agg /= null loop + Error_Msg_Name_1 := Agg.Project.Name; + + if Agg.Project.Qualifier /= Aggregate_Library and then + Project.Library_ALI_Dir.Name + = Agg.Project.Object_Directory.Name + then + Error_Msg + (Data.Flags, + "aggregate library 'A'L'I directory cannot be shared with" + & " object directory of aggregated project %%", + The_Lib_Kind.Location, Project); + + elsif Project.Library_ALI_Dir.Name + = Agg.Project.Library_Dir.Name + then + Error_Msg + (Data.Flags, + "aggregate library 'A'L'I directory cannot be shared with" + & " library directory of aggregated project %%", + The_Lib_Kind.Location, Project); + + elsif Agg.Project.Qualifier /= Aggregate_Library and then + Project.Library_Dir.Name + = Agg.Project.Object_Directory.Name + then + Error_Msg + (Data.Flags, + "aggregate library directory cannot be shared with" + & " object directory of aggregated project %%", + The_Lib_Kind.Location, Project); + + elsif Project.Library_Dir.Name + = Agg.Project.Library_Dir.Name + then + Error_Msg + (Data.Flags, + "aggregate library directory cannot be shared with" + & " library directory of aggregated project %%", + The_Lib_Kind.Location, Project); + end if; + + if Agg.Project.Qualifier = Aggregate_Library then + Process_Aggregate (Agg.Project); + end if; + + Agg := Agg.Next; + end loop; + end Process_Aggregate; + + begin + if Project.Qualifier = Aggregate_Library then + Process_Aggregate (Project); + end if; + end Check_Aggregate_Library_Dirs; + ------------------- -- Check_Library -- ------------------- @@ -3745,6 +3815,13 @@ package body Prj.Nmsc is Continuation := Continuation_String'Access; end if; + -- Check that aggregated libraries do not share the aggregate + -- Library_ALI_Dir. + + if Project.Qualifier = Aggregate_Library then + Check_Aggregate_Library_Dirs; + end if; + if Project.Library and not Data.In_Aggregate_Lib then -- Record the library name |