]>
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 | ||
b8ce8438 | 8 | DSTROOT="$1${INSTALL_PATH_FRAMEWORK_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 | ||
b8ce8438 A |
25 | if [[ "${DRIVERKIT}" == "1" ]]; then exit 0; fi; # No compatibility symlinks in DriverKit SDK |
26 | ||
9acf5127 A |
27 | if [[ "${PLATFORM_NAME}" =~ macosx ]]; then |
28 | ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1 | |
bdffa7b9 | 29 | |
9acf5127 A |
30 | for variant in ${VARIANTS}; do |
31 | suffix="" | |
32 | if [ ${variant} != "normal" ]; then | |
33 | suffix="_${variant}" | |
34 | fi | |
35 | ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 | |
36 | ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1 | |
37 | done | |
38 | else | |
39 | for variant in ${VARIANTS}; do | |
40 | suffix="" | |
41 | if [ ${variant} != "normal" ]; then | |
42 | suffix="_${variant}" | |
43 | fi | |
bdffa7b9 | 44 | |
a85a94cf | 45 | ln -sf "../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 |
9acf5127 A |
46 | done |
47 | fi |