diff options
author | David Robillard <d@drobilla.net> | 2011-01-10 08:05:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-10 08:05:01 +0000 |
commit | ee76b8535cdd63311e77611832c744a2f9d1c3d3 (patch) | |
tree | 42b361809e0db62baba3f036da72e017d62d2943 /src/shared | |
parent | d6a3c886895f1de314569c39a00005c2c2272c13 (diff) | |
download | ingen-ee76b8535cdd63311e77611832c744a2f9d1c3d3.tar.gz ingen-ee76b8535cdd63311e77611832c744a2f9d1c3d3.tar.bz2 ingen-ee76b8535cdd63311e77611832c744a2f9d1c3d3.zip |
Fix module loading on OSX (this revision of Ingen confirmed working on Mac OS X 10.6.6 w/ MacPorts).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2820 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/runtime_paths.cpp | 11 | ||||
-rw-r--r-- | src/shared/runtime_paths.hpp | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/shared/runtime_paths.cpp b/src/shared/runtime_paths.cpp index 476bd2ba..f4ddd897 100644 --- a/src/shared/runtime_paths.cpp +++ b/src/shared/runtime_paths.cpp @@ -85,14 +85,19 @@ data_file_path(const std::string& name) /** Return the absolute path of a module (dynamically loaded shared library). */ std::string -module_path(const std::string& name) +module_path(const std::string& name, std::string dir) { std::string ret; + if (dir == "") { #ifdef BUNDLE - ret = Glib::Module::build_path(Glib::build_path(bundle_path, INGEN_MODULE_DIR), name); + dir = Glib::build_path(bundle_path, INGEN_MODULE_DIR); #else - ret = Glib::Module::build_path(INGEN_MODULE_DIR, name); + dir = INGEN_MODULE_DIR; #endif + } + + ret = Glib::Module::build_path(dir, name); + #ifdef __APPLE__ // MacPorts glib doesnt seem to do portable path building correctly... if (ret.substr(ret.length() - 3) == ".so") diff --git a/src/shared/runtime_paths.hpp b/src/shared/runtime_paths.hpp index c0c890c1..fcb29a7f 100644 --- a/src/shared/runtime_paths.hpp +++ b/src/shared/runtime_paths.hpp @@ -32,7 +32,7 @@ void set_bundle_path_from_code(void* function); std::string bundle_file_path(const std::string& name); std::string data_file_path(const std::string& name); -std::string module_path(const std::string& name); +std::string module_path(const std::string& name, std::string dir=""); } // namespace Ingen } // namespace Shared |