diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-06-08 11:46:54 -0500 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-07-17 19:19:46 -0700 |
commit | 3f86e50be01dd797a7eb1988abe5c5c9951e7688 (patch) | |
tree | e0a1e2772a31d2e885f33d9e2eb147e15e63cafd /src/compositor.c | |
parent | d8156e22f6277cf6875c48f566076b61cdb01806 (diff) | |
download | weston-3f86e50be01dd797a7eb1988abe5c5c9951e7688.tar.gz |
compositor: Respect WESTON_BUILD_DIR env var in weston_load_module
We were loading modules out of the system dirs unconditionally, so
tests that loaded modules would use the system ones, or fail if
they weren't installed.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'src/compositor.c')
-rw-r--r-- | src/compositor.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compositor.c b/src/compositor.c index ec2be7d1..66c3eeee 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -4680,16 +4680,21 @@ weston_version(int *major, int *minor, int *micro) WL_EXPORT void * weston_load_module(const char *name, const char *entrypoint) { + const char *builddir = getenv("WESTON_BUILD_DIR"); char path[PATH_MAX]; void *module, *init; if (name == NULL) return NULL; - if (name[0] != '/') - snprintf(path, sizeof path, "%s/%s", MODULEDIR, name); - else + if (name[0] != '/') { + if (builddir) + snprintf(path, sizeof path, "%s/.libs/%s", builddir, name); + else + snprintf(path, sizeof path, "%s/%s", MODULEDIR, name); + } else { snprintf(path, sizeof path, "%s", name); + } module = dlopen(path, RTLD_NOW | RTLD_NOLOAD); if (module) { |