summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2013-04-20 09:50:38 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2013-04-20 10:04:32 +0530
commit3d7bc637c4c4b556df5ecd08915300ecfd93bde8 (patch)
tree2e417878a15f12e7181408cdc0920296332fee05
parent4cd7e6df1d4d3070878f6541fd9aee413ab6edcd (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.c2
-rw-r--r--src/pulsecore/cli-command.c12
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)