Browse Source

Linux: support both relative and absolute library paths

pull/1639/head
bsp2 6 years ago
parent
commit
7dc68ecfc6
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/vst2_main.cpp

+ 10
- 2
src/vst2_main.cpp View File

@@ -542,11 +542,19 @@ public:
// (+the string is not NULL-terminated from the looks of it) // (+the string is not NULL-terminated from the looks of it)
readlink("/proc/self/exe", dllnameraw, 1024); readlink("/proc/self/exe", dllnameraw, 1024);
#else #else
// (note) 'dli_fname' can be a relative path
Dl_info dlInfo; Dl_info dlInfo;
::dladdr((void*)VSTPluginMain, &dlInfo); ::dladdr((void*)VSTPluginMain, &dlInfo);
// // dllnamerawp = (char*)dlInfo.dli_fname; // // dllnamerawp = (char*)dlInfo.dli_fname;
sprintf(dllnameraw, "%s/%s", oldCWD, dlInfo.dli_fname);
if('/' != dlInfo.dli_fname[0])
{
// (note) 'dli_fname' can be a relative path (e.g. when loaded from vst2_debug_host)
sprintf(dllnameraw, "%s/%s", oldCWD, dlInfo.dli_fname);
}
else
{
// Absolute path (e.g. when loaded from Renoise host)
dllnamerawp = (char*)dlInfo.dli_fname;
}
#endif #endif
#endif #endif




Loading…
Cancel
Save