summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1997-12-21 19:15:12 +0000
committerwosch <wosch@FreeBSD.org>1997-12-21 19:15:12 +0000
commit05604036c1fb48d8724db559aeb981813b41afa8 (patch)
treeb1ad5de571a8dfab66f5e6a8beadb0ceae3a37ca /gnu
parent7fb46d49218076b8a6b7f0ddeb7afd3d18187df8 (diff)
downloadFreeBSD-src-05604036c1fb48d8724db559aeb981813b41afa8.zip
FreeBSD-src-05604036c1fb48d8724db559aeb981813b41afa8.tar.gz
When called as `zgrep', the -Z argument is assumed. Make a
link from zgrep to grep. Pointed out by: Tim Vanderhoek <hoek@hwcn.org> and Mike Smith <mike@smith.net.au>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/Makefile6
-rw-r--r--gnu/usr.bin/grep/grep.17
-rw-r--r--gnu/usr.bin/grep/grep.c6
-rw-r--r--gnu/usr.bin/gzip/Makefile17
4 files changed, 26 insertions, 10 deletions
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile
index 40aafc0..a6ab6a1 100644
--- a/gnu/usr.bin/grep/Makefile
+++ b/gnu/usr.bin/grep/Makefile
@@ -1,5 +1,6 @@
-# $Id$
+# $Id: Makefile,v 1.10 1997/12/20 18:46:06 wosch Exp $
+CFLAGS=-g
GREP_LIBZ= YES
GREP_FTS= YES
@@ -20,6 +21,9 @@ LDADD+= -lgnuregex
LDADD+= -lz
DPADD+= ${LIBZ}
CFLAGS+= -DHAVE_LIBZ=1
+LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
+ ${BINDIR}/grep ${BINDIR}/zegrep \
+ ${BINDIR}/grep ${BINDIR}/zfgrep
.endif
.if defined(GREP_FTS) && !empty(GREP_FTS)
CFLAGS+= -DHAVE_FTS=1
diff --git a/gnu/usr.bin/grep/grep.1 b/gnu/usr.bin/grep/grep.1
index 75a15a7..6f5c48a 100644
--- a/gnu/usr.bin/grep/grep.1
+++ b/gnu/usr.bin/grep/grep.1
@@ -1,6 +1,6 @@
.TH GREP 1 "1992 September 10" "GNU Project"
.SH NAME
-grep, egrep, fgrep \- print lines matching a pattern
+grep, egrep, fgrep, zgrep \- print lines matching a pattern
.SH SYNOPSIS
.B grep
[\-[AB] num]
@@ -59,6 +59,11 @@ and is compatible with the historical Unix
.B Fgrep
is the same as
.BR "grep\ \-F" .
+When called as
+.BR zgrep ,
+the
+.BR \-Z
+option is assumed.
.PD
.LP
All variants of
diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c
index 82a8403..9a0fe05 100644
--- a/gnu/usr.bin/grep/grep.c
+++ b/gnu/usr.bin/grep/grep.c
@@ -725,6 +725,12 @@ main(argc, argv)
#if HAVE_FTS > 0
Rflag = Hflag = Pflag = Lflag = 0;
#endif
+#if HAVE_LIBZ > 0
+ if (*prog == 'z') {
+ prog++;
+ Zflag = 1;
+ }
+#endif
while ((opt = getopt(argc, argv,
GETOPT_STD/**/GETOPT_FTS/**/GETOPT_Z)) != -1)
diff --git a/gnu/usr.bin/gzip/Makefile b/gnu/usr.bin/gzip/Makefile
index 6529e5e..31af912 100644
--- a/gnu/usr.bin/gzip/Makefile
+++ b/gnu/usr.bin/gzip/Makefile
@@ -1,36 +1,37 @@
# @(#)Makefile 5.3 (Berkeley) 5/12/90
-# $Id: Makefile,v 1.15 1997/06/29 06:03:28 pst Exp $
+# $Id: Makefile,v 1.16 1997/12/20 19:20:32 wosch Exp $
PROG= gzip
SRCS= gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c \
crypt.c lzw.c unlzw.c unlzh.c unpack.c getopt.c match.S
MAN1= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1 zgrep.1
CFLAGS+=-DASMV -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1
+GREP_LIBZ?= YES
+
MLINKS= gzip.1 gunzip.1 gzip.1 zcat.1 gzip.1 gzcat.1
MLINKS+= zgrep.1 zfgrep.1 zgrep.1 zegrep.1
MLINKS+= zdiff.1 zcmp.1
LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip
LINKS+= ${BINDIR}/gzip ${BINDIR}/gzcat
LINKS+= ${BINDIR}/gzip ${BINDIR}/zcat
+LINKS+= ${BINDIR}/zdiff ${BINDIR}/zcmp
+.if defined(GREP_LIBZ) && empty(GREP_LIBZ)
LINKS+= ${BINDIR}/zgrep ${BINDIR}/zegrep
LINKS+= ${BINDIR}/zgrep ${BINDIR}/zfgrep
-LINKS+= ${BINDIR}/zdiff ${BINDIR}/zcmp
-NOSHARED?=yes
+.endif
-GREP_LIBZ?= YES
-.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
-ZGREP=zgrep.libz
-.else
+NOSHARED?=yes
ZGREP=zgrep.getopt
-.endif
beforeinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/zforce ${.CURDIR}/gzexe ${.CURDIR}/znew \
${.CURDIR}/zmore ${.CURDIR}/zdiff \
${DESTDIR}${BINDIR}
+.if defined(GREP_LIBZ) && empty(GREP_LIBZ)
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.CURDIR}/${ZGREP} ${DESTDIR}${BINDIR}/zgrep
+.endif
match.o: ${.CURDIR}/match.S
$(CPP) ${.CURDIR}/match.S >_match.s
OpenPOWER on IntegriCloud