aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure2
-rw-r--r--src/ghdldrv/ghdldrv.adb20
2 files changed, 19 insertions, 3 deletions
diff --git a/configure b/configure
index 14df9f842..8dc0afcab 100755
--- a/configure
+++ b/configure
@@ -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;