summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorobache <obache>2010-02-06 10:26:09 +0000
committerobache <obache>2010-02-06 10:26:09 +0000
commit63edfd05093171a517a34ccbe8bcbea80f41ced5 (patch)
tree871b5ce043468b4d5112e5071b8b65f5217b6704 /pkgtools
parent5e7f27cba6c9a9380177cd4f155e09e2b8442090 (diff)
downloadpkgsrc-63edfd05093171a517a34ccbe8bcbea80f41ced5.tar.gz
Added fakeldd for Haiku.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/bootstrap-extras/Makefile8
-rw-r--r--pkgtools/bootstrap-extras/files/fakeldd-Haiku40
2 files changed, 46 insertions, 2 deletions
diff --git a/pkgtools/bootstrap-extras/Makefile b/pkgtools/bootstrap-extras/Makefile
index 879699b0b70..2be2280da75 100644
--- a/pkgtools/bootstrap-extras/Makefile
+++ b/pkgtools/bootstrap-extras/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2009/04/09 00:48:10 joerg Exp $
+# $NetBSD: Makefile,v 1.10 2010/02/06 10:26:09 obache Exp $
DISTNAME= bootstrap-extra-files-20070702
CATEGORIES= pkgtools
@@ -21,7 +21,7 @@ PLIST_VARS+= ${EXTRA_FILES}
.PHONY: ${EXTRA_FILES:S/^/do-install-/}
-NEED_FAKELDD= IRIX
+NEED_FAKELDD= Haiku IRIX
.if !empty(NEED_FAKELDD:M${OPSYS})
PLIST.fakeldd= yes
do-install: do-install-fakeldd
@@ -53,7 +53,11 @@ do-install:
do-install-fakeldd:
${INSTALL_SCRIPT_DIR} ${DESTDIR}${PREFIX}/sbin
+.if ${OPSYS} == "Haiku"
+ ${INSTALL_SCRIPT} ${WRKSRC}/fakeldd-${OPSYS} ${DESTDIR}${PREFIX}/sbin/fakeldd
+.else
${INSTALL_SCRIPT} ${WRKSRC}/fakeldd ${DESTDIR}${PREFIX}/sbin/fakeldd
+.endif
do-install-mkdir:
${INSTALL_SCRIPT_DIR} ${DESTDIR}${PREFIX}/bin
diff --git a/pkgtools/bootstrap-extras/files/fakeldd-Haiku b/pkgtools/bootstrap-extras/files/fakeldd-Haiku
new file mode 100644
index 00000000000..9e664982365
--- /dev/null
+++ b/pkgtools/bootstrap-extras/files/fakeldd-Haiku
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# $NetBSD: fakeldd-Haiku,v 1.1 2010/02/06 10:26:09 obache Exp $
+#
+
+read_rpath_needed_from_obj ()
+{
+ objdump -p "$1" | awk '
+ /^ *NEEDED */ {num++; libs[num] = $2;}
+ /^ *RPATH */ {rpath = $2;}
+ END {
+ print rpath;
+ for(x = 1; x <= num; x++) {
+ print libs[x];
+ }
+ }'
+}
+
+print_as_ldd ()
+{
+ read rpath
+ rpath="$rpath:$LIBRARY_PATH"
+ while read f; do
+ abpath="not found"
+ IFS=':'
+ for r in $rpath; do
+ if test -e "$r/$f"; then
+ abpath="$r/$f"
+ break;
+ fi
+ done
+ echo " $f => $abpath";
+ done
+}
+
+while test $# -gt 0; do
+ echo $1:
+ read_rpath_needed_from_obj $1 | print_as_ldd
+ shift
+done