diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-10-21 16:04:45 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-10-21 16:11:52 +0200 |
commit | e050ffb26e51cb3c064342ecb01822ab7c269712 (patch) | |
tree | 799963d9d0b7ad0e20ba65976f6fe69194683865 | |
parent | d5f16212b1862a9c3cae7768405cb063573f68b9 (diff) | |
download | ghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.tar.gz ghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.tar.bz2 ghdl-e050ffb26e51cb3c064342ecb01822ab7c269712.zip |
ghdldrv: also search exec in prefix/bin.
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 20 |
2 files changed, 19 insertions, 3 deletions
@@ -351,7 +351,7 @@ echo "Generate default_paths.ads" sed -e "s%@COMPILER_GCC@%ghdl1-gcc$EXEEXT%" \ -e "s%@COMPILER_DEBUG@%ghdl1-debug$EXEEXT%" \ -e "s%@COMPILER_MCODE@%ghdl1-mcode$EXEEXT%" \ - -e "s%@COMPILER_LLVM@%bin/ghdl1-llvm$EXEEXT%" \ + -e "s%@COMPILER_LLVM@%ghdl1-llvm$EXEEXT%" \ -e "s%@POST_PROCESSOR@%oread-$backend%" \ -e "s%@INSTALL_PREFIX@%$prefix%" \ -e "s%@LIB_PREFIX@%$libdirsuffix%" \ 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; |