summaryrefslogtreecommitdiff
path: root/install-sh
diff options
context:
space:
mode:
Diffstat (limited to 'install-sh')
-rwxr-xr-xinstall-sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/install-sh b/install-sh
index 398a88e14..2c4a67c2d 100755
--- a/install-sh
+++ b/install-sh
@@ -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.