diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-10 11:49:33 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-10 11:51:19 -0700 |
commit | 706855071736294c541410eac959b167bb346ed5 (patch) | |
tree | 64a46743ed70567e7dde4e70ae1d5fbea18da4d0 /configure.ac | |
parent | 3b232c7e2c408eec801c4a69eb23c42b1e22c17c (diff) | |
download | grep-706855071736294c541410eac959b167bb346ed5.tar.gz |
maint: fix “/src/grep: No such file or directory”
Problem reported by Jim Meyering in:
https://lists.gnu.org/r/grep-devel/2019-02/msg00000.html
* NEWS: Mention the change.
* configure.ac (fn_grep): Remove. This old attempt to fix
<https://savannah.gnu.org/bugs/?31646> wasn’t working anyway,
since subprograms didn’t grok fn_grep. People building on Solaris
will need a working grep, which is reasonably standard nowadays.
(GREP, EGREP): Do not override. This way, we test the
newly-built grep only when running ‘make test’ and suchlike.
Instead, output a hopefully-helpful diagnostic if the
system 'grep' does not work.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/configure.ac b/configure.ac index 49998407..c2268b52 100644 --- a/configure.ac +++ b/configure.ac @@ -22,45 +22,14 @@ AC_INIT([GNU grep], m4_esyscmd([build-aux/git-version-gen .tarball-version]), [bug-grep@gnu.org]) -# Set the GREP and EGREP variables to a dummy replacement for the 'grep' -# command, so that AC_PROG_GREP and AC_PROG_EGREP don't fail when no good -# 'grep' program is found. This makes it possible to build GNU grep on a -# Solaris machine that has only /usr/bin/grep and no /usr/xpg4/bin/grep. -# This function supports only restricted arguments: -# - No file names as arguments, process only standard input. -# - Only literal strings without backslashes, no regular expressions. -# - The only options are -e and -E (and -Ee). -# This function also does not support long lines beyond what the shell -# supports), and backslash-processes the input. -fn_grep () { - test "$1" = -E && shift - case $@%:@:$1 in - 0:*) AC_MSG_ERROR([fn_grep: expected pattern]) ;; - 1:-*) AC_MSG_ERROR([fn_grep: invalid command line]) ;; - 1:*) pattern=$1 ;; - 2:--|2:-e|2:-Ee) pattern=$2 ;; - *) AC_MSG_ERROR([fn_grep: invalid command line]) ;; - esac - - case $pattern in - [*['].^$\*[']*]) dnl The outer brackets are for M4. - AC_MSG_ERROR([fn_grep: regular expressions not supported]) ;; - esac - - rc=1 - while read line; do - case $line in - *$pattern*) - rc=0 - AS_ECHO([$line]) ;; - esac - done - return $rc -} - -test -n "$GREP" || GREP=fn_grep -test -n "$EGREP" || EGREP=fn_grep -ac_cv_path_EGREP=$EGREP +if test -n "$GREP" || test -n "$EGREP"; then + AC_MSG_ERROR( + [no working 'grep' found + A working 'grep' command is needed to build GNU Grep. + This 'grep' should support -e and long lines. + On Solaris 10, install the package SUNWggrp or SUNWxcu4. + On Solaris 11, install the package text/gnu-grep or system/xopen/xcu4.]) +fi AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_SRCDIR(src/grep.c) @@ -227,6 +196,4 @@ AC_CONFIG_FILES([ doc/Makefile gnulib-tests/Makefile ]) -GREP="$ac_abs_top_builddir/src/grep" -EGREP="$ac_abs_top_builddir/src/grep -E" AC_OUTPUT |