]> git.saurik.com Git - apple/libsystem.git/blame - xcodescripts/create_system_framework.sh
Libsystem-1225.1.1.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
2fbbb8fa 8DSTROOT="$1${INSTALL_PATH_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
25if [[ "${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
36else
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
49fi