summaryrefslogtreecommitdiffstats
path: root/cygwin-find-provides.sh
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2013-06-30 01:42:08 -0500
committerYaakov Selkowitz <yselkowitz@users.sourceforge.net>2013-06-30 01:42:08 -0500
commit6831de9cdb95c4dad414ccaf0a0c4ccf8d84c945 (patch)
treedda33c1f6f6e8a5ce2c9f9b55ad3ac7487c817fb /cygwin-find-provides.sh
parent7b587b2ad18ddf26a6f71447ed3198a8ec143bab (diff)
downloadcygwin-filesystem-6831de9cdb95c4dad414ccaf0a0c4ccf8d84c945.tar.gz
cygwin-filesystem-6831de9cdb95c4dad414ccaf0a0c4ccf8d84c945.tar.xz
cygwin-filesystem-6831de9cdb95c4dad414ccaf0a0c4ccf8d84c945.zip
Support both cygwin32 and cygwin64
Diffstat (limited to 'cygwin-find-provides.sh')
-rwxr-xr-xcygwin-find-provides.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/cygwin-find-provides.sh b/cygwin-find-provides.sh
index 81fccf4..c92fe6c 100755
--- a/cygwin-find-provides.sh
+++ b/cygwin-find-provides.sh
@@ -3,18 +3,24 @@
# 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"
+targets=$@
+if [ -z "$targets" ] ; then
+ echo "Usage: $0 [ cygwin32 ] [ cygwin64 ]"
+ exit 1
fi
-[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-cygwin-objdump
-
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr [:blank:] '\n' | grep '\.dll$')
for f in $dlls; do
basename=`basename $f | tr [:upper:] [:lower:]`
- echo "cygwin($basename)"
+ for target in $targets; do
+ host_triplet=`rpm --eval "%{${target}_target}"`
+ [[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)"
+ # for backwards compatibility
+ [[ $f =~ .*i686-pc-cygwin.* ]] && echo "cygwin($basename)"
+ done
done
+
+exit 0