summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-04-06 10:11:41 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-04-23 13:52:30 +0200
commit8c2eeee753597e919dffc5254dad54e9ec6f8947 (patch)
tree48e1c40bbf034278d2d6c64ff58ba8c476940d2c
parent5cc9b8b3cd7b57ddc9de0280e703e3041a5874c8 (diff)
downloadptxdist-8c2eeee753597e919dffc5254dad54e9ec6f8947.tar.gz
ptxdist-8c2eeee753597e919dffc5254dad54e9ec6f8947.tar.xz
[install] use chrpath in ptxd_make_world_install_unpack to fix the rpath of host-tools
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/post/virtual.make4
-rw-r--r--rules/pre/Rules.make5
-rw-r--r--rules/project-name.in1
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk2
-rw-r--r--scripts/lib/ptxd_make_world_install.sh8
5 files changed, 19 insertions, 1 deletions
diff --git a/rules/post/virtual.make b/rules/post/virtual.make
index f17ee7502..4eec2ecfd 100644
--- a/rules/post/virtual.make
+++ b/rules/post/virtual.make
@@ -37,6 +37,10 @@ ifdef PTXCONF_HOST_PKG_CONFIG
$(STATEDIR)/virtual-host-tools.install: $(STATEDIR)/host-pkg-config.install.post
endif
+ifdef PTXCONF_HOST_CHRPATH
+$(STATEDIR)/virtual-host-tools.install: $(STATEDIR)/host-chrpath.install.post
+endif
+
$(STATEDIR)/virtual-host-tools.install:
@$(call targetinfo)
@$(call touch)
diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 26ea757f8..a8c79db8f 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -288,7 +288,10 @@ CROSS_QMAKE_OPT := -recursive
HOST_PATH := $$PATH
HOST_CPPFLAGS := -I$(PTXDIST_SYSROOT_HOST)/include
-HOST_LDFLAGS := -L$(PTXDIST_SYSROOT_HOST)/lib -Wl,-rpath -Wl,$(PTXDIST_SYSROOT_HOST)/lib
+HOST_LDFLAGS := \
+ -L$(PTXDIST_SYSROOT_HOST)/lib \
+ -Wl,-rpath -Wl,$(PTXDIST_SYSROOT_HOST)/lib \
+ -Wl,-rpath -Wl,/this/is/a/long/path/to/make/host/tools/relocateable/with/chrpath/when/using/dev/packages
HOST_ENV_CC := CC="$(HOSTCC)"
HOST_ENV_CXX := CXX="$(HOSTCXX)"
diff --git a/rules/project-name.in b/rules/project-name.in
index d124af8d6..b509cc2a8 100644
--- a/rules/project-name.in
+++ b/rules/project-name.in
@@ -149,6 +149,7 @@ config PROJECT_CREATE_DEVPKGS
config PROJECT_USE_DEVPKGS
bool
+ select HOST_CHRPATH
prompt "use dev packages"
config PROJECT_DEVPKGDIR
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 581fe3822..ca6670d4a 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -326,6 +326,8 @@ END {
#
if (this_pkg ~ /^host-pkg-config$/)
continue;
+ if (this_pkg ~ /^host-chrpath$/)
+ continue;
if (this_pkg ~ /^host-|^cross-/)
virtual = "virtual-host-tools";
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index 21fd58125..236edca7b 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -139,6 +139,14 @@ ptxd_make_world_install_post() {
if [ \! -d "${pkg_pkg_dir}" ]; then
return
fi &&
+ # fix rpaths in host/cross tools
+ if [ "${pkg_type}" != "target" ]; then
+ find "${pkg_pkg_dir}" ! -type d -executable -print | while read file; do
+ if chrpath "${file}" > /dev/null 2>&1; then
+ chrpath --replace "${PTXDIST_SYSROOT_HOST}/lib" "${file}" || return
+ fi
+ done
+ fi &&
# prefix paths in la files with sysroot
find "${pkg_pkg_dir}" \( -name "*.la" -o -name "*.prl" \) -print0 | xargs -r -0 -- \
sed -i -e "s:@SYSROOT@:${pkg_sysroot_dir}:g" &&