michael@0: #!/bin/sh michael@0: michael@0: LC_ALL=C michael@0: export LC_ALL michael@0: michael@0: test -z "$srcdir" && srcdir=. michael@0: test -z "$MAKE" && MAKE=make michael@0: stat=0 michael@0: michael@0: if which nm 2>/dev/null >/dev/null; then michael@0: : michael@0: else michael@0: echo "check-exported-symbols.sh: 'nm' not found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: defs="harfbuzz.def" michael@0: $MAKE $defs > /dev/null michael@0: tested=false michael@0: for def in $defs; do michael@0: lib=`echo "$def" | sed 's/[.]def$//;s@.*/@@'` michael@0: so=.libs/lib${lib}.so michael@0: if test -f "$so"; then michael@0: echo "Checking that $so has the same symbol list as $def" michael@0: { michael@0: echo EXPORTS michael@0: nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>' | cut -d' ' -f3 michael@0: stat=1 michael@0: # cheat: copy the last line from the def file! michael@0: tail -n1 "$def" michael@0: } | diff "$def" - >&2 || stat=1 michael@0: tested=true michael@0: fi michael@0: done michael@0: if ! $tested; then michael@0: echo "check-exported-symbols.sh: libharfbuzz shared library not found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: exit $stat