build: fix ordering problems with lib-provided and internal RPATHs
commit3d6e3aceecf8893484f3fba73aef7d55c14d6b4a
authorMichael Adam <obnox@samba.org>
Wed, 16 Oct 2013 13:17:18 +0000 (16 15:17 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 29 Apr 2014 08:28:45 +0000 (29 10:28 +0200)
treeab0ce94ea64000baf4333592323a75ce49b9f753
parent0953816ae9414ea7d32a64af62f2fecb1868a627
build: fix ordering problems with lib-provided and internal RPATHs

When a library or system (like cups) provides an RPATH,
e.g. with -Wl,-R or -Wl,-rpath, this was added by waf
to the LINKFLAGS, wich was later prepended to our RPATH.
But if the path by chance contains an older version of
one of our internal libraries like talloc, this would lead
to linking the too old talloc into our binaries.

This has been observed on, e.g., FreeBSD, but it is a general
problem.

This patch fixes the problem by specially parsing the RPATH
linker options from the pkg-config(, cups-config, ....) output
and putting the paths into the RPATH_<lib> container, which
is then later correctly appended to our internal RPATH.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 64f5e24100a764ec198cab9a8d2c43fa86e7027c)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10548
buildtools/wafadmin/Tools/config_c.py