diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-12-21 12:50:02 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-12-21 12:50:02 +0100 |
commit | 76f734d8f50612486c0eb696468582fce0128f92 (patch) | |
tree | 63f6709f6bf7f6b0777b446a6e923af90c5c130b /gcc/ada/prj-nmsc.adb | |
parent | 916e8d27947d5f0590d31bb1c5529e82dc2136e9 (diff) | |
download | gcc-76f734d8f50612486c0eb696468582fce0128f92.zip gcc-76f734d8f50612486c0eb696468582fce0128f92.tar.gz gcc-76f734d8f50612486c0eb696468582fce0128f92.tar.bz2 |
[multiple changes]
2011-12-21 Pascal Obry <obry@adacore.com>
* prj-attr.adb, snames.ads-tmpl: Add Library_Standalone,
Library_Fully_Standalone_Options and
Library_Fully_Standalone_Supported attributes.
* prj-nmsc.adb (Check_Library): Update check to take into
account fully standalone libraries. Such shared libraries can
only depend on static libraries.
(Check_Stand_Alone_Library): Add support for fully standalone libraries.
(Process_Project_Level_Simple_Attributes): Store value for
configuration attribute Library_Fully_Standalone_Supported.
* prj.ads, makeutl.adb (Standalone): New enumeration type.
(Project_Data): Standalone_Library now of type Standlone.
(Project_Configuration): Add Lib_Fully_Standalone_Supported
field.
(Default_Project_Config): Initialize new Lib_Fully_Standalone_Supported
field.
* clean.adb (Clean_Project): Adjust to new type for Standalone.
* make.adb (Library_Phase): Adjust to new type for Standalone.
(Gnatmake): Likewise.
* mlib-prj.adb (Build_Library): Adjust to new type for
Standalone.
2011-12-21 Thomas Quinot <quinot@adacore.com>
* gnatls.adb (Gnatls): Call Set_Standard_Error at startup, and then
Set_Standard_Output just before producing normal (non-diagnostic)
output.
* gnatcmd.adb (Gnatcmd): Call Set_Standard_Error at initialization
(and again after parsing project files).
2011-12-21 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Do_Autoconf): When the object directory does
not exist, create auto.cgpr in the directory where temporary
files are created.
From-SVN: r182573
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 133 |
1 files changed, 109 insertions, 24 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 017db6b..678b6e9 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -2155,6 +2155,24 @@ package body Prj.Nmsc is Attribute.Value.Location, Project); end; + elsif + Attribute.Name = Name_Library_Fully_Standalone_Supported + then + declare + pragma Unsuppress (All_Checks); + begin + Project.Config.Lib_Fully_Standalone_Supported := + Boolean'Value (Get_Name_String (Attribute.Value.Value)); + exception + when Constraint_Error => + Error_Msg + (Data.Flags, + "invalid value """ + & Get_Name_String (Attribute.Value.Value) + & """ for Library_Fully_Standalone_Supported", + Attribute.Value.Location, Project); + end; + elsif Attribute.Name = Name_Shared_Library_Prefix then Project.Config.Shared_Lib_Prefix := File_Name_Type (Attribute.Value.Value); @@ -2778,36 +2796,39 @@ package body Prj.Nmsc is is Shared : constant Shared_Project_Tree_Data_Access := Data.Tree.Shared; - Attributes : constant Prj.Variable_Id := Project.Decl.Attributes; + Attributes : constant Prj.Variable_Id := Project.Decl.Attributes; - Lib_Dir : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_Dir, Attributes, Shared); + Lib_Dir : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Dir, Attributes, Shared); - Lib_Name : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_Name, Attributes, Shared); + Lib_Name : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Name, Attributes, Shared); - Lib_Version : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_Version, Attributes, Shared); + Lib_Standalone : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Standalone, + Attributes, Shared); - Lib_ALI_Dir : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_Ali_Dir, Attributes, Shared); + Lib_Version : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Version, Attributes, Shared); - Lib_GCC : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_GCC, Attributes, Shared); + Lib_ALI_Dir : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Ali_Dir, Attributes, Shared); - The_Lib_Kind : constant Prj.Variable_Value := - Prj.Util.Value_Of - (Snames.Name_Library_Kind, Attributes, Shared); - - Imported_Project_List : Project_List; + Lib_GCC : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_GCC, Attributes, Shared); - Continuation : String_Access := No_Continuation_String'Access; + The_Lib_Kind : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Kind, Attributes, Shared); + Imported_Project_List : Project_List; + Continuation : String_Access := No_Continuation_String'Access; Support_For_Libraries : Library_Support; Library_Directory_Present : Boolean; @@ -2869,7 +2890,29 @@ package body Prj.Nmsc is end if; elsif Project.Library_Kind /= Static + and then not Lib_Standalone.Default + and then Get_Name_String (Lib_Standalone.Value) = "full" + and then Proj.Library_Kind /= Static + then + -- A fully standalone library must depend only on static + -- libraries. + + Error_Msg_Name_1 := Project.Name; + Error_Msg_Name_2 := Proj.Name; + + Error_Msg + (Data.Flags, + Continuation.all & + "standalone library project %% cannot import shared " & + "library project %%", + Project.Location, Project); + Continuation := Continuation_String'Access; + + elsif Project.Library_Kind /= Static and then Proj.Library_Kind = Static + and then (Lib_Standalone.Default + or else + Get_Name_String (Lib_Standalone.Value) /= "full") then Error_Msg_Name_1 := Project.Name; Error_Msg_Name_2 := Proj.Name; @@ -4309,6 +4352,12 @@ package body Prj.Nmsc is Project.Decl.Attributes, Shared); + Lib_Standalone : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Library_Standalone, + Project.Decl.Attributes, + Shared); + Lib_Auto_Init : constant Prj.Variable_Value := Prj.Util.Value_Of (Snames.Name_Library_Auto_Init, @@ -4353,8 +4402,17 @@ package body Prj.Nmsc is -- It is a stand-alone library project file if attribute -- Library_Interface is defined. - if not Lib_Interfaces.Default then + if Lib_Interfaces.Default then + if not Lib_Standalone.Default + and then Get_Name_String (Lib_Standalone.Value) /= "no" + then + Error_Msg + (Data.Flags, + "Library_Standalone valid only if Library_Interface is set", + Lib_Standalone.Location, Project); + end if; + else -- The name of a stand-alone library needs to have the syntax of an -- Ada identifier. @@ -4400,7 +4458,34 @@ package body Prj.Nmsc is Unit : Name_Id; begin - Project.Standalone_Library := True; + if Lib_Standalone.Default then + Project.Standalone_Library := Standard; + + else + Get_Name_String (Lib_Standalone.Value); + To_Lower (Name_Buffer (1 .. Name_Len)); + + if Name_Buffer (1 .. Name_Len) = "standard" then + Project.Standalone_Library := Standard; + + elsif Name_Buffer (1 .. Name_Len) = "full" then + Project.Standalone_Library := Full; + + elsif Name_Buffer (1 .. Name_Len) = "no" then + Project.Standalone_Library := No; + Error_Msg + (Data.Flags, + "wrong value for Library_Standalone " + & "when Library_Interface defined", + Lib_Standalone.Location, Project); + + else + Error_Msg + (Data.Flags, + "invalid value for attribute Library_Standalone", + Lib_Standalone.Location, Project); + end if; + end if; -- Library_Interface cannot be an empty list |