From cbcaf392226786aee517d5fe4af3e77fddc23d80 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 9 Jul 2019 19:49:51 +0200 Subject: libghdl: automatically set the prefix from shared library --- src/vhdl/libghdl/libghdl.adb | 5 +++++ src/vhdl/libghdl/libghdl.ads | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src/vhdl/libghdl') 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; -- cgit v1.2.3