ppc44x: fix build of crypto4xx_core.c
[openwrt/openwrt.git] / scripts / bundle-libraries.sh
index 869286bdba303b9f3905c43cef372e9afe68fecb..aba1cd6268e35adafee312a8855935371ee27342 100755 (executable)
@@ -2,7 +2,7 @@
 #
 #   Script to install host system binaries along with required libraries.
 #
-#   Copyright (C) 2012-2013 Jo-Philipp Wich <jow@openwrt.org>
+#   Copyright (C) 2012-2013 Jo-Philipp Wich <jo@mein.io>
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -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