From 7488e29f9500b694cb6022bec4502ca75f397b1d Mon Sep 17 00:00:00 2001 From: obache Date: Sat, 6 Feb 2010 10:26:09 +0000 Subject: Added fakeldd for Haiku. --- pkgtools/bootstrap-extras/Makefile | 8 ++++-- pkgtools/bootstrap-extras/files/fakeldd-Haiku | 40 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 pkgtools/bootstrap-extras/files/fakeldd-Haiku (limited to 'pkgtools/bootstrap-extras') 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 -- cgit v1.2.3