Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | #!/bin/sh |
michael@0 | 2 | |
michael@0 | 3 | LC_ALL=C |
michael@0 | 4 | export LC_ALL |
michael@0 | 5 | |
michael@0 | 6 | test -z "$srcdir" && srcdir=. |
michael@0 | 7 | stat=0 |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | if which nm 2>/dev/null >/dev/null; then |
michael@0 | 11 | : |
michael@0 | 12 | else |
michael@0 | 13 | echo "check-internal-symbols.sh: 'nm' not found; skipping test" |
michael@0 | 14 | exit 77 |
michael@0 | 15 | fi |
michael@0 | 16 | |
michael@0 | 17 | tested=false |
michael@0 | 18 | for suffix in .so; do |
michael@0 | 19 | so=`echo .libs/libharfbuzz$suffix` |
michael@0 | 20 | if test -f "$so"; then |
michael@0 | 21 | echo "Checking that we are not exposing internal symbols" |
michael@0 | 22 | if nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| T hb_\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>'; then |
michael@0 | 23 | echo "Ouch, internal symbols exposed" |
michael@0 | 24 | stat=1 |
michael@0 | 25 | fi |
michael@0 | 26 | tested=true |
michael@0 | 27 | fi |
michael@0 | 28 | done |
michael@0 | 29 | if ! $tested; then |
michael@0 | 30 | echo "check-internal-symbols.sh: libharfbuzz shared library not found; skipping test" |
michael@0 | 31 | exit 77 |
michael@0 | 32 | fi |
michael@0 | 33 | |
michael@0 | 34 | exit $stat |