diff --git a/src/check-includes.sh b/src/check-includes.sh index 015f66342..5643c6973 100755 --- a/src/check-includes.sh +++ b/src/check-includes.sh @@ -10,12 +10,10 @@ test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb* test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'` -cd "$srcdir" - - echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)' for x in $HBHEADERS; do + test -f "$srcdir/$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-common[.]h"' | @@ -28,6 +26,7 @@ grep . >&2 && stat=1 echo 'Checking that source files #include "hb-*private.hh" first (or none)' for x in $HBSOURCES; do + test -f "$srcdir/$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-.*private[.]hh"' | @@ -36,7 +35,10 @@ grep . >&2 && stat=1 echo 'Checking that there is no #include ' -grep '#.*\.*<.*hb' $HBHEADERS $HBSOURCES >&2 && stat=1 +for x in $HBHEADERS $HBSOURCES; do + test -f "$srcdir/$x" && x="$srcdir/$x" + grep '#.*\.*<.*hb' "$x" /dev/null >&2 && stat=1 +done exit $stat