summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-util.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/pulsecore/core-util.c
parenta562978509674f37f3cc7d5d5d1002f52a59654d (diff)
adjust various data/library paths automatically if we are run from a build tree
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r--src/pulsecore/core-util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index ef8c8472..843c8377 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2862,3 +2862,22 @@ void pa_reset_personality(void) {
#endif
}
+
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+
+pa_bool_t pa_run_from_build_tree(void) {
+ char *rp;
+ pa_bool_t b = FALSE;
+
+ /* We abuse __OPTIMIZE__ as a check whether we are a debug build
+ * or not. */
+
+ if ((rp = pa_readlink("/proc/self/exe"))) {
+ b = pa_startswith(rp, PA_BUILDDIR);
+ pa_xfree(rp);
+ }
+
+ return b;
+}
+
+#endif