gfx/harfbuzz/src/check-header-guards.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/harfbuzz/src/check-header-guards.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     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 +for x in $HBHEADERS $HBSOURCES; do
    1.17 +	test -f "$srcdir/$x" && x="$srcdir/$x"
    1.18 +	echo "$x" | grep '[^h]$' -q && continue;
    1.19 +	xx=`echo "$x" | sed 's@.*/@@'`
    1.20 +	tag=`echo "$xx" | tr 'a-z.-' 'A-Z_'`
    1.21 +	lines=`grep "\<$tag\>" "$x" | wc -l | sed 's/[ 	]*//g'`
    1.22 +	if test "x$lines" != x3; then
    1.23 +		echo "Ouch, header file $x does not have correct preprocessor guards"
    1.24 +		stat=1
    1.25 +	fi
    1.26 +done
    1.27 +
    1.28 +exit $stat

mercurial