summaryrefslogtreecommitdiff
path: root/arch/iphoneos-arm/strip
blob: 5eb9433119affd8b305bece4a1b3fddea423b221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
find "${PKG_DEST}" -type f \( -perm -0100 -o -name '*.dylib' -o -name '*.so' \) -print0 | while read -r -d $'\0' bin; do
    case "$(file "${bin}")" in (\
        *': Mach-O fat file with '*([0-9])' architecture' |\
        *': '?(setuid )?(setgid )'Mach-O executable acorn' |\
        *': Mach-O dynamically linked shared library acorn' |\
        *': Mach-O bundle acorn'\
    );; (*) continue;; esac

    if arm-apple-darwin9-otool -hv "${bin}" | grep DYLIB_STUB &>/dev/null; then
        continue; fi
    if grep $'\xfa\xde\x0c\x01' "${bin}" &>/dev/null; then
        continue; fi

    perms=$(stat --format=%a "${bin}")
    chmod 755 "${bin}"
    "${PKG_BASE}/util/ldid" -S "${bin}"
        #"${PKG_BASE}/arch/iphoneos-arm/entitlement.xml" "${bin}"
    chmod "${perms}" "${bin}"
done