From 21d0fce3d5364c91e5582bd530210f03e054d1a4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 3 Nov 2009 14:28:32 -0500 Subject: [PATCH] Add check for not linking to libstdc++ --- TODO | 3 +-- src/Makefile.am | 4 ++++ src/check-libstdc++.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100755 src/check-libstdc++.sh diff --git a/TODO b/TODO index 1e32c39b4..bbb9797ff 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ - cmap14 support in get_glyph callback -- size_t? -- Add test for linking to libstdc++ +- Use size_t in sanitize? - Move unicode_funcs to buffer hb-ot: diff --git a/src/Makefile.am b/src/Makefile.am index 83bee49b4..188c38cc9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,4 +62,8 @@ main_SOURCES = main.cc main_CPPFLAGS = $(GLIB_CFLAGS) main_LDADD = libharfbuzz.la $(GLIB_LIBS) +TESTS = \ + check-libstdc++.sh \ + $(NULL) + -include $(top_srcdir)/git.mk diff --git a/src/check-libstdc++.sh b/src/check-libstdc++.sh new file mode 100755 index 000000000..82e62d6fb --- /dev/null +++ b/src/check-libstdc++.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +if which ldd 2>/dev/null >/dev/null; then + : +else + echo "check-libstdc++.sh: 'ldd' 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 not linking to libstdc++" + if ldd $so | grep 'libstdc[+][+]'; then + echo "Ouch, linked to libstdc++" + stat=1 + fi +else + echo "check-libstdc++.sh: libharfbuzz.so not found; skipping test" +fi + +exit $stat