]> git.saurik.com Git - apple/libsystem.git/blame - xcodescripts/create_system_framework.sh
Libsystem-1281.tar.gz
[apple/libsystem.git] / xcodescripts / create_system_framework.sh
CommitLineData
2fbbb8fa 1#!/bin/bash -x
bdffa7b9
A
2
3if [ $# -ne 5 ]; then
4 echo "Usage: $0 <dstroot> <srcroot> <action> <archs> <variants>" 1>&2
5 exit 1
6fi
7
b8ce8438 8DSTROOT="$1${INSTALL_PATH_FRAMEWORK_PREFIX}"
bdffa7b9
A
9SRCROOT="$2"
10ACTION="$3"
11ARCHS="$4"
12VARIANTS="$5"
13
14FPATH="/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 19mkdir -p "${DSTROOT}/${FPATH}" || exit 1
bdffa7b9 20mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1
bdffa7b9 21mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1
9acf5127
A
22ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1
23ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1
24
b8ce8438
A
25if [[ "${DRIVERKIT}" == "1" ]]; then exit 0; fi; # No compatibility symlinks in DriverKit SDK
26
9acf5127
A
27if [[ "${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
38else
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
47fi