]>
Commit | Line | Data |
---|---|---|
ad3c9f2a A |
1 | #!/bin/bash |
2 | ||
3 | # build_linklists.sh | |
4 | # Libc | |
5 | ||
6 | # Skip script during installhdrs | |
7 | if [ "$ACTION" == installhdrs ]; then exit 0; fi | |
6465356a A |
8 | # BUILD_ARCHIVES needs to be set in the project settings |
9 | if [ -z "$BUILD_ARCHIVES" ]; then exit 0; fi | |
ad3c9f2a | 10 | |
6465356a A |
11 | [ ! -d "$BUILT_PRODUCTS_DIR" ] && mkdir -p "$BUILT_PRODUCTS_DIR" |
12 | [ ! -d "$DERIVED_FILES_DIR" ] && mkdir -p "$DERIVED_FILES_DIR" | |
ad3c9f2a A |
13 | |
14 | NORMAL_LIST="$BUILT_PRODUCTS_DIR/normal.linklist" | |
15 | DEBUG_LIST="$BUILT_PRODUCTS_DIR/debug.linklist" | |
16 | INTERPOSABLE_LIST="$DERIVED_FILES_DIR/interposable.list" | |
6465356a | 17 | UNEXPORT_LIST="$DERIVED_FILES_DIR/unexport.list" |
ad3c9f2a | 18 | |
974e3884 A |
19 | rm -f "$NORMAL_LIST" |
20 | rm -f "$DEBUG_LIST" | |
21 | rm -f "$INTERPOSABLE_LIST" | |
22 | rm -f "$UNEXPORT_LIST" | |
ad3c9f2a | 23 | |
6465356a | 24 | for x in ${BUILD_ARCHIVES[@]}; do |
ad3c9f2a A |
25 | nm -AUamgf "$BUILT_PRODUCTS_DIR/lib${x}.a" 2>/dev/null | \ |
26 | grep '__TEXT,__text' | \ | |
6465356a | 27 | grep -vE '\$VARIANT' | \ |
974e3884 | 28 | awk '{ print $NF }' >> "$INTERPOSABLE_LIST" |
ad3c9f2a | 29 | |
6465356a | 30 | nm -AUamgf "$BUILT_PRODUCTS_DIR/lib${x}.a" 2>/dev/null | \ |
974e3884 | 31 | awk '/\$VARIANT/ { print $NF }' >> "$UNEXPORT_LIST" |
6465356a | 32 | |
974e3884 A |
33 | echo "$BUILT_PRODUCTS_DIR/lib${x}.a" >> "$NORMAL_LIST.libtool" |
34 | filename=$(printf %s "$BUILT_PRODUCTS_DIR/lib${x}.a" | sed "s/\ /\\\ /g") | |
35 | echo "$filename" >> "$NORMAL_LIST" | |
36 | ||
37 | echo "$BUILT_PRODUCTS_DIR/lib${x}_debug.a" >> "$DEBUG_LIST.libtool" | |
38 | filename=$(printf %s "$BUILT_PRODUCTS_DIR/lib${x}_debug.a" | sed "s/\ /\\\ /g") | |
39 | echo "$filename" >> "$DEBUG_LIST" | |
ad3c9f2a A |
40 | done |
41 | ||
42 | touch "$BUILT_PRODUCTS_DIR/deps.c" | |
43 | ||
44 | exit 0 |