Commit 8045c479 by Vincent Celier Committed by Arnaud Charlet

2008-08-01 Vincent Celier <celier@adacore.com>

	* mlib-utl.adb:
	(Adalib_Path): New variable to store the path of the adalib directory
	when procedure Specify_Adalib_Dir is called.
	(Lib_Directory): If Adalib_Path is not null, return its value
	(Specify_Adalib_Dir): New procedure
	
	* mlib-utl.ads (Specify_Adalib_Dir): New procedure

From-SVN: r138488
parent 434a2807
...@@ -35,6 +35,10 @@ with System; ...@@ -35,6 +35,10 @@ with System;
package body MLib.Utl is package body MLib.Utl is
Adalib_Path : String_Access := null;
-- Path of the GNAT adalib directory, specified in procedure
-- Specify_Adalib_Dir. Used in function Lib_Directory.
Gcc_Name : String_Access; Gcc_Name : String_Access;
-- Default value of the "gcc" executable used in procedure Gcc -- Default value of the "gcc" executable used in procedure Gcc
...@@ -597,6 +601,13 @@ package body MLib.Utl is ...@@ -597,6 +601,13 @@ package body MLib.Utl is
Libgnat : constant String := Tgt.Libgnat; Libgnat : constant String := Tgt.Libgnat;
begin begin
-- If procedure Specify_Adalib_Dir has been called, used the specified
-- value.
if Adalib_Path /= null then
return Adalib_Path.all;
end if;
Name_Len := Libgnat'Length; Name_Len := Libgnat'Length;
Name_Buffer (1 .. Name_Len) := Libgnat; Name_Buffer (1 .. Name_Len) := Libgnat;
Get_Name_String (Osint.Find_File (Name_Enter, Osint.Library)); Get_Name_String (Osint.Find_File (Name_Enter, Osint.Library));
...@@ -606,4 +617,17 @@ package body MLib.Utl is ...@@ -606,4 +617,17 @@ package body MLib.Utl is
return Name_Buffer (1 .. Name_Len - Libgnat'Length); return Name_Buffer (1 .. Name_Len - Libgnat'Length);
end Lib_Directory; end Lib_Directory;
------------------------
-- Specify_Adalib_Dir --
------------------------
procedure Specify_Adalib_Dir (Path : String) is
begin
if Path'Length = 0 then
Adalib_Path := null;
else
Adalib_Path := new String'(Path);
end if;
end Specify_Adalib_Dir;
end MLib.Utl; end MLib.Utl;
...@@ -58,4 +58,10 @@ package MLib.Utl is ...@@ -58,4 +58,10 @@ package MLib.Utl is
function Lib_Directory return String; function Lib_Directory return String;
-- Return the directory containing libgnat -- Return the directory containing libgnat
procedure Specify_Adalib_Dir (Path : String);
-- Specify the path of the GNAT adalib directory, to be returned by
-- function Lib_Directory without looking for it. This is used only in
-- gprlib, because we cannot rely on the search in Lib_Directory, as the
-- GNAT version may be different for gprbuild/gprlib and the compiler.
end MLib.Utl; end MLib.Utl;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment