1#!/bin/sh
2
3LC_ALL=C
4export LC_ALL
5
6test -z "$srcdir" && srcdir=.
7stat=0
8
9test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb*.h'`
10test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'`
11
12
13echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)'
14
15for x in $HBHEADERS; do
16	test -f "$srcdir/$x" && x="$srcdir/$x"
17	grep '#.*\<include\>' "$x" /dev/null | head -n 1
18done |
19grep -v '"hb-common[.]h"' |
20grep -v '"hb[.]h"' |
21grep -v 'hb-common[.]h:' |
22grep -v 'hb[.]h:' |
23grep . >&2 && stat=1
24
25
26echo 'Checking that source files #include "hb-*private.hh" first (or none)'
27
28for x in $HBSOURCES; do
29	test -f "$srcdir/$x" && x="$srcdir/$x"
30	grep '#.*\<include\>' "$x" /dev/null | grep -v 'include _' | head -n 1
31done |
32grep -v '"hb-.*private[.]hh"' |
33grep -v 'hb-private[.]hh:' |
34grep . >&2 && stat=1
35
36
37echo 'Checking that there is no #include <hb.*.h>'
38for x in $HBHEADERS $HBSOURCES; do
39	test -f "$srcdir/$x" && x="$srcdir/$x"
40	grep '#.*\<include\>.*<.*hb' "$x" /dev/null >&2 && stat=1
41done
42
43
44exit $stat
45