summaryrefslogtreecommitdiff
path: root/translate/ghdldrv/ghdllocal.adb
diff options
context:
space:
mode:
authorgingold2006-10-02 04:18:48 +0000
committergingold2006-10-02 04:18:48 +0000
commit17450f134e39ffa345eab48dd9aec6127a893946 (patch)
tree485583076df7918266cc00550cea159e6a9e65a2 /translate/ghdldrv/ghdllocal.adb
parent34c8fdb9e08041c7bd3ee344cbd73a9a46ecc4bd (diff)
downloadghdl-17450f134e39ffa345eab48dd9aec6127a893946.tar.gz
ghdl-17450f134e39ffa345eab48dd9aec6127a893946.tar.bz2
ghdl-17450f134e39ffa345eab48dd9aec6127a893946.zip
support of GHDL_PREFIX env variable, use ghdl_release instead of ghdl_version
Diffstat (limited to 'translate/ghdldrv/ghdllocal.adb')
-rw-r--r--translate/ghdldrv/ghdllocal.adb17
1 files changed, 15 insertions, 2 deletions
diff --git a/translate/ghdldrv/ghdllocal.adb b/translate/ghdldrv/ghdllocal.adb
index 9eccdcf..fb8f5f6 100644
--- a/translate/ghdldrv/ghdllocal.adb
+++ b/translate/ghdldrv/ghdllocal.adb
@@ -177,7 +177,7 @@ package body Ghdllocal is
function Get_Machine_Path_Prefix return String is
begin
if Flag_32bit then
- return Prefix_Path.all & "32" & Directory_Separator;
+ return Prefix_Path.all & "32";
else
return Prefix_Path.all;
end if;
@@ -187,13 +187,26 @@ package body Ghdllocal is
is
begin
Libraries.Add_Library_Path
- (Get_Machine_Path_Prefix & Get_Version_Path & Directory_Separator
+ (Get_Machine_Path_Prefix & Directory_Separator
+ & Get_Version_Path & Directory_Separator
& Name & Directory_Separator);
end Add_Library_Path;
procedure Setup_Libraries (Load : Boolean)
is
begin
+ -- Get environment variable.
+ Prefix_Env := GNAT.OS_Lib.Getenv ("GHDL_PREFIX");
+ if Prefix_Env = null or else Prefix_Env.all = "" then
+ Prefix_Env := null;
+ end if;
+
+ -- Set prefix path.
+ -- If not set by command line, try environment variable.
+ if Prefix_Path = null then
+ Prefix_Path := Prefix_Env;
+ end if;
+ -- Else try default path.
if Prefix_Path = null then
Prefix_Path := new String'(Default_Pathes.Prefix);
else