gfx/harfbuzz/src/check-includes.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/harfbuzz/src/check-includes.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +LC_ALL=C
     1.7 +export LC_ALL
     1.8 +
     1.9 +test -z "$srcdir" && srcdir=.
    1.10 +stat=0
    1.11 +
    1.12 +test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb*.h'`
    1.13 +test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'`
    1.14 +
    1.15 +
    1.16 +echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)'
    1.17 +
    1.18 +for x in $HBHEADERS; do
    1.19 +	test -f "$srcdir/$x" && x="$srcdir/$x"
    1.20 +	grep '#.*\<include\>' "$x" /dev/null | head -n 1
    1.21 +done |
    1.22 +grep -v '"hb-common[.]h"' |
    1.23 +grep -v '"hb[.]h"' |
    1.24 +grep -v 'hb-common[.]h:' |
    1.25 +grep -v 'hb[.]h:' |
    1.26 +grep . >&2 && stat=1
    1.27 +
    1.28 +
    1.29 +echo 'Checking that source files #include "hb-*private.hh" first (or none)'
    1.30 +
    1.31 +for x in $HBSOURCES; do
    1.32 +	test -f "$srcdir/$x" && x="$srcdir/$x"
    1.33 +	grep '#.*\<include\>' "$x" /dev/null | head -n 1
    1.34 +done |
    1.35 +grep -v '"hb-.*private[.]hh"' |
    1.36 +grep -v 'hb-private[.]hh:' |
    1.37 +grep . >&2 && stat=1
    1.38 +
    1.39 +
    1.40 +echo 'Checking that there is no #include <hb.*.h>'
    1.41 +for x in $HBHEADERS $HBSOURCES; do
    1.42 +	test -f "$srcdir/$x" && x="$srcdir/$x"
    1.43 +	grep '#.*\<include\>.*<.*hb' "$x" /dev/null >&2 && stat=1
    1.44 +done
    1.45 +
    1.46 +
    1.47 +exit $stat

mercurial