]> git.saurik.com Git - apple/dyld.git/blob - build-scripts/libdyld-generate-version-headers.sh
dyld-832.7.3.tar.gz
[apple/dyld.git] / build-scripts / libdyld-generate-version-headers.sh
1 #!/bin/sh
2
3 if [ "${DRIVERKIT}" = 1 ]; then
4 RUNTIME_PREFIX="/System/DriverKit/Runtime"
5 else
6 RUNTIME_PREFIX=""
7 fi
8
9 /bin/mkdir -p ${DERIVED_FILES_DIR}
10 /bin/mkdir -p ${DSTROOT}${RUNTIME_PREFIX}/usr/local/include/mach-o/
11
12 VERSIONS=${SDKROOT}${RUNTIME_PREFIX}/usr/local/include/dyld/for_dyld_priv.inc
13 DYLD_PRIV_IN=${SRCROOT}/include/mach-o/dyld_priv.h
14 DYLD_PRIV_OUT=${DSTROOT}${RUNTIME_PREFIX}/usr/local/include/mach-o/dyld_priv.h
15 TMPFILE=$(mktemp ${DERIVED_FILES_DIR}/dyld_priv.h.XXXXXX)
16
17 /bin/chmod 0644 $TMPFILE
18
19 while IFS="" read -r p || [ -n "$p" ]
20 do
21 case "$p" in
22 *@VERSION_DEFS* ) cat "$VERSIONS" >> $TMPFILE ;;
23 * ) echo "$p" >> $TMPFILE ;;
24 esac
25 done < $DYLD_PRIV_IN
26
27 /usr/bin/rsync -vc $TMPFILE $DYLD_PRIV_OUT
28 /bin/rm -f $TMPFILE