diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2022-03-08 03:56:13 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2022-03-11 08:07:52 +0100 |
commit | 87df6ea6f5f49984884b6c5c336aad4e6b8dcdbe (patch) | |
tree | e63ac47d21490a300d597a685c3b34064dfe6b86 /src/ghdldrv | |
parent | 430d1ba5b09e4a2a20dc92156e5a1c69dd30bea0 (diff) | |
download | ghdl-87df6ea6f5f49984884b6c5c336aad4e6b8dcdbe.tar.gz ghdl-87df6ea6f5f49984884b6c5c336aad4e6b8dcdbe.tar.bz2 ghdl-87df6ea6f5f49984884b6c5c336aad4e6b8dcdbe.zip |
mk: Introduce configure options for inc/libdirsuffix
This patch is based on one from the Debian ghdl packaging. We use it to
support coinstallability of the different ghdl backend executables. Force
prepending ghdl/ to the include path really doesn't help us with that any.
Note this effectively reverts 786ca17ce.
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/default_paths.ads.in | 8 | ||||
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 2 | ||||
-rw-r--r-- | src/ghdldrv/ghdllocal.adb | 8 | ||||
-rw-r--r-- | src/ghdldrv/ghdlsynth.adb | 8 | ||||
-rw-r--r-- | src/ghdldrv/ghdlvpi.adb | 7 |
5 files changed, 18 insertions, 15 deletions
diff --git a/src/ghdldrv/default_paths.ads.in b/src/ghdldrv/default_paths.ads.in index ec6b68d94..03addd784 100644 --- a/src/ghdldrv/default_paths.ads.in +++ b/src/ghdldrv/default_paths.ads.in @@ -21,8 +21,12 @@ package Default_Paths is Install_Prefix : constant String := "@INSTALL_PREFIX@"; - Lib_Prefix : constant String := - "@LIB_PREFIX@"; + LibDir_Suffix : constant String := + "@LIBDIR_SUFFIX@"; + LibGhdlDir_Suffix : constant String := + "@LIBGHDLDIR_SUFFIX@"; + IncDir_Suffix : constant String := + "@INCDIR_SUFFIX@"; Compiler_Gcc : constant String := "@COMPILER_GCC@"; diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index aec20e686..e7990ed4d 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -826,7 +826,7 @@ package body Ghdldrv is end case; Put ("linker command (--LINKER=, CC, or cc): "); Put_Line (Cmd.Linker_Cmd.all); - Put_Line ("default lib prefix: " & Default_Paths.Lib_Prefix); + Put_Line ("default lib prefix: " & Default_Paths.LibDir_Suffix); New_Line; diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index c6cebc398..7b6da35db 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -417,13 +417,13 @@ package body Ghdllocal is end if; -- Else try default path. if Lib_Prefix_Path = null then - if Is_Absolute_Path (Default_Paths.Lib_Prefix) then - Lib_Prefix_Path := new String'(Default_Paths.Lib_Prefix); + if Is_Absolute_Path (Default_Paths.LibGhdlDir_Suffix) then + Lib_Prefix_Path := new String'(Default_Paths.LibGhdlDir_Suffix); else if Exec_Prefix /= null then Lib_Prefix_Path := new String'(Exec_Prefix.all & Directory_Separator - & Default_Paths.Lib_Prefix); + & Default_Paths.LibGhdlDir_Suffix); end if; if Lib_Prefix_Path = null or else not Is_Directory (Lib_Prefix_Path.all) @@ -432,7 +432,7 @@ package body Ghdllocal is Lib_Prefix_Path := new String'(Default_Paths.Install_Prefix & Directory_Separator - & Default_Paths.Lib_Prefix); + & Default_Paths.LibGhdlDir_Suffix); end if; end if; else diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index effc04dc7..cafecbb57 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -581,7 +581,8 @@ package body Ghdlsynth is Ghdllocal.Set_Exec_Prefix_From_Program_Name; end if; - return Ghdllocal.Exec_Prefix.all & Directory_Separator & "lib" + return Ghdllocal.Exec_Prefix.all & Directory_Separator + & Default_Paths.LibDir_Suffix & Directory_Separator & Get_Libghdl_Name; end Get_Libghdl_Path; @@ -590,9 +591,8 @@ package body Ghdlsynth is -- Compute install path Ghdllocal.Set_Exec_Prefix_From_Program_Name; - return Ghdllocal.Exec_Prefix.all - & Directory_Separator & "include" - & Directory_Separator & "ghdl"; + return Ghdllocal.Exec_Prefix.all & Directory_Separator + & Default_Paths.IncDir_Suffix; end Get_Libghdl_Include_Dir; procedure Register_Commands is diff --git a/src/ghdldrv/ghdlvpi.adb b/src/ghdldrv/ghdlvpi.adb index 8bf4dae4d..ef79ee305 100644 --- a/src/ghdldrv/ghdlvpi.adb +++ b/src/ghdldrv/ghdlvpi.adb @@ -37,9 +37,8 @@ package body Ghdlvpi is -- Compute install path Ghdllocal.Set_Exec_Prefix_From_Program_Name; - return Ghdllocal.Exec_Prefix.all - & Directory_Separator & "include" - & Directory_Separator & "ghdl"; + return Ghdllocal.Exec_Prefix.all & Directory_Separator + & Default_Paths.IncDir_Suffix; end Get_Vpi_Include_Dir; -- Return the lib directory. @@ -50,7 +49,7 @@ package body Ghdlvpi is Ghdllocal.Set_Exec_Prefix_From_Program_Name; end if; - return Ghdllocal.Exec_Prefix.all & Directory_Separator & "lib"; + return Ghdllocal.Exec_Prefix.all & Directory_Separator & LibDir_Suffix; end Get_Vpi_Lib_Dir; -- Return the lib directory, but unixify the path (for a unix shell in |