From 71b401032b9e5b0a71e41d95ae0998858787700c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 8 Mar 2016 15:47:57 -0800 Subject: sane_grep: pass "-a" if grep accepts it Newer versions of GNU grep is reported to be pickier when we feed a non-ASCII input and break some Porcelain scripts. As we know we do not feed random binary file to our own sane_grep wrapper, allow us to always pass "-a" by setting SANE_TEXT_GREP=-a Makefile variable to work it around. Signed-off-by: Junio C Hamano --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1f55009bba..6fd7b8edce 100644 --- a/configure.ac +++ b/configure.ac @@ -471,6 +471,13 @@ if test -n "$ASCIIDOC"; then esac fi +if grep -a ascii configure.ac >/dev/null; then + AC_MSG_RESULT([Using 'grep -a' for sane_grep]) + SANE_TEXT_GREP=-a +else + SANE_TEXT_GREP= +fi +GIT_CONF_SUBST([SANE_TEXT_GREP]) ## Checks for libraries. AC_MSG_NOTICE([CHECKS for libraries]) -- cgit v1.2.3