]>
Commit | Line | Data |
---|---|---|
2fbbb8fa | 1 | #!/bin/bash -x |
bdffa7b9 A |
2 | |
3 | if [ $# -ne 5 ]; then | |
4 | echo "Usage: $0 <dstroot> <srcroot> <action> <archs> <variants>" 1>&2 | |
5 | exit 1 | |
6 | fi | |
7 | ||
2fbbb8fa | 8 | DSTROOT="$1${INSTALL_PATH_PREFIX}" |
bdffa7b9 A |
9 | SRCROOT="$2" |
10 | ACTION="$3" | |
11 | ARCHS="$4" | |
12 | VARIANTS="$5" | |
13 | ||
14 | FPATH="/System/Library/Frameworks/System.framework" | |
15 | ||
9acf5127 A |
16 | # <rdar://problem/21815807> System.framework on iOS needs to be a special snowflake. |
17 | # Other projects install headers into Versions/B/PrivateHeaders the sub-directories | |
18 | # and symlinks still need to exist, even though they don't fit in flat bundles. | |
bdffa7b9 | 19 | mkdir -p "${DSTROOT}/${FPATH}" || exit 1 |
bdffa7b9 | 20 | mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1 |
bdffa7b9 | 21 | mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1 |
9acf5127 A |
22 | ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1 |
23 | ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1 | |
24 | ||
25 | if [[ "${PLATFORM_NAME}" =~ macosx ]]; then | |
26 | ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1 | |
bdffa7b9 | 27 | |
9acf5127 A |
28 | for variant in ${VARIANTS}; do |
29 | suffix="" | |
30 | if [ ${variant} != "normal" ]; then | |
31 | suffix="_${variant}" | |
32 | fi | |
33 | ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 | |
34 | ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1 | |
35 | done | |
36 | else | |
37 | for variant in ${VARIANTS}; do | |
38 | suffix="" | |
39 | if [ ${variant} != "normal" ]; then | |
40 | suffix="_${variant}" | |
41 | fi | |
bdffa7b9 | 42 | |
9acf5127 A |
43 | if [[ "${PLATFORM_NAME}" =~ simulator ]] ; then |
44 | ln -sf "../../../../usr/lib/libSystem${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 | |
45 | else | |
46 | ln -sf "../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 | |
47 | fi | |
48 | done | |
49 | fi |