]> git.saurik.com Git - apple/libsystem.git/blob - xcodescripts/create_system_framework.sh
Libsystem-1292.100.5.tar.gz
[apple/libsystem.git] / xcodescripts / create_system_framework.sh
1 #!/bin/bash -x
2
3 if [ $# -ne 5 ]; then
4 echo "Usage: $0 <dstroot> <srcroot> <action> <archs> <variants>" 1>&2
5 exit 1
6 fi
7
8 DSTROOT="$1${INSTALL_PATH_FRAMEWORK_PREFIX}"
9 SRCROOT="$2"
10 ACTION="$3"
11 ARCHS="$4"
12 VARIANTS="$5"
13
14 FPATH="/System/Library/Frameworks/System.framework"
15
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.
19 mkdir -p "${DSTROOT}/${FPATH}" || exit 1
20 mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1
21 mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1
22 ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1
23 ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1
24
25 if [[ "${DRIVERKIT}" == "1" ]]; then exit 0; fi; # No compatibility symlinks in DriverKit SDK
26
27 if [[ "${PLATFORM_NAME}" =~ macosx ]]; then
28 ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1
29
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
44
45 ln -sf "../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
46 done
47 fi