# 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
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
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
:
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.$$#
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.