]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Avoid grep in minimal configure
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Apr 2025 21:01:38 +0000 (14:01 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Apr 2025 22:17:11 +0000 (15:17 -0700)
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE):
Use ‘sed -n '$='’ instead of ‘grep -c’, since these
are the only uses of grep in a minimal ‘configure’
and we are already using sed elsewhere.

doc/install.texi
lib/autoconf/status.m4

index f9e5e7fa693c5a6a7cc71af8092c951901cde1ee..98eebe3d1e69d1a4ed7c7cb6f7715b4697a4f39a 100644 (file)
@@ -138,15 +138,15 @@ you can type @samp{make uninstall} to remove the installed files.
 Installation requires a POSIX-like environment
 with a shell and at least the following standard utilities:
 
-@example
-awk cat cp diff echo expr false
-grep ls mkdir mv printf pwd
-rm rmdir sed sort test tr
-@end example
+@quotation
+@t{awk cat cp diff echo expr false
+ls mkdir mv printf pwd
+rm rmdir sed sort test tr}
+@end quotation
 
 @noindent
 This package's installation may need other standard utilities such as
-@command{cmp}, @command{make}, @command{sleep} and @command{touch},
+@command{grep}, @command{make}, @command{sleep} and @command{touch},
 along with compilers like @command{gcc}.
 
 @node Compilers and Options
index 8bbf4b385e94a46ba05d5b2d58627817f75849b4..0ac451dca55ab297ae23d7a7a0e76c34c9ed6f43 100644 (file)
@@ -403,14 +403,13 @@ rm -f conf$$files.sh
   echo "_ACEOF"
 } >conf$$subs.sh ||
   AC_MSG_ERROR([could not make $CONFIG_STATUS])
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim_num=`echo "$ac_subst_vars" | sed -n '$='`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
     AC_MSG_ERROR([could not make $CONFIG_STATUS])
 
-dnl Do not use grep on conf$$subs.awk, since AIX grep has a line length limit.
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | sed -n '$='`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then