3 # note this works for both a.out and ELF executables
4 # it also auto-generates requirment lines for shell scripts
8 filelist=`sed "s/['\"]/\\\&/g"`
9 exelist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*executable" | cut -d: -f1; fi`
10 scriptlist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1; fi`
11 liblist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*shared object" | cut -d : -f1; fi`
13 LDDLIST=`for f in $exelist; do
15 ldd $f | awk '/=>/ { print $1 }'
17 done | sort -u | sed "s/['\"]/\\\&/g"`
18 if test "x$LDDLIST" != x; then
19 echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u
22 LDDLIST=`for f in $liblist; do
23 ldd $f | awk '/=>/ { print $1 }'
24 done | sort -u | sed "s/['\"]/\\\&/g"`
25 if test "x$LDDLIST" != x; then
26 echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u
29 for f in $scriptlist; do
31 head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
35 for f in $liblist $exelist ; do
37 BEGIN { START=0; LIBNAME=""; }
38 /Version References:/ { START=1; }
39 /required from/ && (START==1) {
43 (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; }