* Makefile.in (distclean): Remove .gdbinit.
[binutils-gdb.git] / install.sh
index 1c8a1bd3e5a9ac851ce5c2f7ce8a824aeda4a664..4b883b386de25e43c56bc4db7bb65a4008f8633d 100755 (executable)
@@ -1,11 +1,19 @@
 #!/bin/sh
-set -e
-
 #
 # install - install a program, script, or datafile
-# This comes from X11R5; it is not part of GNU.
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
 #
-# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
 #
 # This script is compatible with the BSD install script, but was written
 # from scratch.
@@ -29,7 +37,7 @@ stripprog="${STRIPPROG-strip}"
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
-tranformbasename=""
+transformbasename=""
 transform_arg=""
 instcmd="$mvprog"
 chmodcmd="$chmodprog 0755"
@@ -106,6 +114,7 @@ if [ x"$dir_arg" != x ]; then
        
        if [ -d $dst ]; then
                instcmd=:
+               chmodcmd=""
        else
                instcmd=mkdir
        fi
@@ -148,6 +157,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
 # Make sure that the destination directory exists.
 #  this part is taken from Noah Friedman's mkinstalldirs script
 
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
 defaultIFS='   
 '
 IFS="${IFS-${defaultIFS}}"
@@ -173,6 +184,7 @@ while [ $# -ne 0 ] ; do
 
        pathcomp="${pathcomp}/"
 done
+fi
 
 if [ x"$dir_arg" != x ]
 then