pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/bootstrap-extras Added fakeldd for Haiku.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ae791275b500
branches:  trunk
changeset: 570978:ae791275b500
user:      obache <obache%pkgsrc.org@localhost>
date:      Sat Feb 06 10:26:09 2010 +0000

description:
Added fakeldd for Haiku.

diffstat:

 pkgtools/bootstrap-extras/Makefile            |   8 ++++-
 pkgtools/bootstrap-extras/files/fakeldd-Haiku |  40 +++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 2 deletions(-)

diffs (74 lines):

diff -r a5fe230c86e5 -r ae791275b500 pkgtools/bootstrap-extras/Makefile
--- a/pkgtools/bootstrap-extras/Makefile        Sat Feb 06 05:54:17 2010 +0000
+++ b/pkgtools/bootstrap-extras/Makefile        Sat Feb 06 10:26:09 2010 +0000
@@ -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 @@
 
 .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-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 -r a5fe230c86e5 -r ae791275b500 pkgtools/bootstrap-extras/files/fakeldd-Haiku
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/bootstrap-extras/files/fakeldd-Haiku     Sat Feb 06 10:26:09 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index