From ee2017d9eeb625ad52aadb82033d5823851c2858 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 23 May 2012 16:54:29 +0000 Subject: [PATCH] use explicit envvar to define where to find the soundgrid library(ies) git-svn-id: svn://localhost/ardour2/branches/3.0-SG@12397 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/soundgrid.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/libs/ardour/soundgrid.cc b/libs/ardour/soundgrid.cc index a1de23d31d..4641035c6a 100644 --- a/libs/ardour/soundgrid.cc +++ b/libs/ardour/soundgrid.cc @@ -17,6 +17,8 @@ */ +#include + #include #include @@ -41,11 +43,26 @@ SoundGrid* SoundGrid::_instance = 0; SoundGrid::SoundGrid () : dl_handle (0) { - cerr << "Loading " << sndgrid_dll_name << endl; - if ((dl_handle = dlopen (sndgrid_dll_name, RTLD_NOW)) == 0) { + const char *s = getenv ("SOUNDGRID_PATH"); + + if (!s) { + cerr << "SOUNDGRID_PATH not defined - exiting\n"; + ::exit (1); + } + + vector p; + p.push_back (s); + p.push_back (sndgrid_dll_name); + + string path = Glib::build_filename (p); + + cerr << "Loading " << path << endl; + + if ((dl_handle = dlopen (path.c_str(), RTLD_NOW)) == 0) { cerr << "...failed\n"; return; } + cerr << "...worked\n"; }