summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/src/check-def.sh
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-10-12 12:03:23 -0500
committersanine <sanine.not@pm.me>2022-10-12 12:03:23 -0500
commit530ffd0b7d3c39757b20f00716e486b5caf89aff (patch)
tree76b35fdf57317038acf6b828871f6ae25fce2ebe /libs/cairo-1.16.0/src/check-def.sh
parent3dbe9332e47c143a237db12440f134caebd1cfbe (diff)
add cairo
Diffstat (limited to 'libs/cairo-1.16.0/src/check-def.sh')
-rwxr-xr-xlibs/cairo-1.16.0/src/check-def.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/cairo-1.16.0/src/check-def.sh b/libs/cairo-1.16.0/src/check-def.sh
new file mode 100755
index 0000000..beefb46
--- /dev/null
+++ b/libs/cairo-1.16.0/src/check-def.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+LC_ALL=C
+export LC_ALL
+
+if which nm 2>/dev/null >/dev/null; then
+ :
+else
+ echo "'nm' not found; skipping test"
+ exit 0
+fi
+
+test -z "$srcdir" && srcdir=.
+test -z "$MAKE" && MAKE=make
+stat=0
+
+$MAKE check-has-hidden-symbols.i > /dev/null || exit 1
+if tail -1 check-has-hidden-symbols.i | grep CAIRO_HAS_HIDDEN_SYMBOLS >/dev/null; then
+ echo "Compiler doesn't support symbol visibility; skipping test"
+ exit 0
+fi
+
+if [ "`uname -s`" = "Linux" ]; then
+ get_cairo_syms='( objdump -t "$so" | grep "^[^ ]* [^l.*]*[.]"; objdump -t "$so" | grep "[.]hidden.*\\<cairo"; ) | sed "s/.* //"'
+else
+ get_cairo_syms='nm "$so" | grep " [BCDGINRSTVW] " | cut -d" " -f3'
+fi
+
+defs="cairo.def"
+$MAKE $defs > /dev/null
+for def in $defs; do
+ lib=`echo "$def" | sed 's/[.]def$//'`
+ lib=`echo "$lib" | sed 's@.*/@@'`
+ so=.libs/lib${lib}.so
+
+ test -f "$so" || continue
+
+ echo Checking that $so has the same symbol list as $def
+
+ {
+ echo EXPORTS
+ eval $get_cairo_syms | c++filt --no-params | grep -v '^_cairo_test_\|^_fini\|^_init\|^_save[fg]pr\|^_rest[fg]pr\|^_Z\|^__gnu\|^__bss\|^_edata\|^_end' | sort -u
+ # cheat: copy the last line from the def file!
+ tail -n1 "$def"
+ } | diff "$def" - >&2 || stat=1
+done
+
+exit $stat