mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
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>
This commit is contained in:
parent
cb3453e80f
commit
15ec2a04f8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31928
4 changed files with 27 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
GREP_LIBZ?= YES
|
||||
.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
|
||||
ZGREP=zgrep.libz
|
||||
.else
|
||||
ZGREP=zgrep.getopt
|
||||
.endif
|
||||
|
||||
NOSHARED?=yes
|
||||
ZGREP=zgrep.getopt
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue