Cygwin: Teach mklib/minstall to properly install libraries on cygwin

Teach mklib/minstall more about cygwin so libraries are properly installed

Have mklib install the .dll into the lib/ staging directory as well

Have minstall install the .dll into PREFIX/bin at the same time as
installing the .dll.a link library into PREFIX/lib

mklib uses a '-' rather than a '.' as the separator before the version
number in library names on cygwin.  Change the install globs so they match
library names like that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
diff --git a/bin/minstall b/bin/minstall
index 1300258..094ec0c 100755
--- a/bin/minstall
+++ b/bin/minstall
@@ -31,7 +31,7 @@
 
 	# Last cmd line arg is the dest dir
 	for FILE in $@ ; do
-		DEST="$FILE"
+		DESTDIR="$FILE"
 	done
 
 	# Loop over args, moving them to DEST directory
@@ -42,6 +42,25 @@
 			exit 0
 		fi
 
+                DEST=$DESTDIR
+
+                # On CYGWIN, because DLLs are loaded by the native Win32 loader,
+                # they are installed in the executable path.  Stub libraries used
+                # only for linking are installed in the library path
+                case `uname` in
+                    CYGWIN*)
+                        case $FILE in
+                            *.dll)
+                                DEST="$DEST/../bin"
+                                ;;
+                            *)
+                                ;;
+                        esac
+	                ;;
+                    *)
+                        ;;
+                esac
+
 		PWDSAVE=`pwd`
 
 		# determine file's type