aboutsummaryrefslogtreecommitdiffstats
path: root/devel.req
blob: ad73240d404a39ed99b12eccf3a8cbcb5847da41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# .so files.
#
filelist=
while read instfile ; do
	filelist="$filelist $instfile"
done

# for objdump:
export LC_ALL=C

for i in `echo $filelist | tr '[:blank:]' "\n" | grep -E "(/usr)?/lib(|64)/[^/]+\.so$"`; do
    objd=`objdump -p ${i} | grep SONAME`
    lib64=`if file -L $i 2>/dev/null | grep "ELF 64-bit" >/dev/null; then echo "(64bit)"; fi` && \
    if [ -h ${i} -a -n "${objd}" ]; then
       objdump -p $i | grep -v "\(ld\|ld64\|ld-linux.*\)\.so" \
                     | awk 'BEGIN { START=0; }
       /^$/ { START=0; }
       /^Dynamic Section:$/ { START=1; }
       (START==1) && /NEEDED/ {
           sub(/^/, "devel(", $2) ;
           sub(/\.so.*$/, "'$lib64')", $2) ;
           print $2 ;
       }
       '
    fi
done | grep -E -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\(64bit\))?\)' | sort -u