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