diff --git a/src/Makefile.am b/src/Makefile.am index d72aa0759..79a91d7a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -277,9 +277,8 @@ test_size_params_LDADD = libharfbuzz.la $(HBLIBS) dist_check_SCRIPTS = \ check-c-linkage-decls.sh \ check-header-guards.sh \ - check-exported-symbols.sh \ check-includes.sh \ - check-internal-symbols.sh \ + check-symbols.sh \ $(NULL) if HAVE_ICU diff --git a/src/check-internal-symbols.sh b/src/check-internal-symbols.sh deleted file mode 100755 index a8fdc537d..000000000 --- a/src/check-internal-symbols.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -LC_ALL=C -export LC_ALL - -test -z "$srcdir" && srcdir=. -stat=0 - - -if which nm 2>/dev/null >/dev/null; then - : -else - echo "check-internal-symbols.sh: 'nm' not found; skipping test" - exit 77 -fi - -tested=false -for suffix in .so; do - so=`echo .libs/libharfbuzz$suffix` - if test -f "$so"; then - echo "Checking that we are not exposing internal symbols" - 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 - echo "Ouch, internal symbols exposed" - stat=1 - fi - tested=true - fi -done -if ! $tested; then - echo "check-internal-symbols.sh: libharfbuzz shared library not found; skipping test" - exit 77 -fi - -exit $stat diff --git a/src/check-exported-symbols.sh b/src/check-symbols.sh similarity index 60% rename from src/check-exported-symbols.sh rename to src/check-symbols.sh index 6f0bf7fd8..7256577c5 100755 --- a/src/check-exported-symbols.sh +++ b/src/check-symbols.sh @@ -10,7 +10,7 @@ stat=0 if which nm 2>/dev/null >/dev/null; then : else - echo "check-exported-symbols.sh: 'nm' not found; skipping test" + echo "check-symbols.sh: 'nm' not found; skipping test" exit 77 fi @@ -20,15 +20,25 @@ tested=false for def in $defs; do lib=`echo "$def" | sed 's/[.]def$//;s@.*/@@'` so=.libs/lib${lib}.so + + EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>' | cut -d' ' -f3`" + if test -f "$so"; then + echo "Checking that $so has the same symbol list as $def" { echo EXPORTS - nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>' | cut -d' ' -f3 - stat=1 + echo "$EXPORTED_SYMBOLS" # cheat: copy the last line from the def file! tail -n1 "$def" } | diff "$def" - >&2 || stat=1 + + echo "Checking that we are not exposing internal symbols" + if echo "$EXPORTED_SYMBOLS" | grep -v 'hb_'; then + echo "Ouch, internal symbols exposed" + stat=1 + fi + tested=true fi done