diff --git a/src/Makefile.am b/src/Makefile.am index 9c534a680..f52ea49a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -99,7 +99,8 @@ main_SOURCES = main.cc main_CPPFLAGS = $(HBCFLAGS) main_LDADD = libharfbuzz.la $(HBLIBS) -TESTS = +TESTS = \ + check-internal-symbols.sh if HAVE_ICU else diff --git a/src/check-internal-symbols.sh b/src/check-internal-symbols.sh new file mode 100755 index 000000000..755851853 --- /dev/null +++ b/src/check-internal-symbols.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +if which nm 2>/dev/null >/dev/null; then + : +else + echo "check-internal-symbols.sh: 'nm' not found; skipping test" + exit 0 +fi + +test -z "$srcdir" && srcdir=. +test -z "$MAKE" && MAKE=make +stat=0 + +so=.libs/libharfbuzz.so +if test -f "$so"; then + echo "Checking that we are exposing internal symbols" + if nm $so | grep ' T _hb'; then + echo "Ouch, internal symbols exposed" + stat=1 + fi +else + echo "check-internal-symbols.sh: libharfbuzz.so not found; skipping test" +fi + +exit $stat