diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-14 08:21:18 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-07-14 08:21:18 +0200 |
commit | 8db5c10786bca404c5d1e129090ea9fea25531d2 (patch) | |
tree | 1232a7f9a6e4cd42bccad5f1228a2f20fc16d5e0 /src/grt | |
parent | 8fd9e4a314bec9a3dc4a260b00d2ed7f589d74c0 (diff) | |
download | ghdl-8db5c10786bca404c5d1e129090ea9fea25531d2.tar.gz ghdl-8db5c10786bca404c5d1e129090ea9fea25531d2.tar.bz2 ghdl-8db5c10786bca404c5d1e129090ea9fea25531d2.zip |
Add commands to build vpi modules (WIP)
Diffstat (limited to 'src/grt')
-rw-r--r-- | src/grt/grt-cvpi.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/grt/grt-cvpi.c b/src/grt/grt-cvpi.c index e122e1b4c..2a1a6cd36 100644 --- a/src/grt/grt-cvpi.c +++ b/src/grt/grt-cvpi.c @@ -130,18 +130,19 @@ module_error (void) } #endif +#if defined (__APPLE__) +/* On Darwin: look in rpath. */ +#define LIBNAME "@rpath/libghdlvpi" DSO_EXT +#else +#define LIBNAME "libghdlvpi" DSO_EXT +#endif + +static const char libghdlvpi_name[] = LIBNAME; + int loadVpiModule (const char* modulename) { - static const char libghdlvpi_name[] = "@executable_path/libghdlvpi" DSO_EXT; static void *libghdlvpi_mod; - - static const char * const vpitablenames[] = - { - "_vlog_startup_routines", // with leading underscore: MacOSX - "vlog_startup_routines" // w/o leading underscore: Linux - }; - int i; void *vpimod; @@ -161,6 +162,10 @@ loadVpiModule (const char* modulename) No need to load the library several times. */ if (libghdlvpi_mod == NULL) { + /* TODO: on windows, use SetDllDirectory with: + - install dir (libdir) => add -DLIBDIR=xxx + - exec path\lib => see windows_default_path + */ libghdlvpi_mod = module_open (libghdlvpi_name); if (libghdlvpi_mod != NULL) { |