From d73ca62c4fa3f89833c4ea14ebbcaaab3e99c6e6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Fri, 20 Jan 2023 17:54:28 -0800
Subject: [PATCH] build: avoid spurious failures due to lack of EGREP
 definition

* configure.ac: Use AC_PROG_EGREP, since many doc and test rules
use $EGREP.
* cfg.mk (sc_tests_list_consistency): Use grep -E, not $(EGREP) here.
---
 cfg.mk       | 2 +-
 configure.ac | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/cfg.mk b/cfg.mk
index 93bdddb16..76fda9ab9 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -116,7 +116,7 @@ sc_tests_list_consistency:
 	  cd $(top_srcdir);						\
 	  $(SHELL) build-aux/vc-list-files tests			\
 	    | grep -Ev '^tests/(factor/(run|create-test)|init)\.sh$$'	\
-	    | $(EGREP) "$$test_extensions_rx\$$";			\
+	    | grep -E "$$test_extensions_rx\$$";			\
 	} | sort | uniq -u | grep . && exit 1; :

 # Ensure that all version-controlled test scripts are executable.
diff --git a/configure.ac b/configure.ac
index fc0d756dc..2b2f9468d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,7 @@ AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_GCC_TRADITIONAL
 AC_PROG_RANLIB
+AC_PROG_EGREP
 AC_PROG_LN_S
 gl_EARLY
 gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat])
-- 
2.39.1.367.g5cc9858f1b

