6 test -z "$srcdir" && srcdir=.
10 if which nm 2>/dev/null >/dev/null; then
13 echo "check-symbols.sh: 'nm' not found; skipping test"
17 echo "Checking that we are not exposing internal symbols"
19 for suffix in so dylib; do
20 so=.libs/libharfbuzz.$suffix
21 if ! test -f "$so"; then continue; fi
23 EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| _fbss\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>\| __gcov_flush\>\| ___gcov_flush\>\| llvm_\| _llvm_' | cut -d' ' -f3`"
25 prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'`
27 # On mac, C symbols are prefixed with _
28 if test $suffix = dylib; then prefix="_$prefix"; fi
31 if echo "$EXPORTED_SYMBOLS" | grep -v "^${prefix}_"; then
32 echo "Ouch, internal symbols exposed"
39 echo "check-symbols.sh: no shared library found; skipping test"