everything needs to be /lib64/
[qemu-test.git] / util / get-libs.sh
1 #!/bin/sh
2
3 filter() {
4 sed -e 's:^/lib/:/lib64/:g'
5 }
6
7 ldd $1 | sed -e 's:.*=> \(.*\):\1:g' | cut -f1 -d'(' | filter
8
9 # FIXME need a more generic way of doing this
10 # glibc actually dlopens these libraries so there's no easy way to figure out
11 # from the binary that they are needed... quite annoying
12 if ls /lib64/x86_64-linux-gnu/libnss_dns* 2>/dev/null >/dev/null; then
13 ls /lib64/x86_64-linux-gnu/libnss_dns*
14 ls /lib64/x86_64-linux-gnu/libnss_files*
15 ls /lib64/x86_64-linux-gnu/libresolv*
16 else
17 ls /lib/x86_64-linux-gnu/libnss_dns* | filter
18 ls /lib/x86_64-linux-gnu/libnss_files* | filter
19 ls /lib/x86_64-linux-gnu/libresolv* | filter
20 fi