summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_install.sh
diff options
context:
space:
mode:
authorBernhard Walle <bernhard@bwalle.de>2012-06-18 21:42:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-06-30 12:48:14 +0200
commit2f240a72868a2c87e72c63001f500185543b00fe (patch)
tree4e45f05217317e676b63098ff1421be97ffae386 /scripts/lib/ptxd_make_world_install.sh
parentd171b876fc472e4edf5030f214102d5389b7b38d (diff)
downloadptxdist-2f240a72868a2c87e72c63001f500185543b00fe.tar.gz
ptxdist-2f240a72868a2c87e72c63001f500185543b00fe.tar.xz
ptxd_make_world_install_post: Darwin: Edit install name of binaries
This patch should solve the problem that binaries in $PTXDIST_SYSROOT_HOST/bin must be able to find their libraries in $PTXDIST_SYSROOT_HOST/lib. On ELF systems that problem is solved by using rpath. However, rpath doesn't exist (works different) on Darwin that uses the Mach-O binary format. After copying the files to $PTXDIST_SYSROOT_HOST, we do following: - For every library (lib/*.*.dylib), we change the install name from /lib/libfoo.x.dylib to $PTXDIST_SYSROOT_HOST/lib/libfoo.x.dylib. That way programs linked against that library can be executed immediately, even in the build directory before installation to $PTXDIST_SYSROOT_HOST. That's the call of "install_name_tool -id". - For every library (lib/*.*.dylib) and executable (bin/*), we change the install name of dependent libraries to point to $PTXDIST_SYSROOT_HOST/lib. The call of "otool -L" lists the dependent libraries (like "readelf -d" on ELF systems) and the call "install_name_tool -change" changes it. That step is necessary because multiple libraries and binaries can be built and installed at the same time, so the binary is already built before "install_name_tool -id" is invoked. That way I'm finally able to build host-qemu with host-glib and host-gettext-dummy (that provides -lintl which host-glib uses). Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_install.sh')
-rw-r--r--scripts/lib/ptxd_make_world_install.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index 3d5d5e55d..dcb6a6125 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -175,5 +175,10 @@ ptxd_make_world_install_post() {
done &&
cp -dprf -- "${pkg_pkg_dir}"/* "${pkg_sysroot_dir}"
+
+ # host and cross packages
+ if [ "${pkg_type}" != "target" ]; then
+ ptxd_make_world_install_library_path
+ fi
}
export -f ptxd_make_world_install_post