summaryrefslogtreecommitdiff
path: root/src/check-plt.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-01-11 18:47:19 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-01-11 20:27:23 +0000
commit8a6a0b43dc249acb0ad8cb9c6f16360294bcfdc3 (patch)
tree8bad2da44c69344dc808e294f9d413df31829070 /src/check-plt.sh
parent982f65081f987e2c44f05942411c031bd32fd968 (diff)
downloadcairo-8a6a0b43dc249acb0ad8cb9c6f16360294bcfdc3.tar.gz
[check] Replace compiled symbol visibility checker with shell script.
Behdad Esfahbod objected to the execution of a compiled program to check symbol visibility as it makes cross-compilation more difficult. Instead of executing the program, this method conditionally exports a variable if cairo uses symbol hiding and scans the executable for that symbol in a similar manner to check-def.sh. This has the slight advantage of using the Makefile for performing the compilation, rather than attempting to invoke $(CPP) from a shell script within the test environment.
Diffstat (limited to 'src/check-plt.sh')
-rwxr-xr-xsrc/check-plt.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/check-plt.sh b/src/check-plt.sh
index 05cde35f1..3007fb941 100755
--- a/src/check-plt.sh
+++ b/src/check-plt.sh
@@ -2,15 +2,17 @@
LANG=C
-status=0
-
-if ! ./compiler-supports-visibility; then
- echo "Compiler doesn't support symbol visibility; skipping test"
+if ! which readelf 2>/dev/null >/dev/null; then
+ echo "'readelf' not found; skipping test"
exit 0
fi
-if ! which readelf 2>/dev/null >/dev/null; then
- echo "'readelf' not found; skipping test"
+test -z "$srcdir" && srcdir=.
+status=0
+
+has_hidden_symbols=`cat .check-has-hidden-symbols`
+if test "x$has_hidden_symbols" != "x1"; then
+ echo "Compiler doesn't support symbol visibility; skipping test"
exit 0
fi