blob: f938f706cfd4d6a0845c2269b394445faf36856a [file] [log] [blame]
Behdad Esfahbod5bc18192011-05-27 15:58:54 -04001#!/bin/sh
2
3LC_ALL=C
4export LC_ALL
5
6test -z "$srcdir" && srcdir=.
7stat=0
8
Behdad Esfahbodd22548c2013-08-26 18:46:21 -04009test "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'`
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040011
12
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040013echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)'
14
15for x in $HBHEADERS; do
Behdad Esfahbod33ca3b62017-10-25 12:09:11 -040016 test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x"
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040017 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
Behdad Esfahbodc77ae402018-08-25 22:36:36 -070026echo 'Checking that source files #include a private header first (or none)'
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040027
28for x in $HBSOURCES; do
Behdad Esfahbod33ca3b62017-10-25 12:09:11 -040029 test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x"
Behdad Esfahbodc77ae402018-08-25 22:36:36 -070030 grep '#.*\<include\>' "$x" /dev/null | head -n 1
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040031done |
Behdad Esfahbodc77ae402018-08-25 22:36:36 -070032grep -v '"hb-.*[.]hh"' |
33grep -v 'hb[.]hh' |
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040034grep . >&2 && stat=1
35
36
Behdad Esfahbod21ac5672017-10-30 09:48:09 -060037echo 'Checking that there is no #include <hb-*.h>'
Behdad Esfahbodd3490762013-08-26 21:15:29 -040038for x in $HBHEADERS $HBSOURCES; do
39 test -f "$srcdir/$x" && x="$srcdir/$x"
40 grep '#.*\<include\>.*<.*hb' "$x" /dev/null >&2 && stat=1
41done
Behdad Esfahbod5bc18192011-05-27 15:58:54 -040042
43
44exit $stat