summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-01 21:06:21 +0100
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-01 21:12:32 +0100
commit14f041a971bb450e6eece99efd528afc50421da9 (patch)
treee16f036213c590e884f5d122518e1aff2ee2f83c /xmrstak/backend
parentbc18ee3fd7191d6ba4bc0e5c0d82fb90cc2ded12 (diff)
downloadxmr-stak-14f041a971bb450e6eece99efd528afc50421da9.zip
xmr-stak-14f041a971bb450e6eece99efd528afc50421da9.tar.gz
search for linux backend plugins
- search for plugin in - working directory - binary directory - let linux search the plugins (libraries)
Diffstat (limited to 'xmrstak/backend')
-rw-r--r--xmrstak/backend/plugin.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmrstak/backend/plugin.hpp b/xmrstak/backend/plugin.hpp
index 7ba9e6f..b08ab89 100644
--- a/xmrstak/backend/plugin.hpp
+++ b/xmrstak/backend/plugin.hpp
@@ -43,7 +43,14 @@ struct plugin
// `.dylib` Mac OS X file extention for dynamic libraries
fileExtension = ".dylib";
# endif
- libBackend = dlopen((params::inst().executablePrefix + "/lib" + libName + fileExtension).c_str(), RTLD_LAZY);
+ // search library in working directory
+ libBackend = dlopen(("./lib" + libName + fileExtension).c_str(), RTLD_LAZY);
+ // fallback to binary directory
+ if(!libBackend)
+ libBackend = dlopen((params::inst().executablePrefix + "lib" + libName + fileExtension).c_str(), RTLD_LAZY);
+ // try use LD_LIBRARY_PATH
+ if(!libBackend)
+ libBackend = dlopen(("lib" + libName + fileExtension).c_str(), RTLD_LAZY);
if(!libBackend)
{
std::cerr << "WARNING: "<< m_backendName <<" cannot load backend library: " << dlerror() << std::endl;
OpenPOWER on IntegriCloud