4 excludes="/dev /proc /sys /run"
9 excludes="${excludes} ${1#*=}"
20 local cmd="${STRIP-strip}"
23 for exclude in ${excludes}; do
25 if [ "${file:0:${l}}" = "${exclude}" ]; then
30 case "$(file -bi ${file})" in
31 application/x-sharedlib*|application/x-archive*)
32 cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note"
35 cmd="${cmd} --strip-unneeded"
39 echo "Stripping ${file}..."
43 for dir in ${dirs}; do
44 # Strip shared objects.
45 find ${dir} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
46 | file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
51 # Strip static archives.
52 find ${dir} -name \*.a -a -exec file {} \; \
53 | grep 'current ar archive' | sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p' |