summaryrefslogtreecommitdiffstats
path: root/src/daemon/daemon-conf.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-21 03:43:53 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-21 03:43:53 +0200
commit8a2a6b2004cd299467de1955f7f99e25033faa63 (patch)
tree9584082499596140ce4d40c75eaabaa0db493340 /src/daemon/daemon-conf.c
parenta562978509674f37f3cc7d5d5d1002f52a59654d (diff)
adjust various data/library paths automatically if we are run from a build tree
Diffstat (limited to 'src/daemon/daemon-conf.c')
-rw-r--r--src/daemon/daemon-conf.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 9a87b555..ec1ec5ce 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -133,9 +133,25 @@ static const pa_daemon_conf default_conf = {
};
pa_daemon_conf* pa_daemon_conf_new(void) {
- pa_daemon_conf *c = pa_xnewdup(pa_daemon_conf, &default_conf, 1);
+ pa_daemon_conf *c;
+
+ c = pa_xnewdup(pa_daemon_conf, &default_conf, 1);
+
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+
+ /* We abuse __OPTIMIZE__ as a check whether we are a debug build
+ * or not. If we are and are run from the build tree then we
+ * override the search path to point to our build tree */
+
+ 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/");
+
+ } else
+
+#endif
+ c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
- c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
return c;
}