66c68a3
#!/bin/bash
66c68a3
66c68a3
# This script reads filenames from STDIN and outputs any relevant provides
66c68a3
# information that needs to be included in the package.
66c68a3
66c68a3
if [ "$1" ]
66c68a3
then
66c68a3
   package_name="$1"
66c68a3
fi
66c68a3
66c68a3
[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump
66c68a3
66c68a3
# Get the list of files.
66c68a3
66c68a3
filelist=`sed "s/['\"]/\\\&/g"`
66c68a3
66c68a3
# Everything requires mingw32-filesystem of at least the current version
66c68a3
# and mingw32-runtime.
66c68a3
echo 'mingw32-filesystem >= @VERSION@'
66c68a3
echo 'mingw32-runtime'
66c68a3
66c68a3
dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$')
66c68a3
66c68a3
for f in $dlls; do
c6360f8
    $OBJDUMP -p $f | grep 'DLL Name' | grep -Eo '[-._\+[:alnum:]]+\.dll' |
66c68a3
        tr [:upper:] [:lower:] |
66c68a3
        sed 's/\(.*\)/mingw32(\1)/'
66c68a3
done | sort -u