summaryrefslogtreecommitdiff
path: root/src/check-def.sh
blob: aae3fc66b5691a64bb1ad3288b8061d04c692e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

LANG=C

if ! which nm 2>/dev/null >/dev/null; then
	echo "'nm' not found; skipping test"
	exit 0
fi

test -z "$srcdir" && srcdir=.
status=0

defs="cairo.def"
make $defs
for def in $defs; do
	lib=${def%.def}
	lib=${lib##*/}
	so=.libs/lib${lib}.so

	test -f $so || continue
	echo Checking $def

	{
		echo EXPORTS
		nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo_.*_test_\|^_fini\|^_init' | sort -u
		# cheat: copy the last line from the def file!
		tail -n1 $def
	} | diff $def - || status=1
done

exit $status