]> git.saurik.com Git - apple/libsystem.git/blame - xcodescripts/create_system_framework.sh
Libsystem-1213.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
16mkdir -p "${DSTROOT}/${FPATH}" || exit 1
17ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1
18ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1
19
20mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1
21ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1
22mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1
23
24for variant in ${VARIANTS}; do
25 suffix=""
26 if [ ${variant} != "normal" ]; then
27 suffix="_${variant}"
28 fi
29 ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
bdffa7b9 30
2fbbb8fa
A
31 if [[ "${PLATFORM_NAME}" =~ simulator ]] ; then
32 ln -sf "../../../../../../usr/lib/libSystem${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1
33 else
34 ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1
35 fi
bdffa7b9 36done