[cairo-commit] src/check-def.sh src/check-has-hidden-symbols.c src/check-plt.sh src/Makefile.am
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jan 11 13:38:54 PST 2008
src/Makefile.am | 14 +++++---------
src/check-def.sh | 4 ++--
src/check-has-hidden-symbols.c | 11 +----------
src/check-plt.sh | 4 ++--
4 files changed, 10 insertions(+), 23 deletions(-)
New commits:
commit ed113ef4229e23d137b2673f233a23064f51ff24
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jan 11 21:13:05 2008 +0000
[check] Move the hidden symbol check into check-{def,plt}.sh
Behdad, once again the arbiter of good taste, objected to the use of
the dotfile within the Makefile, and suggested that one calls $MAKE to
pre-process the source file from within the check scripts.
Doing so removes the ugly wart added to Makefile.am...
diff --git a/src/Makefile.am b/src/Makefile.am
index f9e2eb7..ff793c4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -318,16 +318,12 @@ install-data-local:
TESTS_ENVIRONMENT = srcdir="$(srcdir)" MAKE="$(MAKE)"
TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh
-EXTRA_DIST += $(TESTS)
+EXTRA_DIST += $(TESTS) check-has-hidden-symbols.c
-check-def.sh check-plt.sh: .check-has-hidden-symbols
-
-EXTRA_PROGRAMS = check-has-hidden-symbols
-CLEANFILES += $(EXTRA_PROGRAMS) .check-has-hidden-symbols
-
-check_has_hidden_symbols_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
-.check-has-hidden-symbols: check-has-hidden-symbols$(EXEEXT)
- @nm check-has-hidden-symbols$(EXEEXT) 2>/dev/null | grep cairo_has_hidden_symbols 2>/dev/null >/dev/null && echo 1 > $@ || echo 0 > $@
+# The pre-processed result is used by check-{def,plt}.sh to determine whether
+# cairo has been compiled with symbol hiding.
+.c.i: $(cairo_headers) cairo-features.h $(top_builddir)/config.h
+ $(CPP) -DHAVE_CONFIG_H -I$(srcdir) -I$(builddir) -I$(top_builddir) $(CAIRO_CFLAGS) $< -o $@
SPARSE = sparse
sparse:
diff --git a/src/check-def.sh b/src/check-def.sh
index 334ec6d..a7aa131 100755
--- a/src/check-def.sh
+++ b/src/check-def.sh
@@ -11,8 +11,8 @@ test -z "$srcdir" && srcdir=.
test -z "$MAKE" && MAKE=make
status=0
-has_hidden_symbols=`cat .check-has-hidden-symbols`
-if test "x$has_hidden_symbols" != "x1"; then
+$MAKE check-has-hidden-symbols.i || 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
diff --git a/src/check-has-hidden-symbols.c b/src/check-has-hidden-symbols.c
index 2fb120d..1204127 100644
--- a/src/check-has-hidden-symbols.c
+++ b/src/check-has-hidden-symbols.c
@@ -1,12 +1,3 @@
#include "cairoint.h"
-#if CAIRO_HAS_HIDDEN_SYMBOLS
-extern cairo_public int cairo_has_hidden_symbols;
-int cairo_has_hidden_symbols;
-#endif
-
-int
-main (void)
-{
- return 0;
-}
+CAIRO_HAS_HIDDEN_SYMBOLS
diff --git a/src/check-plt.sh b/src/check-plt.sh
index 3007fb9..ce0952d 100755
--- a/src/check-plt.sh
+++ b/src/check-plt.sh
@@ -10,8 +10,8 @@ fi
test -z "$srcdir" && srcdir=.
status=0
-has_hidden_symbols=`cat .check-has-hidden-symbols`
-if test "x$has_hidden_symbols" != "x1"; then
+$MAKE check-has-hidden-symbols.i || 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
More information about the cairo-commit
mailing list