filters/gp_filter_resize_alloc: Check w and h
[gfxprim.git] / build / check_symbols.sh
blobede319f45d1615b814b3668714b81bb8f5e56394
1 #!/bin/sh
3 # Purpose of this script is to check library exported symbols
6 FOUND=""
7 WARN="WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARNING"
9 SYMTMPFILE=symbols.txt
11 grep_sym()
13 if objdump --syms "$1" |grep "$2" 2>&1 > /dev/null; then
14 echo -e "\t$1"
18 find_symbol()
20 echo "SYM $1:"
22 find ../libs/ -name '*.o' | while read obj; do grep_sym "$obj" "$1"; done
25 get_symbols()
27 objdump --dynamic-syms "$1" | awk 'NR > 4 { print }' | awk '$3 != "*UND*"' | awk '{print $NF}' > "$2"
30 # Remove compiler and glibc symbols
32 sed -i '/^.init$/d' "$2"
33 sed -i '/^__.*$/d' "$2"
34 sed -i '/^_.*$/d' "$2"
37 check_symbols()
39 local symfile=$1
40 shift
42 for i in `cat $symfile`; do
43 if ! grep "^$i$" $@ 2>&1 > /dev/null; then
44 if [ -z "$FOUND" ]; then
45 echo "$WARN"
46 echo
47 echo "Following new API symbols found:"
48 echo
50 find_symbol "$i"
51 FOUND="yes"
53 done
56 do_check()
58 get_symbols "$1" $SYMTMPFILE
59 shift
60 check_symbols $SYMTMPFILE "$@"
61 rm $SYMTMPFILE
64 do_check libgfxprim.so syms/core_symbols.txt syms/input_symbols.txt \
65 syms/filters_symbols.txt syms/gfx_symbols.txt \
66 syms/text_symbols.txt
68 do_check libgfxprim-backends.so syms/backend_symbols.txt
70 do_check libgfxprim-grabbers.so syms/grabbers_symbols.txt
72 do_check libgfxprim-loaders.so syms/loaders_symbols.txt
74 if [ -n "$FOUND" ]; then
75 echo
76 echo "Set them static or update lists of exported functions in syms/foo_symbols.txt"
77 echo
78 echo "$WARN"
79 else
80 echo "No unexpected symbols found :)"