diff options
-rw-r--r-- | python/libghdl/__init__.py | 1 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb | 10 | ||||
-rw-r--r-- | src/vhdl/libghdl/libghdl.ads | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/python/libghdl/__init__.py b/python/libghdl/__init__.py index 1a8120a97..1258a5643 100644 --- a/python/libghdl/__init__.py +++ b/python/libghdl/__init__.py @@ -77,6 +77,7 @@ libghdl = ctypes.CDLL(_libghdl_path) # Initialize it. libghdl.libghdl_init() +libghdl.libghdl__set_hooks_for_analysis() # Set the prefix in order to locate the vhdl libraries. libghdl.libghdl__set_exec_prefix( diff --git a/src/vhdl/libghdl/libghdl.adb b/src/vhdl/libghdl/libghdl.adb index 51cd0dd02..4ab3dc74a 100644 --- a/src/vhdl/libghdl/libghdl.adb +++ b/src/vhdl/libghdl/libghdl.adb @@ -103,10 +103,12 @@ package body Libghdl is Ghdllocal.Exec_Prefix := new String'(Prefix (1 .. Len)); end Set_Exec_Prefix; + procedure Set_Hooks_For_Analysis is + begin + Ghdllocal.Compile_Init; + Set_Hooks; + end Set_Hooks_For_Analysis; + Gnat_Version : constant String := "unknown compiler version" & ASCII.NUL; pragma Export (C, Gnat_Version, "__gnat_version"); -begin - -- TODO: set program name. - Ghdllocal.Compile_Init; - Set_Hooks; end Libghdl; diff --git a/src/vhdl/libghdl/libghdl.ads b/src/vhdl/libghdl/libghdl.ads index c4edfb9a1..4d1595a10 100644 --- a/src/vhdl/libghdl/libghdl.ads +++ b/src/vhdl/libghdl/libghdl.ads @@ -20,6 +20,9 @@ with Types; use Types; with Vhdl.Nodes; use Vhdl.Nodes; package Libghdl is + -- Perform early initializations, and set hooks. + procedure Set_Hooks_For_Analysis; + -- To be called before Analyze_Init to set command line options. -- This decodes a driver option (so handle all analyzer options, and -- --ieee). Return 0 for success. |