From 057ff0fed7cfd7fa50fb0af99b112d90463be9d3 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 25 May 2013 22:18:45 +0200 Subject: [PATCH] lint: recipes of syntax check require GNU grep; ensure it is used * syntax-checks.mk (sc_sanity_gnu_grep): New. ($(syntax_check_rules)): Depend on it. Signed-off-by: Stefano Lattarini --- syntax-checks.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/syntax-checks.mk b/syntax-checks.mk index 3922896..4dacc5a 100644 --- a/syntax-checks.mk +++ b/syntax-checks.mk @@ -79,6 +79,18 @@ sc_unquoted_DESTDIR \ sc_tabs_in_texi \ sc_at_in_texi +# The recipes of syntax checks require a modern GNU grep. +sc_sanity_gnu_grep: + $(AM_V_GEN)grep --version | grep 'GNU grep' >/dev/null 2>&1 \ + && ab=$$(printf 'a\nb') \ + && test "$$(printf 'xa\nb\nc' | grep -Pzo 'a\nb')" = "$$ab" \ + || { \ + echo "Syntax checks recipes require a modern GNU grep" >&2; \ + exit 1; \ + } +.PHONY: sc_sanity_gnu_grep +$(syntax_check_rules): sc_sanity_gnu_grep + ## These check avoids accidental configure substitutions in the source. ## There are exactly 8 lines that should be modified from automake.in to ## automake, and 9 lines that should be modified from aclocal.in to -- 2.7.4