===================================================================
@@ -64,6 +64,14 @@
-- Stores the runtime names for the various languages. This is in general
-- set from a --RTS command line option.
+ procedure Locate_Runtime
+ (Language : Name_Id;
+ Env : Prj.Tree.Environment);
+ -- If RTS_Name is a base name (a name without path separator), then
+ -- do nothing. Otherwise, convert it to an absolute path (possibly by
+ -- searching it in the project path) and call Set_Runtime_For with the
+ -- absolute path. Raise Invalid_Config if the path does not exist.
+
-----------------------
-- Local_Subprograms --
-----------------------
@@ -721,7 +729,7 @@
Set_Runtime_For
(Name_Ada,
Name_Buffer (7 .. Name_Len));
- Locate_Runtime (Name_Ada, Project_Tree, Env);
+ Locate_Runtime (Name_Ada, Env);
end if;
elsif Name_Len > 7
@@ -748,7 +756,7 @@
if not Runtime_Name_Set_For (Lang) then
Set_Runtime_For (Lang, RTS);
- Locate_Runtime (Lang, Project_Tree, Env);
+ Locate_Runtime (Lang, Env);
end if;
end;
end if;
@@ -1518,7 +1526,6 @@
procedure Locate_Runtime
(Language : Name_Id;
- Project_Tree : Prj.Project_Tree_Ref;
Env : Prj.Tree.Environment)
is
function Is_Base_Name (Path : String) return Boolean;
@@ -1555,7 +1562,7 @@
Find_Rts_In_Path (Env.Project_Path, RTS_Name);
if Full_Path = null then
- Fail_Program (Project_Tree, "cannot find RTS " & RTS_Name);
+ Raise_Invalid_Config ("cannot find RTS " & RTS_Name);
end if;
Set_Runtime_For (Language, Normalize_Pathname (Full_Path.all));
===================================================================
@@ -216,13 +216,4 @@
function Runtime_Name_Set_For (Language : Name_Id) return Boolean;
-- Returns True only if Set_Runtime_For has been called for the Language
- procedure Locate_Runtime
- (Language : Name_Id;
- Project_Tree : Prj.Project_Tree_Ref;
- Env : Prj.Tree.Environment);
- -- If RTS_Name is a base name (a name without path separator), then
- -- do nothing. Otherwise, convert it to an absolute path (possibly by
- -- searching it in the project path) and call Set_Runtime_For with the
- -- absolute path. Fail the program if the path does not exist.
-
end Prj.Conf;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2001-2014, 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- --
@@ -103,8 +103,8 @@
Success := The_Project /= No_Project;
exception
- when Invalid_Config =>
- Success := False;
+ when E : Invalid_Config =>
+ Osint.Fail (Exception_Message (E));
end;
Prj.Err.Finalize;