提交 a02d8648 编写于 作者: B Behdad Esfahbod

Add check-exported-symbols.sh

And misc linking fixes.
上级 4c8ac4f4
......@@ -241,6 +241,7 @@ test_would_substitute_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS)
dist_check_SCRIPTS = \
check-c-linkage-decls.sh \
check-header-guards.sh \
check-exported-symbols.sh \
check-includes.sh \
check-internal-symbols.sh \
check-static-inits.sh \
......
#!/bin/sh
LC_ALL=C
export LC_ALL
test -z "$srcdir" && srcdir=.
test -z "$MAKE" && MAKE=make
stat=0
if which nm 2>/dev/null >/dev/null; then
:
else
echo "check-exported-symbols.sh: 'nm' not found; skipping test"
exit 77
fi
defs="harfbuzz.def"
$MAKE $defs > /dev/null
tested=false
for def in $defs; do
lib=`echo "$def" | sed 's/[.]def$//;s@.*/@@'`
so=.libs/lib${lib}.so
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\>' | cut -d' ' -f3
stat=1
# cheat: copy the last line from the def file!
tail -n1 "$def"
} | diff "$def" - >&2 || stat=1
tested=true
fi
done
if ! $tested; then
echo "check-exported-symbols.sh: libharfbuzz shared library not found; skipping test"
exit 77
fi
exit $stat
......@@ -19,7 +19,7 @@ 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 ' [TW] ' | grep -v ' T _fini\>\| T _init\>\| T hb_'; then
if nm "$so" | grep ' [BCDGINRSTVW] ' | grep -v ' T _fini\>\| T _init\>\| T hb_'; then
echo "Ouch, internal symbols exposed"
stat=1
fi
......
......@@ -57,7 +57,7 @@ indic_options_init (void)
return u;
}
inline indic_options_t
static inline indic_options_t
indic_options (void)
{
static indic_options_union_t options;
......
......@@ -40,7 +40,7 @@
#include "hb-set-private.hh"
hb_tag_t common_features[] = {
static hb_tag_t common_features[] = {
HB_TAG('c','c','m','p'),
HB_TAG('l','i','g','a'),
HB_TAG('l','o','c','l'),
......@@ -50,7 +50,7 @@ hb_tag_t common_features[] = {
};
hb_tag_t horizontal_features[] = {
static hb_tag_t horizontal_features[] = {
HB_TAG('c','a','l','t'),
HB_TAG('c','l','i','g'),
HB_TAG('c','u','r','s'),
......@@ -63,7 +63,7 @@ hb_tag_t horizontal_features[] = {
* According to the spec, valt and vpal are also mutually exclusive.
* But we apply them all for now.
*/
hb_tag_t vertical_features[] = {
static hb_tag_t vertical_features[] = {
HB_TAG('v','a','l','t'),
HB_TAG('v','e','r','t'),
HB_TAG('v','k','r','n'),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册