#!/bin/sh

if [ $# -eq 0 ] ; then
 echo "___________________________________________________________________"
 echo " Herminux library dependency checker. Usage: ldd <binary with path>"
 echo " (If no path given the binary is searched in the current folder.)"
 echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
 exit 0
fi

echo ""
file="$@"
for file do
 case $file in
  */*) : ;;
  *) file=./$file ;;
 esac
 echo "$file:" | sed 's%^./%%'
 LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so "$file"
 echo ""
done

