diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-06-02 13:27:23 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-06-02 13:27:23 +0000 |
commit | ab9efa1b909da40569f55555ae4282f1eb16282e (patch) | |
tree | 70155432a781b509a6cd2b12e2fe43c98300d5c6 | |
parent | 2915a6b90dbd7a11de7897386dc055b809216587 (diff) | |
download | master-187ad058-ab9efa1b909da40569f55555ae4282f1eb16282e.tar.gz master-187ad058-ab9efa1b909da40569f55555ae4282f1eb16282e.tar.bz2 master-187ad058-ab9efa1b909da40569f55555ae4282f1eb16282e.zip |
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
-rwxr-xr-x | scripts/bundle-libraries.sh | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh index 869286bdba..508fe787f2 100755 --- a/scripts/bundle-libraries.sh +++ b/scripts/bundle-libraries.sh @@ -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,22 +63,24 @@ for BIN in "$@"; do 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" @@ -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 |