1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/harfbuzz/src/check-exported-symbols.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +LC_ALL=C 1.7 +export LC_ALL 1.8 + 1.9 +test -z "$srcdir" && srcdir=. 1.10 +test -z "$MAKE" && MAKE=make 1.11 +stat=0 1.12 + 1.13 +if which nm 2>/dev/null >/dev/null; then 1.14 + : 1.15 +else 1.16 + echo "check-exported-symbols.sh: 'nm' not found; skipping test" 1.17 + exit 77 1.18 +fi 1.19 + 1.20 +defs="harfbuzz.def" 1.21 +$MAKE $defs > /dev/null 1.22 +tested=false 1.23 +for def in $defs; do 1.24 + lib=`echo "$def" | sed 's/[.]def$//;s@.*/@@'` 1.25 + so=.libs/lib${lib}.so 1.26 + if test -f "$so"; then 1.27 + echo "Checking that $so has the same symbol list as $def" 1.28 + { 1.29 + echo EXPORTS 1.30 + nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>' | cut -d' ' -f3 1.31 + stat=1 1.32 + # cheat: copy the last line from the def file! 1.33 + tail -n1 "$def" 1.34 + } | diff "$def" - >&2 || stat=1 1.35 + tested=true 1.36 + fi 1.37 +done 1.38 +if ! $tested; then 1.39 + echo "check-exported-symbols.sh: libharfbuzz shared library not found; skipping test" 1.40 + exit 77 1.41 +fi 1.42 + 1.43 +exit $stat