summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-13 10:45:14 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-13 10:45:14 +0000
commitd15bad045d8514e6c767e0bdc1cd2b2956274dbd (patch)
treef36850a6b47b83f1fbdba5bbb834d88e131763f5 /gcc/ada/prj-util.adb
parent15a0a16549b258f53a99b57968c64192448df6cc (diff)
downloadgcc-d15bad045d8514e6c767e0bdc1cd2b2956274dbd.tar.gz
2009-07-13 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, prj-proc.adb, make.adb, mlib-prj.adb, prj-ext.adb, gnat_ugn.texi, prj.adb, prj.ads, clean.adb, prj-nmsc.adb, prj-util.adb, prj-conf.adb, gnatname.adb, prj-env.adb, prj-env.ads, prj-tree.adb, prj-tree.ads (Prj.Tree.Create*): New subprograms to create new packages and attributes in a project tree. (Add_Default_GNAT_Naming_Scheme): Provide real implementation. Remove last remaining mode-specific code (ada_only or multi_language). This was duplicating code (Get_Mode, Set_Mode): removed, no longer used. (Initialize_Project_Path): all tools will now take into account both GPR_PROJECT_PATH and ADA_PROJECT_PATH (in that order). Remove some global variables and subprograms no longer used Make temporary files tree-specific, to avoid interferences between trees loaded in memory at the same time. (Prj.Delete_Temporary_File): new subprogram (Object_Paths, Source_Paths): fields no longer stored in the project tree, since they are only needed locally in Set_Ada_Paths. (Set_Mapping_File_Initial_State_To_Empty): removed, since had no effect in practice. (Project_Tree_Data.Ada_Path_Buffer): removed, since it can be replaced by local variables in the appropriate subprograms (Has_Foreign_Sources): removed. * gcc-interface/Makefile.in: prj-pp.o is now needed to build gnatmake git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-util.adb')
-rw-r--r--gcc/ada/prj-util.adb68
1 files changed, 18 insertions, 50 deletions
diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb
index 5e36fcd71e6..897e7f01dbe 100644
--- a/gcc/ada/prj-util.adb
+++ b/gcc/ada/prj-util.adb
@@ -130,8 +130,6 @@ package body Prj.Util is
In_Package => Builder_Package,
In_Tree => In_Tree);
- Executable_Suffix : Variable_Value := Nil_Variable_Value;
-
Executable_Suffix_Name : Name_Id := No_Name;
Lang : Language_Ptr;
@@ -183,22 +181,7 @@ package body Prj.Util is
end if;
if Builder_Package /= No_Package then
- if Get_Mode = Multi_Language then
- Executable_Suffix_Name := Project.Config.Executable_Suffix;
-
- else
- Executable_Suffix := Prj.Util.Value_Of
- (Variable_Name => Name_Executable_Suffix,
- In_Variables => In_Tree.Packages.Table
- (Builder_Package).Decl.Attributes,
- In_Tree => In_Tree);
-
- if Executable_Suffix /= Nil_Variable_Value
- and then not Executable_Suffix.Default
- then
- Executable_Suffix_Name := Executable_Suffix.Value;
- end if;
- end if;
+ Executable_Suffix_Name := Project.Config.Executable_Suffix;
if Executable = Nil_Variable_Value and Ada_Main then
Get_Name_String (Main);
@@ -251,7 +234,8 @@ package body Prj.Util is
-- possibly suffixed by the executable suffix.
if Executable /= Nil_Variable_Value
- and then Executable.Value /= Empty_Name
+ and then Executable.Value /= No_Name
+ and then Length_Of_Name (Executable.Value) /= 0
then
-- Get the executable name. If Executable_Suffix is defined,
-- make sure that it will be the extension of the executable.
@@ -303,40 +287,24 @@ package body Prj.Util is
Get_Name_String (Strip_Suffix (Main));
end if;
- if Executable_Suffix /= Nil_Variable_Value
- and then not Executable_Suffix.Default
- then
- -- If attribute Executable_Suffix is specified, add this suffix
+ -- Get the executable name. If Executable_Suffix is defined in the
+ -- configuration, make sure that it will be the extension of the
+ -- executable.
- declare
- Suffix : constant String :=
- Get_Name_String (Executable_Suffix.Value);
- begin
- Name_Buffer (Name_Len + 1 .. Name_Len + Suffix'Length) := Suffix;
- Name_Len := Name_Len + Suffix'Length;
- return Name_Find;
- end;
+ declare
+ Saved_EEOT : constant Name_Id := Executable_Extension_On_Target;
+ Result : File_Name_Type;
- else
- -- Get the executable name. If Executable_Suffix is defined in the
- -- configuration, make sure that it will be the extension of the
- -- executable.
-
- declare
- Saved_EEOT : constant Name_Id := Executable_Extension_On_Target;
- Result : File_Name_Type;
-
- begin
- if Project.Config.Executable_Suffix /= No_Name then
- Executable_Extension_On_Target :=
- Project.Config.Executable_Suffix;
- end if;
+ begin
+ if Project.Config.Executable_Suffix /= No_Name then
+ Executable_Extension_On_Target :=
+ Project.Config.Executable_Suffix;
+ end if;
- Result := Executable_Name (Name_Find);
- Executable_Extension_On_Target := Saved_EEOT;
- return Result;
- end;
- end if;
+ Result := Executable_Name (Name_Find);
+ Executable_Extension_On_Target := Saved_EEOT;
+ return Result;
+ end;
end Executable_Of;
--------------