diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-04-20 09:50:38 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-04-23 09:32:52 +0530 |
commit | bb7f83567b60c17e4744a1c7eb6a4e83d924b00f (patch) | |
tree | bb9ce04c7d4d23e4b1bd400a074704a2f0bb1624 | |
parent | 274c93e7f5f00d54c14871beb0ddd41a3dc8104d (diff) |
daemon: Fix dlsearchpath while running from build tree
It appears that, libltdl will find the .la file in the builddir and
figure out where the real .so is.
This also requires .ifexists to be fixed up to correspondingly search in
<dlsearchpath>/.libs.
-rw-r--r-- | src/daemon/daemon-conf.c | 2 | ||||
-rw-r--r-- | src/pulsecore/cli-command.c | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 2c43cf9c..f1e5476a 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -156,7 +156,7 @@ pa_daemon_conf *pa_daemon_conf_new(void) { #else if (pa_run_from_build_tree()) { pa_log_notice("Detected that we are run from the build tree, fixing search path."); - c->dl_search_path = pa_xstrdup(PA_BUILDDIR "/.libs/"); + c->dl_search_path = pa_xstrdup(PA_BUILDDIR); } else c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH); #endif diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c index 1ec80541..f5489d6e 100644 --- a/src/pulsecore/cli-command.c +++ b/src/pulsecore/cli-command.c @@ -2062,11 +2062,21 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b char *pathname; pathname = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", p, filename); - pa_xfree(p); *ifstate = access(pathname, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE; pa_log_debug("Checking for existence of '%s': %s", pathname, *ifstate == IFSTATE_TRUE ? "success" : "failure"); + if (PA_UNLIKELY(pa_run_from_build_tree())) { + /* If run from the build tree, search in <path>/.libs as well */ + char *ltpathname = pa_sprintf_malloc("%s" PA_PATH_SEP ".libs" PA_PATH_SEP "%s", p, filename); + + *ifstate = access(ltpathname, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE; + pa_log_debug("Checking for existence of '%s': %s", ltpathname, *ifstate == IFSTATE_TRUE ? "success" : "failure"); + + pa_xfree(ltpathname); + } + + pa_xfree(p); pa_xfree(pathname); if (*ifstate == IFSTATE_TRUE) |