]> git.saurik.com Git - apple/libsystem.git/blame - xcodescripts/create_dylib_symlinks.sh
Libsystem-1281.tar.gz
[apple/libsystem.git] / xcodescripts / create_dylib_symlinks.sh
CommitLineData
2fbbb8fa 1#!/bin/bash -x
bdffa7b9
A
2
3if [ $# -ne 3 ]; then
4 echo "Usage: $0 <dstroot> <action> <variants>" 1>&2
5 exit 1
6fi
7
b8ce8438
A
8if [[ "${DRIVERKIT}" == "1" ]]; then exit 0; fi; # No compatibility symlinks in DriverKit SDK
9
2fbbb8fa 10DSTROOT="$1${INSTALL_PATH_PREFIX}"
bdffa7b9
A
11ACTION="$2"
12VARIANTS="$3"
13
14BSD_LIBS="c info m pthread dbm poll dl rpcsvc proc"
15
a85a94cf
A
16if [[ "${PLATFORM_NAME}" =~ macosx ]]; then
17 BSD_LIBS="${BSD_LIBS} gcc_s.1"
18fi
19
bdffa7b9
A
20mkdir -p "${DSTROOT}/usr/lib" || exit 1
21
22if [ "${ACTION}" != "installhdrs" ]; then
23 for variant in ${VARIANTS}; do
24 suffix=""
25 if [ ${variant} != "normal" ]; then
26 suffix="_${variant}"
27 fi
28
a85a94cf 29 ln -sf "libSystem.B${suffix}.dylib" "${DSTROOT}/usr/lib/libSystem${suffix}.dylib" || exit 1
2fbbb8fa 30
bdffa7b9
A
31 for i in ${BSD_LIBS}; do
32 ln -sf "libSystem.dylib" "${DSTROOT}/usr/lib/lib${i}.dylib" || exit 1
33 done
34 done
35fi