mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
build-sys: introduce a special build flag to explicitly disables running from build tree
It is helpful to improve reproducibility build [1] since PA_SRCDIR/PA_BUILDDIR contains build path, --disable-running-from-build-tree could drop these macros at precompilation. [1] https://reproducible-builds.org/ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
This commit is contained in:
parent
bae8c16bfa
commit
3d9deb1e56
7 changed files with 29 additions and 5 deletions
|
|
@ -3269,15 +3269,17 @@ void pa_reset_personality(void) {
|
|||
}
|
||||
|
||||
bool pa_run_from_build_tree(void) {
|
||||
char *rp;
|
||||
static bool b = false;
|
||||
|
||||
#ifdef HAVE_RUNNING_FROM_BUILD_TREE
|
||||
char *rp;
|
||||
PA_ONCE_BEGIN {
|
||||
if ((rp = pa_readlink("/proc/self/exe"))) {
|
||||
b = pa_startswith(rp, PA_BUILDDIR);
|
||||
pa_xfree(rp);
|
||||
}
|
||||
} PA_ONCE_END;
|
||||
#endif
|
||||
|
||||
return b;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue