zgrep: do not assume standard 'grep' has -e
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 21 Oct 2012 06:15:26 +0000 (23:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 21 Oct 2012 06:16:05 +0000 (23:16 -0700)
On Solaris 11, /usr/bin/grep -e does not work.
Problem reported by Petr Sumbera in
<http://lists.gnu.org/archive/html/bug-gzip/2012-10/msg00003.html>.
* Makefile.am (.in): Substitute @GREP@.
* configure.ac (AC_PROG_GREP): Invoke.
* zgrep.in (grep): Use @GREP@.

Makefile.am
configure.ac
zgrep.in

index 86a02975027df24d2d4ae3ba5699e9a95a46f010..90fff2da845f0822be9a31229ea66b09a9fd257b 100644 (file)
@@ -84,6 +84,7 @@ SUFFIXES = .in
        $(AM_V_GEN)sed \
                -e 's|/bin/sh|$(SHELL)|g' \
                -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
+               -e 's|[@]GREP@|$(GREP)|g' \
                -e 's|[@]VERSION@|$(VERSION)|g' \
                $(srcdir)/$@.in >$@-t \
          && chmod a+x $@-t \
index 4705ce4b386a68bfc2d730fc3ab0c77791a39905..ecb362bc8bfb2e2d85d3cf30e4646459b248846f 100644 (file)
@@ -33,6 +33,7 @@ AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
 AC_PROG_CC_STDC
 AM_PROG_CC_C_O
 AC_PROG_CPP
+AC_PROG_GREP
 AC_CHECK_TOOL([NM], [nm], [nm])
 AC_PROG_LN_S
 AC_PROG_RANLIB
index f878acf8197158ab5c6a195c6d15fdf2d02e70c5..aec4a670acbd82a801ba9f6396a094f9c36a926b 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
@@ -28,7 +28,7 @@ case $1 in
 esac
 PATH=$bindir:$PATH
 
-grep='${GREP-grep}'
+grep='${GREP-'\''@GREP@'\''}'
 
 version='zgrep (gzip) @VERSION@
 Copyright (C) 2010-2012 Free Software Foundation, Inc.