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: stat=0 michael@0: michael@0: michael@0: if which nm 2>/dev/null >/dev/null; then michael@0: : michael@0: else michael@0: echo "check-symbols.sh: 'nm' not found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: echo "Checking that we are not exposing internal symbols" michael@0: tested=false michael@0: for so in `ls .libs/lib*.so .libs/lib*.dylib 2>/dev/null` ; do michael@0: michael@0: EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>' | cut -d' ' -f3`" michael@0: prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'` michael@0: michael@0: echo "Processing $so" michael@0: if echo "$EXPORTED_SYMBOLS" | grep -v "^${prefix}_"; then michael@0: echo "Ouch, internal symbols exposed" michael@0: stat=1 michael@0: fi michael@0: michael@0: tested=true michael@0: done michael@0: if ! $tested; then michael@0: echo "check-symbols.sh: no shared library found; skipping test" michael@0: exit 77 michael@0: fi michael@0: michael@0: exit $stat