2009-04-08 13:11:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script reads filenames from STDIN and outputs any relevant provides
|
|
|
|
# information that needs to be included in the package.
|
|
|
|
|
|
|
|
if [ "$1" ]
|
|
|
|
then
|
|
|
|
package_name="$1"
|
|
|
|
fi
|
|
|
|
|
2011-03-15 11:44:43 +00:00
|
|
|
[ -z "$OBJDUMP" ] && OBJDUMP=x86_64-w64-mingw32-objdump
|
2009-04-08 13:11:27 +00:00
|
|
|
|
|
|
|
# Get the list of files.
|
|
|
|
|
|
|
|
filelist=`sed "s/['\"]/\\\&/g"`
|
|
|
|
|
2009-12-16 10:46:30 +00:00
|
|
|
dlls_to_exclude="
|
|
|
|
advapi32.dll
|
2010-05-07 15:28:46 +00:00
|
|
|
cfgmgr32.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
comctl32.dll
|
|
|
|
comdlg32.dll
|
2011-03-09 05:18:55 +00:00
|
|
|
crypt32.dll
|
2011-03-02 07:28:24 +00:00
|
|
|
ddraw.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
dnsapi.dll
|
2011-03-02 07:28:24 +00:00
|
|
|
dsound.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
gdi32.dll
|
2010-09-12 00:15:12 +00:00
|
|
|
gdiplus.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
glu32.dll
|
|
|
|
glut32.dll
|
|
|
|
imm32.dll
|
2011-03-29 05:24:52 +00:00
|
|
|
iphlpapi.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
kernel32.dll
|
|
|
|
mscms.dll
|
|
|
|
mscoree.dll
|
|
|
|
msimg32.dll
|
2010-05-07 15:28:46 +00:00
|
|
|
msvcr71.dll
|
|
|
|
msvcr80.dll
|
|
|
|
msvcr90.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
msvcrt.dll
|
|
|
|
mswsock.dll
|
|
|
|
ole32.dll
|
|
|
|
oleaut32.dll
|
|
|
|
opengl32.dll
|
2010-07-04 20:08:39 +00:00
|
|
|
psapi.dll
|
2010-05-07 15:28:46 +00:00
|
|
|
rpcrt4.dll
|
|
|
|
secur32.dll
|
|
|
|
setupapi.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
shell32.dll
|
|
|
|
shlwapi.dll
|
|
|
|
user32.dll
|
2010-10-21 22:06:38 +00:00
|
|
|
usp10.dll
|
2009-12-18 09:37:53 +00:00
|
|
|
version.dll
|
2011-03-09 05:18:55 +00:00
|
|
|
wininet.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
winmm.dll
|
|
|
|
wldap32.dll
|
|
|
|
ws2_32.dll
|
2010-05-07 15:28:46 +00:00
|
|
|
wsock32.dll
|
2009-12-16 10:46:30 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
exclude_pattern=""
|
|
|
|
for i in $dlls_to_exclude; do
|
|
|
|
if test "$exclude_pattern" == ""; then
|
|
|
|
exclude_pattern=$i;
|
|
|
|
else
|
|
|
|
exclude_pattern=$exclude_pattern"|"$i;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2009-04-08 13:11:27 +00:00
|
|
|
|
|
|
|
dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$')
|
2011-04-13 08:48:20 +00:00
|
|
|
pcs=$(echo $filelist | tr [:blank:] '\n' | grep '\.pc$')
|
2009-04-08 13:11:27 +00:00
|
|
|
|
|
|
|
for f in $dlls; do
|
2009-11-13 20:32:09 +00:00
|
|
|
$OBJDUMP -p $f | grep 'DLL Name' | tr [:upper:] [:lower:] |
|
|
|
|
grep -Eo '[-._\+[:alnum:]]+\.dll' |
|
2009-12-16 10:46:30 +00:00
|
|
|
grep -Ev "$exclude_pattern" |
|
|
|
|
sed 's/\(.*\)/mingw64(\1)/'
|
2009-04-08 13:11:27 +00:00
|
|
|
done | sort -u
|
2011-04-13 08:48:20 +00:00
|
|
|
|
|
|
|
for g in $pcs; do
|
|
|
|
dirname=`dirname $g`
|
|
|
|
PKG_CONFIG_PATH=$dirname x86_64-w64-mingw32-pkg-config --print-errors --print-requires $g | awk '{ print "mingw64(pkg:"$1")", $2, $3 }'
|
|
|
|
done | sort -u
|