cairo/src/check-preprocessor-syntax.sh
Vladimir Vukicevic 22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00

58 lines
1.4 KiB
Bash
Executable file

#!/bin/sh
LANG=C
test -z "$srcdir" && srcdir=.
cd "$srcdir"
stat=0
HEADERS=$all_cairo_headers
test "x$HEADERS" = x && HEADERS=`find . -name 'cairo*.h' ! -name 'cairo*-private.h' ! -name 'cairoint.h'`
PRIVATE=$all_cairo_private
test "x$PRIVATE" = x && PRIVATE=`find . -name 'cairo*-private.h' -or -name 'cairoint.h'`
SOURCES=$all_cairo_sources
test "x$SOURCES" = x && SOURCES=`find . -name 'cairo*.c' -or -name 'cairo*.cpp'`
ALL="/dev/null $HEADERS $PRIVATE $SOURCES"
echo 'Checking that public header files #include "cairo.h" first (or none)'
for x in $HEADERS; do
grep '#.*\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '"cairo[.]h"' |
grep -v 'cairo[.]h:' |
grep . >&2 && stat=1
echo 'Checking that private header files #include "some cairo header" first (or none)'
for x in $PRIVATE; do
grep '#.*\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '"cairo.*[.]h"' |
grep -v 'cairoint[.]h:' |
grep . >&2 && stat=1
echo 'Checking that source files #include "cairoint.h" first (or none)'
for x in $SOURCES; do
grep '#.*\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '"cairoint[.]h"' |
grep . >&2 && stat=1
echo 'Checking that there is no #include <cairo.*.h>'
grep '#.*\<include\>.*<.*cairo' $ALL >&2 && stat=1
echo 'Checking that feature conditionals are used with #if only (not #ifdef)'
grep '#ifdef CAIRO_HAS_' $ALL && stat=1
grep '#if.*defined[ ]*(CAIRO_HAS_' $ALL && stat=1
exit $stat