summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-util.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/prj-util.adb')
-rw-r--r--gcc/ada/prj-util.adb36
1 files changed, 15 insertions, 21 deletions
diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb
index 15f893a7ac8..4081e117508 100644
--- a/gcc/ada/prj-util.adb
+++ b/gcc/ada/prj-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2004 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- --
@@ -74,7 +74,9 @@ package body Prj.Util is
-------------------
function Executable_Of
- (Project : Project_Id; Main : Name_Id) return Name_Id
+ (Project : Project_Id;
+ Main : Name_Id;
+ Ada_Main : Boolean := True) return Name_Id
is
pragma Assert (Project /= No_Project);
@@ -111,7 +113,7 @@ package body Prj.Util is
begin
if Builder_Package /= No_Package then
- if Executable = Nil_Variable_Value then
+ if Executable = Nil_Variable_Value and Ada_Main then
Get_Name_String (Main);
-- Try as index the name minus the implementation suffix or minus
@@ -212,7 +214,7 @@ package body Prj.Util is
-- otherwise remove any suffix ('.' followed by other characters), if
-- there is one.
- if Name_Len > Body_Append'Length
+ if Ada_Main and then Name_Len > Body_Append'Length
and then Name_Buffer (Name_Len - Body_Append'Length + 1 .. Name_Len) =
Body_Append
then
@@ -220,7 +222,7 @@ package body Prj.Util is
Name_Len := Name_Len - Body_Append'Length;
- elsif Name_Len > Spec_Append'Length
+ elsif Ada_Main and then Name_Len > Spec_Append'Length
and then Name_Buffer (Name_Len - Spec_Append'Length + 1 .. Name_Len) =
Spec_Append
then
@@ -379,8 +381,7 @@ package body Prj.Util is
function Value_Of
(Variable : Variable_Value;
- Default : String)
- return String
+ Default : String) return String
is
begin
if Variable.Kind /= Single
@@ -395,8 +396,7 @@ package body Prj.Util is
function Value_Of
(Index : Name_Id;
- In_Array : Array_Element_Id)
- return Name_Id
+ In_Array : Array_Element_Id) return Name_Id
is
Current : Array_Element_Id := In_Array;
Element : Array_Element;
@@ -432,8 +432,7 @@ package body Prj.Util is
function Value_Of
(Index : Name_Id;
- In_Array : Array_Element_Id)
- return Variable_Value
+ In_Array : Array_Element_Id) return Variable_Value
is
Current : Array_Element_Id := In_Array;
Element : Array_Element;
@@ -468,8 +467,7 @@ package body Prj.Util is
function Value_Of
(Name : Name_Id;
Attribute_Or_Array_Name : Name_Id;
- In_Package : Package_Id)
- return Variable_Value
+ In_Package : Package_Id) return Variable_Value
is
The_Array : Array_Element_Id;
The_Attribute : Variable_Value := Nil_Variable_Value;
@@ -504,8 +502,7 @@ package body Prj.Util is
function Value_Of
(Index : Name_Id;
In_Array : Name_Id;
- In_Arrays : Array_Id)
- return Name_Id
+ In_Arrays : Array_Id) return Name_Id
is
Current : Array_Id := In_Arrays;
The_Array : Array_Data;
@@ -525,8 +522,7 @@ package body Prj.Util is
function Value_Of
(Name : Name_Id;
- In_Arrays : Array_Id)
- return Array_Element_Id
+ In_Arrays : Array_Id) return Array_Element_Id
is
Current : Array_Id := In_Arrays;
The_Array : Array_Data;
@@ -547,8 +543,7 @@ package body Prj.Util is
function Value_Of
(Name : Name_Id;
- In_Packages : Package_Id)
- return Package_Id
+ In_Packages : Package_Id) return Package_Id
is
Current : Package_Id := In_Packages;
The_Package : Package_Element;
@@ -566,8 +561,7 @@ package body Prj.Util is
function Value_Of
(Variable_Name : Name_Id;
- In_Variables : Variable_Id)
- return Variable_Value
+ In_Variables : Variable_Id) return Variable_Value
is
Current : Variable_Id := In_Variables;
The_Variable : Variable;