7515d356185936d850ca3e60d4a5bea3cb5c286c
[ld42_outofspace] / dlldepends
1 #!/bin/dash
2
3 depends() {
4         dlls=$(strings $1 | grep '\.dll' | grep -v '\(USER32\|KERNEL32\|msvcrt\)')
5
6         gccver=$(i686-w64-mingw32-gcc -dumpversion | awk -F . '{ print $1 "." $2 }')
7
8         libpaths="/usr/i686-w64-mingw32/lib \
9         /usr/i686-w64-mingw32/bin \
10         /usr/lib/gcc/i686-w64-mingw32/$gccver-win32"
11
12         for i in $dlls; do
13                 for path in $libpaths; do
14                         dllfile=$path/$i
15                         if [ -f $dllfile ]; then
16                                 echo $dllfile
17                                 if [ ! "$2" = noreq ]; then
18                                         depends $dllfile noreq
19                                 fi
20                         fi
21                 done
22         done
23 }
24
25 depends game.exe | sort | uniq