]> git.saurik.com Git - apple/libpthread.git/blobdiff - xcodescripts/install-sys-headers.sh
libpthread-454.100.8.tar.gz
[apple/libpthread.git] / xcodescripts / install-sys-headers.sh
index a5b4eba646a5fe9334cb8a184e6f92f4fc0baf7b..647bfae976191bdc5fab32284d0c915c6f413f16 100644 (file)
@@ -25,39 +25,25 @@ set -e
 
 if [ "$ACTION" = build ]; then exit 0; fi
 
-DSTROOT="${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}"
-
-DESTDIR="$DSTROOT/usr/include/sys"
-mkdir -p "$DESTDIR"
-for X in \
-       qos.h \
-       ; do
-       cp "sys/$X" "$DESTDIR"
-done
-
-DESTDIR="$DSTROOT/usr/local/include/sys"
-mkdir -p "$DESTDIR"
-for X in \
-       qos_private.h \
-       ; do
-       cp "sys/$X" "$DESTDIR"
-done
-
-DESTDIR="$DSTROOT/usr/include/sys/_pthread"
-mkdir -p "$DESTDIR"
-for X in \
-       _pthread_attr_t.h \
-       _pthread_cond_t.h \
-       _pthread_condattr_t.h \
-       _pthread_key_t.h \
-       _pthread_mutex_t.h \
-       _pthread_mutexattr_t.h \
-       _pthread_once_t.h \
-       _pthread_rwlock_t.h \
-       _pthread_rwlockattr_t.h \
-       _pthread_t.h \
-       _pthread_types.h \
-       ; do
-       cp "sys/_pthread/$X" "$DESTDIR"
-done
+install_headers()
+{
+    mkdir -p "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2"
+    cp -r "${SRCROOT}/$1" "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2"
 
+    find "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2" -type f -name *.h -print0 | \
+        xargs -0I % unifdef -t ${COPY_HEADERS_UNIFDEF_FLAGS} -o "%" "%"
+}
+
+install_modulemaps()
+{
+    mkdir -p "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2"
+    cp "${SRCROOT}/$1/"*.modulemap "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2"
+
+    find "${DSTROOT}/${SDK_INSTALL_HEADERS_ROOT}$2" -type f -name *.modulemap -print0 | \
+        xargs -0I % unifdef -t ${COPY_HEADERS_UNIFDEF_FLAGS} -o "%" "%"
+}
+
+install_headers "include/sys" "/usr/include"
+install_headers "private/sys" "/usr/local/include"
+
+install_modulemaps "include" "/usr/include"