]> git.saurik.com Git - apple/libsystem.git/blobdiff - xcodescripts/create_system_framework.sh
Libsystem-1238.51.1.tar.gz
[apple/libsystem.git] / xcodescripts / create_system_framework.sh
index 08498952476a39413e86254c67a947abf9693256..bbc17a9dd4e68231d226950493e24b5223651b4e 100755 (executable)
@@ -1,11 +1,11 @@
-#!/bin/sh -x
+#!/bin/bash -x
 
 if [ $# -ne 5 ]; then
     echo "Usage: $0 <dstroot> <srcroot> <action> <archs> <variants>" 1>&2
     exit 1
 fi
 
-DSTROOT="$1"
+DSTROOT="$1${INSTALL_PATH_PREFIX}"
 SRCROOT="$2"
 ACTION="$3"
 ARCHS="$4"
@@ -13,20 +13,37 @@ VARIANTS="$5"
 
 FPATH="/System/Library/Frameworks/System.framework"
 
+# <rdar://problem/21815807> System.framework on iOS needs to be a special snowflake.
+# Other projects install headers into Versions/B/PrivateHeaders the sub-directories
+# and symlinks still need to exist, even though they don't fit in flat bundles.
 mkdir -p "${DSTROOT}/${FPATH}" || exit 1
-ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1
-ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1
-
 mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1
-ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1
 mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1
+ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1
+ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1
+
+if [[ "${PLATFORM_NAME}" =~ macosx ]]; then
+       ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1
 
-for variant in ${VARIANTS}; do
-    suffix=""
-    if [ ${variant} != "normal" ]; then
-       suffix="_${variant}"
-    fi
-    ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
-       ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1
+       for variant in ${VARIANTS}; do
+               suffix=""
+               if [ ${variant} != "normal" ]; then
+                       suffix="_${variant}"
+               fi
+               ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
+               ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1
+       done
+else
+       for variant in ${VARIANTS}; do
+               suffix=""
+               if [ ${variant} != "normal" ]; then
+                       suffix="_${variant}"
+               fi
 
-done
+               if [[ "${PLATFORM_NAME}" =~ simulator ]] ; then
+                       ln -sf "../../../../usr/lib/libSystem${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
+               else
+                       ln -sf "../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1
+               fi
+       done
+fi