mesa: Remove gl_light_attrib::_Flags.
[mesa.git] / bin / minstall
index 819b2bc7e4acfa58a93755ca40414ce356c25aa5..094ec0c2b2af7f675db1f23e8efdffaf0e23de37 100755 (executable)
@@ -31,7 +31,7 @@ if [ $# -ge 2 ] ; then
 
        # 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,27 @@ if [ $# -ge 2 ] ; then
                        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
                if [ -h "$FILE" ] ; then
                        #echo $FILE is a symlink
@@ -57,7 +78,6 @@ if [ $# -ge 2 ] ; then
 
                        FILE=`basename "$FILE"`
                        # Go to $DEST and make the link
-                       PWDSAVE="$PWD"
                        cd "$DEST"        # pushd
                                $RM "$FILE"
                                $SYMLINK "$TARGET" "$FILE"
@@ -65,8 +85,11 @@ if [ $# -ge 2 ] ; then
 
                elif [ -f "$FILE" ] ; then
                        #echo "$FILE" is a regular file
-                       $RM "$DEST/`basename $FILE`"
-                       cp "$FILE" "$DEST"
+                       # Only copy if the files differ
+                       if ! cmp -s $FILE $DEST/`basename $FILE`; then
+                               $RM "$DEST/`basename $FILE`"
+                               cp "$FILE" "$DEST"
+                       fi
                        if [ $MODE ] ; then
                                FILE=`basename "$FILE"`
                                chmod $MODE "$DEST/$FILE"