mingw-filesystem/mingw32-find-requires.sh

28 lines
660 B
Bash
Raw Normal View History

2008-10-30 09:49:17 +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
[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump
# Get the list of files.
filelist=`sed "s/['\"]/\\\&/g"`
# Everything requires mingw32-filesystem and mingw32-runtime.
echo 'mingw32-filesystem'
2008-10-30 09:49:17 +00:00
echo 'mingw32-runtime'
dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$')
for f in $dlls; do
$OBJDUMP -p $f | grep 'DLL Name' | grep -Eo '[-._\+[:alnum:]]+\.dll' |
2008-10-30 09:49:17 +00:00
tr [:upper:] [:lower:] |
sed 's/\(.*\)/mingw32(\1)/'
done | sort -u