From e050ffb26e51cb3c064342ecb01822ab7c269712 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 21 Oct 2018 16:04:45 +0200 Subject: ghdldrv: also search exec in prefix/bin. --- src/ghdldrv/ghdldrv.adb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/ghdldrv') 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; -- cgit v1.2.3