aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--translate/ghdldrv/ghdlcomp.adb22
-rw-r--r--translate/ghdldrv/ghdldrv.adb20
-rw-r--r--translate/ghdldrv/ghdllocal.adb17
-rw-r--r--translate/ghdldrv/ghdllocal.ads3
-rw-r--r--translate/ghdldrv/ghdlmain.adb2
-rw-r--r--translate/ghdldrv/ghdlprint.adb2
6 files changed, 58 insertions, 8 deletions
diff --git a/translate/ghdldrv/ghdlcomp.adb b/translate/ghdldrv/ghdlcomp.adb
index eb8990856..a3895f9a0 100644
--- a/translate/ghdldrv/ghdlcomp.adb
+++ b/translate/ghdldrv/ghdlcomp.adb
@@ -33,6 +33,7 @@ with Libraries;
with Std_Package;
with Files_Map;
with Version;
+with Default_Pathes;
package body Ghdlcomp is
@@ -465,9 +466,24 @@ package body Ghdlcomp is
raise Errorout.Option_Error;
end if;
+ Put ("command line prefix (--PREFIX): ");
+ if Prefix_Path = null then
+ Put_Line ("(not set)");
+ else
+ Put_Line (Prefix_Path.all);
+ end if;
Setup_Libraries (False);
- Put ("library directory: ");
- Put_Line (Prefix_Path.all);
+
+ Put ("environment prefix (GHDL_PREFIX): ");
+ if Prefix_Env = null then
+ Put_Line ("(not set)");
+ else
+ Put_Line (Prefix_Env.all);
+ end if;
+
+ Put_Line ("default prefix: " & Default_Pathes.Prefix);
+ Put_Line ("actual prefix: " & Prefix_Path.all);
+ Put_Line ("command_name: " & Ada.Command_Line.Command_Name);
Put_Line ("default library pathes:");
for I in 2 .. Get_Nbr_Pathes loop
Put (' ');
@@ -596,7 +612,7 @@ package body Ghdlcomp is
Put_Line ("# Makefile automatically generated by ghdl");
Put ("# Version: ");
- Put (Version.Ghdl_Version);
+ Put (Version.Ghdl_Release);
Put (" - ");
if Version_String /= null then
Put (Version_String.all);
diff --git a/translate/ghdldrv/ghdldrv.adb b/translate/ghdldrv/ghdldrv.adb
index 14e61299a..52b7e5aa3 100644
--- a/translate/ghdldrv/ghdldrv.adb
+++ b/translate/ghdldrv/ghdldrv.adb
@@ -741,7 +741,25 @@ package body Ghdldrv is
end if;
Put ("linker command: ");
Put_Line (Linker_Cmd);
+
+ Put ("command line prefix (--PREFIX): ");
+ if Prefix_Path = null then
+ Put_Line ("(not set)");
+ else
+ Put_Line (Prefix_Path.all);
+ end if;
Setup_Libraries (False);
+
+ Put ("environment prefix (GHDL_PREFIX): ");
+ if Prefix_Env = null then
+ Put_Line ("(not set)");
+ else
+ Put_Line (Prefix_Env.all);
+ end if;
+
+ Put_Line ("default prefix: " & Default_Pathes.Prefix);
+ Put_Line ("actual prefix: " & Prefix_Path.all);
+
Put ("library directory: ");
Put_Line (Get_Machine_Path_Prefix);
Locate_Tools;
@@ -1572,7 +1590,7 @@ package body Ghdldrv is
Put_Line ("# Makefile automatically generated by ghdl");
Put ("# Version: ");
- Put (Version.Ghdl_Version);
+ Put (Version.Ghdl_Release);
Put (" - ");
if Version_String /= null then
Put (Version_String.all);
diff --git a/translate/ghdldrv/ghdllocal.adb b/translate/ghdldrv/ghdllocal.adb
index 9eccdcf5d..fb8f5f6d0 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
diff --git a/translate/ghdldrv/ghdllocal.ads b/translate/ghdldrv/ghdllocal.ads
index 817cc8fd5..f55503a5d 100644
--- a/translate/ghdldrv/ghdllocal.ads
+++ b/translate/ghdldrv/ghdllocal.ads
@@ -53,6 +53,9 @@ package Ghdllocal is
-- Path prefix for libraries.
Prefix_Path : String_Access := null;
+ -- getenv ("GHDL_PREFIX"). Set by Setup_Libraries.
+ Prefix_Env : String_Access := null;
+
Nul : constant Character := Character'Val (0);
-- Return FILENAME without the extension.
diff --git a/translate/ghdldrv/ghdlmain.adb b/translate/ghdldrv/ghdlmain.adb
index 88752795c..0c2f39ae0 100644
--- a/translate/ghdldrv/ghdlmain.adb
+++ b/translate/ghdldrv/ghdlmain.adb
@@ -216,7 +216,7 @@ package body Ghdlmain is
pragma Unreferenced (Cmd);
use Ada.Text_IO;
begin
- Put_Line (Version.Ghdl_Version);
+ Put_Line (Version.Ghdl_Release);
Put_Line (" Compiled with " & Bug.Get_Gnat_Version);
if Version_String /= null then
Put (" ");
diff --git a/translate/ghdldrv/ghdlprint.adb b/translate/ghdldrv/ghdlprint.adb
index d9de2df86..45750efeb 100644
--- a/translate/ghdldrv/ghdlprint.adb
+++ b/translate/ghdldrv/ghdlprint.adb
@@ -475,7 +475,7 @@ package body Ghdlprint is
Put_Line ("<p>");
Put ("<small>This page was generated using ");
Put ("<a href=""http://ghdl.free.fr"">");
- Put (Version.Ghdl_Version);
+ Put (Version.Ghdl_Release);
Put ("</a>, a program written by");
Put (" Tristan Gingold");
New_Line;