66c68a
#!/bin/bash
66c68a
66c68a
# This script reads filenames from STDIN and outputs any relevant provides
66c68a
# information that needs to be included in the package.
66c68a
0c1e1f
targets=$@
0c1e1f
if [ -z "$targets" ] ; then
0c1e1f
    echo "Usage: $0 [ mingw32 ] [ mingw64 ]"
0c1e1f
    exit 1
66c68a
fi
66c68a
66c68a
filelist=`sed "s/['\"]/\\\&/g"`
66c68a
66c68a
dlls=$(echo $filelist | tr [:blank:] '\n' | grep '\.dll$')
66c68a
66c68a
for f in $dlls; do
66c68a
    basename=`basename $f | tr [:upper:] [:lower:]`
0c1e1f
    for target in $targets; do
0c1e1f
        host_triplet=`rpm --eval "%{${target}_target}"`
0c1e1f
        [[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)"
0c1e1f
    done
66c68a
done
0c1e1f
0c1e1f
exit 0