]> git.saurik.com Git - apple/libc.git/blob - xcodescripts/build_linklists.sh
Libc-825.25.tar.gz
[apple/libc.git] / xcodescripts / build_linklists.sh
1 #!/bin/bash
2
3 # build_linklists.sh
4 # Libc
5
6 # Skip script during installhdrs
7 if [ "$ACTION" == installhdrs ]; then exit 0; fi
8
9 ARCHIVES=(Platform Base FreeBSD FreeBSD_gcc NetBSD TRE vCancelable vDarwinExtsn vDarwinExtsnCancelable vPre1050 vLegacy vInode32)
10
11 NORMAL_LIST="$BUILT_PRODUCTS_DIR/normal.linklist"
12 DEBUG_LIST="$BUILT_PRODUCTS_DIR/debug.linklist"
13 INTERPOSABLE_LIST="$DERIVED_FILES_DIR/interposable.list"
14
15 rm -f $NORMAL_LIST
16 rm -f $DEBUG_LIST
17 rm -f $INTERPOSABLE_LIST
18
19 for x in ${ARCHIVES[@]}; do
20 nm -AUamgf "$BUILT_PRODUCTS_DIR/lib${x}.a" 2>/dev/null | \
21 grep '__TEXT,__text' | \
22 grep -v '\[symbol resolver\]' | \
23 grep -vE '\$VARIANT\$(m|u)p' | \
24 awk '{ print $NF }' >> $INTERPOSABLE_LIST
25
26 echo "-l$x" >> $NORMAL_LIST
27 echo "-l${x}_debug" >> $DEBUG_LIST
28 done
29
30 touch "$BUILT_PRODUCTS_DIR/deps.c"
31
32 exit 0