beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / check-preprocessor-syntax.sh
blobb718f604ee72ad608e8ac4117016abacaeb2dcbb
1 #!/bin/sh
3 LC_ALL=C
4 export LC_ALL
6 test -z "$srcdir" && srcdir=.
7 cd "$srcdir"
8 stat=0
11 HEADERS=$all_cairo_headers
12 test "x$HEADERS" = x && HEADERS=`find . -name 'cairo*.h' ! -name 'cairo*-private.h' ! -name 'cairo*-inline.h' ! -name 'cairoint.h'`
14 PRIVATE=$all_cairo_private
15 test "x$PRIVATE" = x && PRIVATE=`find . -name 'cairo*-private.h' -or -name 'cairo*-inline.h' -or -name 'cairoint.h'`
17 SOURCES=$all_cairo_sources
18 test "x$SOURCES" = x && SOURCES=`find . -name 'cairo*.c' -or -name 'cairo*.cpp'`
20 ALL="/dev/null $HEADERS $PRIVATE $SOURCES"
22 echo 'Checking that public header files #include "cairo.h" first (or none)'
24 for x in $HEADERS; do
25 grep '#.*\<include\>' "$x" /dev/null | head -n 1
26 done |
27 grep -v '"cairo[.]h"' |
28 grep -v 'cairo[.]h:' |
29 grep . >&2 && stat=1
32 echo 'Checking that private header files #include "some cairo header" first (or none)'
34 for x in $PRIVATE; do
35 grep '#.*\<include\>' "$x" /dev/null | head -n 1
36 done |
37 grep -v '"cairo.*[.]h"' |
38 grep -v 'cairoint[.]h:' |
39 grep . >&2 && stat=1
42 echo 'Checking that source files #include "cairoint.h" first (or none)'
44 for x in $SOURCES; do
45 grep '#.*\<include\>' "$x" /dev/null | head -n 1
46 done |
47 grep -v '"cairoint[.]h"' |
48 grep . >&2 && stat=1
51 echo 'Checking that there is no #include <cairo.*.h>'
52 grep '#.*\<include\>.*<.*cairo' $ALL >&2 && stat=1
55 echo 'Checking that feature conditionals are used with #if only (not #ifdef)'
56 grep '#ifdef CAIRO_HAS_' $ALL && stat=1
57 grep '#if.*defined[ ]*(CAIRO_HAS_' $ALL && stat=1
59 exit $stat