1#!/bin/sh 2 3LC_ALL=C 4export LC_ALL 5 6test -z "$srcdir" && srcdir=. 7stat=0 8 9 10if which nm 2>/dev/null >/dev/null; then 11 : 12else 13 echo "check-symbols.sh: 'nm' not found; skipping test" 14 exit 77 15fi 16 17echo "Checking that we are not exposing internal symbols" 18tested=false 19for suffix in so dylib; do 20 so=.libs/libharfbuzz.$suffix 21 if ! test -f "$so"; then continue; fi 22 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\>\| llvm_' | cut -d' ' -f3`" 24 25 prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'` 26 27 # On mac, C symbols are prefixed with _ 28 if test $suffix = dylib; then prefix="_$prefix"; fi 29 30 echo "Processing $so" 31 if echo "$EXPORTED_SYMBOLS" | grep -v "^${prefix}_"; then 32 echo "Ouch, internal symbols exposed" 33 stat=1 34 fi 35 36 tested=true 37done 38if ! $tested; then 39 echo "check-symbols.sh: no shared library found; skipping test" 40 exit 77 41fi 42 43exit $stat 44