aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2010-07-07 11:17:47 -0700
committerTom Rini <tom_rini@mentor.com>2010-07-07 11:17:47 -0700
commitb4cbc6a2e6dffd367b7362f352699cb5a442cbc5 (patch)
treec1cb489ddbb7b8045c970151c7c55cc956fc4add
parent71a16be679041bb042c02f0f59c56141d963562c (diff)
downloadopenembedded-b4cbc6a2e6dffd367b7362f352699cb5a442cbc5.tar.gz
relocatible.bbclass: Switch to using oe.path.relative
Rather than calculate the relative path ourself use a helper function we've got. This also results in shorter rpaths being used. Signed-off-by: Tom Rini <tom_rini@mentor.com>
-rw-r--r--classes/relocatable.bbclass14
1 files changed, 5 insertions, 9 deletions
diff --git a/classes/relocatable.bbclass b/classes/relocatable.bbclass
index e4ababa57d..cc220276fb 100644
--- a/classes/relocatable.bbclass
+++ b/classes/relocatable.bbclass
@@ -55,21 +55,17 @@ def process_dir (directory, d):
# If the rpath shares a root with base_prefix determine a new dynamic rpath from the
# base_prefix shared root
if rpath.find(basedir) != -1:
- depth = fpath.partition(basedir)[2].count('/')
- libpath = rpath.partition(basedir)[2].strip()
+ fdir = os.path.dirname(fpath.partition(basedir)[2])
+ ldir = rpath.partition(basedir)[2].strip()
# otherwise (i.e. cross packages) determine a shared root based on the TMPDIR
# NOTE: This will not work reliably for cross packages, particularly in the case
# where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an
# rpath longer than that which is already set.
else:
- depth = fpath.rpartition(tmpdir)[2].count('/')
- libpath = rpath.partition(tmpdir)[2].strip()
+ fdir = os.path.dirname(fpath.rpartition(tmpdir)[2])
+ ldir = rpath.partition(tmpdir)[2].strip()
- base = "$ORIGIN"
- while depth > 1:
- base += "/.."
- depth-=1
- new_rpaths.append("%s%s" % (base, libpath))
+ new_rpaths.append("$ORIGIN/%s" % oe.path.relative(fdir, ldir))
# if we have modified some rpaths call chrpath to update the binary
if len(new_rpaths):