scripts/bundle-libraries: fall back to only copying binaries if ldd is unavailable (e.g. non-linux system)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40967 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2014-06-02 13:27:23 +00:00
parent 2915a6b90d
commit ab9efa1b90
1 changed files with 18 additions and 19 deletions

View File

@ -46,10 +46,7 @@ for LDD in ${PATH//://ldd }/ldd; do
LDD=""
done
[ -n "$LDD" -a -x "$LDD" ] || {
echo "Unable to find working ldd" >&2
exit 4
}
[ -n "$LDD" -a -x "$LDD" ] || LDD=
for BIN in "$@"; do
[ -n "$BIN" -a -x "$BIN" -a -n "$DIR" ] || {
@ -66,6 +63,7 @@ for BIN in "$@"; do
LDSO=""
echo "Bundling ${BIN##*/}"
[ -n "$LDD" ] && {
for token in $("$LDD" "$BIN" 2>/dev/null); do
case "$token" in */*.so*)
case "$token" in
@ -82,6 +80,7 @@ for BIN in "$@"; do
}
;; esac
done
}
_md "$DIR"
@ -105,7 +104,7 @@ for BIN in "$@"; do
# is a static executable or non-elf binary
else
echo " * not dynamically linked"
[ -n "$LDD" ] && echo " * not dynamically linked"
_cp "$BIN" "$DIR/${BIN##*/}"
fi
done