cairo/src/check-plt.sh
Uli Schlachter 1c5b4716f7 meson: Add shell script tests
There are a couple of shell scripts in src/ that run various tests. This
commit adds them to the meson build.

The one exception is check-def.sh, which I couldn't get to work and thus
only add it commented out.

check-headers.sh and check-plt.sh required some tweaking to get them to
work. check-plt.sh will print an error when run since the file
'.libs/lib*.so' does not exist, but it will still run its check
correctly.
2021-05-14 17:08:02 +02:00

30 lines
648 B
Bash
Executable file

#!/bin/sh
LC_ALL=C
export LC_ALL
if which readelf 2>/dev/null >/dev/null; then
:
else
echo "'readelf' not found; skipping test"
exit 0
fi
test -z "$srcdir" && srcdir=.
test -z "$MAKE" && MAKE=make
stat=0
if [ "x$CAIRO_HAS_HIDDEN_SYMBOLS" = x ]; then
$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
fi
for so in .libs/lib*.so "$@"; do
echo Checking "$so" for local PLT entries
readelf -W -r "$so" | grep 'JU\?MP_SLO' | grep 'cairo' >&2 && stat=1
done
exit $stat