aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv/ghdldrv.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-10-21 16:04:45 +0200
committerTristan Gingold <tgingold@free.fr>2018-10-21 16:11:52 +0200
commite050ffb26e51cb3c064342ecb01822ab7c269712 (patch)
tree799963d9d0b7ad0e20ba65976f6fe69194683865 /src/ghdldrv/ghdldrv.adb
parentd5f16212b1862a9c3cae7768405cb063573f68b9 (diff)
downloadghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.tar.gz
ghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.tar.bz2
ghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.zip
ghdldrv: also search exec in prefix/bin.
Diffstat (limited to 'src/ghdldrv/ghdldrv.adb')
-rw-r--r--src/ghdldrv/ghdldrv.adb20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb
index f629c9ad1..83c54260c 100644
--- a/src/ghdldrv/ghdldrv.adb
+++ b/src/ghdldrv/ghdldrv.adb
@@ -473,7 +473,9 @@ package body Ghdldrv is
return new String'(Toolname);
end if;
else
- -- Try from install prefix
+ -- Try from install prefix. This is used at least with gcc when
+ -- ghdl1 is installed in a libexec subdirectory, and also during
+ -- development.
if Exec_Prefix /= null then
declare
Path : constant String :=
@@ -485,7 +487,21 @@ package body Ghdldrv is
end;
end if;
- -- Try configured prefix
+ -- Try from install prefix / bin. This is used at least for
+ -- ghdl1-llvm.
+ if Exec_Prefix /= null then
+ declare
+ Path : constant String :=
+ Exec_Prefix.all & Directory_Separator
+ & "bin" & Directory_Separator & Toolname;
+ begin
+ if Is_Executable_File (Path) then
+ return new String'(Path);
+ end if;
+ end;
+ end if;
+
+ -- Try configured prefix.
declare
Path : constant String :=
Default_Paths.Install_Prefix & Directory_Separator & Toolname;