]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - install-sh
Merge CUPS 1.4svn-r7762.
[thirdparty/cups.git] / install-sh
index 398a88e1421823561abbf2d48ca8f263babc04d9..2c4a67c2d5ddd59cc0aeb91871bea81b4873ebb8 100755 (executable)
@@ -3,6 +3,7 @@
 # install - install a program, script, or datafile
 # This comes from X11R5 (mit/util/scripts/install.sh).
 #
+# Library stripping changes Copyright 2008 by Apple Inc.
 # Copyright 1991 by the Massachusetts Institute of Technology
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
@@ -181,7 +182,9 @@ while [ $# -ne 0 ] ; do
 
        if [ ! -d "${pathcomp}" ] ;
         then
-               $mkdirprog "${pathcomp}"
+               $mkdirprog "${pathcomp}" &&
+               if [ x"$chowncmd" != x ]; then $doit $chowncmd "$pathcomp"; else : ; fi &&
+               if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$pathcomp"; else : ; fi
        else
                :
        fi
@@ -196,7 +199,6 @@ then
 
        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
 else
 
@@ -219,6 +221,16 @@ else
                :
        fi
 
+# Check the destination file - for libraries just use the "-x" option to strip
+       case "$dstfile" in
+               *.a | *.dylib | *.sl | *.sl.* | *.so | *.so.*)
+                       stripopt="-x"
+                       ;;
+               *)
+                       stripopt=""
+                       ;;
+       esac
+
 # Make a temp file name in the proper directory.
 
        dsttmp=$dstdir/#inst.$$#
@@ -237,7 +249,7 @@ else
 
        if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
        if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $stripopt $dsttmp; else :;fi &&
        if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
 
 # Now rename the file to the real destination.