diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-09 19:49:51 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-09 19:49:51 +0200 |
commit | cbcaf392226786aee517d5fe4af3e77fddc23d80 (patch) | |
tree | 06e7143d6e9f4fd85e466231dae7322fce2e5fb9 /src | |
parent | c42f7a633bd81d5485c728ba49c3d17ac54feb63 (diff) | |
download | ghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.tar.gz ghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.tar.bz2 ghdl-cbcaf392226786aee517d5fe4af3e77fddc23d80.zip |
libghdl: automatically set the prefix from shared library
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdllocal.ads | 2 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb | 5 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.ads | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdllocal.ads b/src/ghdldrv/ghdllocal.ads index a5c6fb7ef..c59cf25a1 100644 --- a/src/ghdldrv/ghdllocal.ads +++ b/src/ghdldrv/ghdllocal.ads @@ -48,7 +48,7 @@ package Ghdllocal is -- getenv ("GHDL_PREFIX"). Set by Setup_Libraries. Prefix_Env : String_Access := null; - -- Installation prefix (deduced from executable path). + -- Installation prefix (deduced from executable path and without bin/). Exec_Prefix : String_Access; -- Path prefix for libraries. 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; |