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" ] || {
LDSO=""
echo "Bundling ${BIN##*/}"
- for token in $("$LDD" "$BIN" 2>/dev/null); do
- case "$token" in */*.so*)
- case "$token" in
- *ld-*.so*) LDSO="${token##*/}" ;;
- *) echo " * lib: ${token##*/}" ;;
- esac
-
- dest="$DIR/bundled/lib/${token##*/}"
- ddir="${dest%/*}"
-
- [ -f "$token" -a ! -f "$dest" ] && {
- _md "$ddir"
- _cp "$token" "$dest"
- }
- ;; esac
- done
+ [ -n "$LDD" ] && {
+ for token in $("$LDD" "$BIN" 2>/dev/null); do
+ case "$token" in */*.so*)
+ case "$token" in
+ *ld-*.so*) LDSO="${token##*/}" ;;
+ *) echo " * lib: ${token##*/}" ;;
+ esac
+
+ dest="$DIR/bundled/lib/${token##*/}"
+ ddir="${dest%/*}"
+
+ [ -f "$token" -a ! -f "$dest" ] && {
+ _md "$ddir"
+ _cp "$token" "$dest"
+ }
+ ;; esac
+ done
+ }
_md "$DIR"
# 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