Subject: Re: bug#32866: cross-compiling grep and changing $PATH

From: Barret Rhoden <[email-masked]>
Date: Fri, 28 Sep 2018 15:21:17 -0400

On 2018-09-28 at 12:02 Paul Eggert <[email-masked]> wrote:
> On 9/28/18 11:37 AM, Barret Rhoden wrote:
> > It doesn't seem particularly harmful, but maybe that PATH change should
> > depend on whether it's a cross build or not.  
> 
> Sounds like a good idea. Care to suggest a patch?
> 

The attached patch works for me.  Tested it on Linux, and it still
builds and runs.

If you all like it and prefer a git format-patch or send-email, I can do
that too.
--- a/cfg.mk	2018-09-28 14:33:33.652414862 -0400
+++ b/cfg.mk	2018-09-28 14:33:37.916437913 -0400
@@ -17,7 +17,9 @@
 # Cause the tool(s) built by this package to be used also when running
 # commands via e.g., "make syntax-check".  Doing this a little sooner
 # would have avoided a grep infloop bug.
+ifeq ($(build_triplet), $(host_triplet))
 export PATH := $(builddir)/src$(PATH_SEPARATOR)$(PATH)
+endif
 
 # Used in maint.mk's web-manual rule
 manual_title = GNU Grep: Print lines matching a pattern