gfx/harfbuzz/src/check-symbols.sh

branch
TOR_BUG_9701
changeset 14
925c144e1f1f
equal deleted inserted replaced
-1:000000000000 0:9db16cd15ce8
1 #!/bin/sh
2
3 LC_ALL=C
4 export LC_ALL
5
6 test -z "$srcdir" && srcdir=.
7 stat=0
8
9
10 if which nm 2>/dev/null >/dev/null; then
11 :
12 else
13 echo "check-symbols.sh: 'nm' not found; skipping test"
14 exit 77
15 fi
16
17 echo "Checking that we are not exposing internal symbols"
18 tested=false
19 for so in `ls .libs/lib*.so .libs/lib*.dylib 2>/dev/null` ; do
20
21 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`"
22 prefix=`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'`
23
24 echo "Processing $so"
25 if echo "$EXPORTED_SYMBOLS" | grep -v "^${prefix}_"; then
26 echo "Ouch, internal symbols exposed"
27 stat=1
28 fi
29
30 tested=true
31 done
32 if ! $tested; then
33 echo "check-symbols.sh: no shared library found; skipping test"
34 exit 77
35 fi
36
37 exit $stat

mercurial