Updated: Sudoku no longer crashes
[moon.git] / cairo / src / check-def.sh
blob96f343e0c3c9befebf345e8f3da7e350811d10c3
1 #!/bin/sh
3 LANG=C
5 if which nm 2>/dev/null >/dev/null; then
7 else
8 echo "'nm' not found; skipping test"
9 exit 0
12 test -z "$srcdir" && srcdir=.
13 test -z "$MAKE" && MAKE=make
14 stat=0
16 $MAKE check-has-hidden-symbols.i > /dev/null || exit 1
17 if tail -1 check-has-hidden-symbols.i | grep CAIRO_HAS_HIDDEN_SYMBOLS >/dev/null; then
18 echo "Compiler doesn't support symbol visibility; skipping test"
19 exit 0
22 get_cairo_syms='nm "$so" | grep " [BCDGINRSTVW] " | cut -d" " -f3'
23 if [ "`uname -s`" = "Linux" ]; then
24 get_cairo_syms='( objdump -t "$so" | grep "^[^ ]* [^l.*]*[.]"; objdump -t "$so" | grep "[.]hidden.*\\<cairo"; ) | sed "s/.* //"'
27 defs="cairo.def"
28 $MAKE $defs > /dev/null
29 for def in $defs; do
30 lib=`echo "$def" | sed 's/[.]def$//'`
31 lib=`echo "$lib" | sed 's@.*/@@'`
32 so=.libs/lib${lib}.so
34 test -f "$so" || continue
36 echo Checking that $so has the same symbol list as $def
39 echo EXPORTS
40 eval $get_cairo_syms | grep -v '^_cairo_test_\|^_fini\|^_init\|^_save[fg]pr\|^_rest[fg]pr' | sort -u
41 # cheat: copy the last line from the def file!
42 tail -n1 "$def"
43 } | diff "$def" - >&2 || stat=1
44 done
46 exit $stat