aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/libghdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-09 19:49:51 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-09 19:49:51 +0200
commitcbcaf392226786aee517d5fe4af3e77fddc23d80 (patch)
tree06e7143d6e9f4fd85e466231dae7322fce2e5fb9 /src/vhdl/libghdl
parentc42f7a633bd81d5485c728ba49c3d17ac54feb63 (diff)
downloadghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.tar.gz
ghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.tar.bz2
ghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.zip
libghdl: automatically set the prefix from shared library
Diffstat (limited to 'src/vhdl/libghdl')
-rw-r--r--src/vhdl/libghdl/libghdl.adb5
-rw-r--r--src/vhdl/libghdl/libghdl.ads3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/vhdl/libghdl/libghdl.adb b/src/vhdl/libghdl/libghdl.adb
index b0442b9f4..51cd0dd02 100644
--- a/src/vhdl/libghdl/libghdl.adb
+++ b/src/vhdl/libghdl/libghdl.adb
@@ -98,6 +98,11 @@ package body Libghdl is
return Ghdlcomp.Compile_Analyze_File2 (File (1 .. Len));
end Analyze_File;
+ procedure Set_Exec_Prefix (Prefix : Thin_String_Ptr; Len : Natural) is
+ begin
+ Ghdllocal.Exec_Prefix := new String'(Prefix (1 .. Len));
+ end Set_Exec_Prefix;
+
Gnat_Version : constant String := "unknown compiler version" & ASCII.NUL;
pragma Export (C, Gnat_Version, "__gnat_version");
begin
diff --git a/src/vhdl/libghdl/libghdl.ads b/src/vhdl/libghdl/libghdl.ads
index dbc6b260e..c4edfb9a1 100644
--- a/src/vhdl/libghdl/libghdl.ads
+++ b/src/vhdl/libghdl/libghdl.ads
@@ -25,6 +25,9 @@ package Libghdl is
-- --ieee). Return 0 for success.
function Set_Option (Opt : Thin_String_Ptr; Len : Natural) return Integer;
+ -- Set the prefix (used to locate libraries).
+ procedure Set_Exec_Prefix (Prefix : Thin_String_Ptr; Len : Natural);
+
-- To be called before Analyze_File to initialize analysis.
procedure Analyze_Init;