head	1.11;
access;
symbols
	RELENG_9_1_0_RELEASE:1.4.2.5.2.2
	RELENG_9_1:1.4.2.5.0.2
	RELENG_9_1_BP:1.4.2.5
	RELENG_9_0_0_RELEASE:1.4.2.4.2.1
	RELENG_9_0:1.4.2.4.0.2
	RELENG_9_0_BP:1.4.2.4
	RELENG_9:1.4.0.2
	RELENG_9_BP:1.4;
locks; strict;
comment	@# @;


1.11
date	2013.06.07.00.27.13;	author svnexp;	state Exp;
branches;
next	1.10;

1.10
date	2013.01.09.00.31.51;	author svnexp;	state Exp;
branches;
next	1.9;

1.9
date	2012.11.17.01.54.20;	author svnexp;	state Exp;
branches;
next	1.8;

1.8
date	2011.11.28.20.16.55;	author gabor;	state Exp;
branches;
next	1.7;

1.7
date	2011.10.23.16.04.07;	author gabor;	state Exp;
branches;
next	1.6;

1.6
date	2011.10.11.22.27.23;	author gabor;	state Exp;
branches;
next	1.5;

1.5
date	2011.10.05.09.56.43;	author gabor;	state Exp;
branches;
next	1.4;

1.4
date	2011.06.06.20.24.17;	author ed;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2011.05.25.01.04.12;	author obrien;	state Exp;
branches;
next	1.2;

1.2
date	2011.04.07.13.03.35;	author gabor;	state Exp;
branches;
next	1.1;

1.1
date	2010.07.22.19.11.57;	author gabor;	state Exp;
branches;
next	;

1.4.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	2011.10.11.15.03.42;	author gabor;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	2011.10.20.16.08.11;	author gabor;	state Exp;
branches;
next	1.4.2.4;

1.4.2.4
date	2011.10.27.19.18.54;	author gabor;	state Exp;
branches
	1.4.2.4.2.1;
next	1.4.2.5;

1.4.2.5
date	2011.12.31.13.12.10;	author gabor;	state Exp;
branches
	1.4.2.5.2.1;
next	1.4.2.6;

1.4.2.6
date	2012.11.17.11.37.38;	author svnexp;	state Exp;
branches;
next	;

1.4.2.4.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.4.2.4.2.2;

1.4.2.4.2.2
date	2012.11.17.08.37.35;	author svnexp;	state Exp;
branches;
next	;

1.4.2.5.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.4.2.5.2.2;

1.4.2.5.2.2
date	2012.11.17.08.48.26;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.11
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251468
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@#	$NetBSD: Makefile,v 1.4 2011/02/16 01:31:33 joerg Exp $
#	$FreeBSD: head/usr.bin/grep/Makefile 251468 2013-06-06 11:59:38Z jkim $
#	$OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $

.include <bsd.own.mk>

.if ${MK_BSD_GREP} == "yes"
PROG=	grep
.else
PROG=	bsdgrep
CLEANFILES+= bsdgrep.1

bsdgrep.1: grep.1
	cp ${.ALLSRC} ${.TARGET}
.endif
SRCS=	file.c grep.c queue.c util.c

# Extra files ported backported form some regex improvements
.PATH: ${.CURDIR}/regex
SRCS+=	fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c xmalloc.c
CFLAGS+=-I${.CURDIR}/regex

.if ${MK_BSD_GREP} == "yes"
LINKS=	${BINDIR}/grep ${BINDIR}/egrep \
	${BINDIR}/grep ${BINDIR}/fgrep \
	${BINDIR}/grep ${BINDIR}/zgrep \
	${BINDIR}/grep ${BINDIR}/zegrep \
	${BINDIR}/grep ${BINDIR}/zfgrep

MLINKS= grep.1 egrep.1 \
	grep.1 fgrep.1 \
	grep.1 zgrep.1 \
	grep.1 zegrep.1 \
	grep.1 zfgrep.1 \
	grep.1 xzgrep.1 \
	grep.1 xzegrep.1 \
	grep.1 xzfgrep.1 \
	grep.1 lzgrep.1 \
	grep.1 lzegrep.1 \
	grep.1 lzfgrep.1
.endif

LDADD=	-lz
DPADD=	${LIBZ}

.if !defined(WITHOUT_LZMA_SUPPORT)
LDADD+=	-llzma
DPADD+=	${LIBLZMA}

LINKS+=	${BINDIR}/${PROG} ${BINDIR}/xzgrep \
	${BINDIR}/${PROG} ${BINDIR}/xzegrep \
	${BINDIR}/${PROG} ${BINDIR}/xzfgrep \
	${BINDIR}/${PROG} ${BINDIR}/lzgrep \
	${BINDIR}/${PROG} ${BINDIR}/lzegrep \
	${BINDIR}/${PROG} ${BINDIR}/lzfgrep
.else
CFLAGS+= -DWITHOUT_LZMA
.endif

.if !defined(WITHOUT_BZIP2_SUPPORT)
LDADD+=	-lbz2
DPADD+=	${LIBBZ2}

.if ${MK_BSD_GREP} == "yes"
LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \
	${BINDIR}/grep ${BINDIR}/bzegrep \
	${BINDIR}/grep ${BINDIR}/bzfgrep
MLINKS+= grep.1 bzgrep.1 \
	 grep.1 bzegrep.1 \
	 grep.1 bzfgrep.1
.endif
.else
CFLAGS+= -DWITHOUT_BZIP2
.endif

.if !defined(WITHOUT_GNU_COMPAT)
CFLAGS+= -I${DESTDIR}/usr/include/gnu
LDADD+=	-lgnuregex
DPADD+=	${LIBGNUREGEX}
.endif

.if !defined(WITHOUT_NLS)
.include "${.CURDIR}/nls/Makefile.inc"
.else
CFLAGS+= -DWITHOUT_NLS
.endif

.include <bsd.prog.mk>
@


1.10
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245171
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d2 1
a2 1
#	$FreeBSD: head/usr.bin/grep/Makefile 245171 2013-01-08 18:37:12Z obrien $
d77 1
a77 1
CFLAGS+= -I/usr/include/gnu
@


1.9
log
@Switching exporter and resync
@
text
@d2 1
a2 1
#	$FreeBSD: head/usr.bin/grep/Makefile 228099 2011-11-28 20:16:55Z gabor $
d43 7
d56 3
d60 1
a60 4
LDADD=	-lz -llzma
DPADD=	${LIBZ} ${LIBLZMA}

.if !defined(WITHOUT_BZIP2)
@


1.8
log
@SVN rev 228099 on 2011-11-28 20:16:55Z by gabor

- Create links to the xz and lzma versions even if BSD grep is not the
  default. Nor GNU nor liblzma in base provides such functionality so
  it may be useful.

MFC after:	3 days
@
text
@d2 1
a2 1
#	$FreeBSD$
@


1.7
log
@SVN rev 226664 on 2011-10-23 16:04:07Z by gabor

- Fix installation when WITH_BSD_GREP is set to yes

Submitted by:	Aleksandr Rybalko <ray@@ddteam.net>
@
text
@d28 1
a28 7
	${BINDIR}/grep ${BINDIR}/zfgrep \
	${BINDIR}/grep ${BINDIR}/xzgrep \
	${BINDIR}/grep ${BINDIR}/xzegrep \
	${BINDIR}/grep ${BINDIR}/xzfgrep \
	${BINDIR}/grep ${BINDIR}/lzgrep \
	${BINDIR}/grep ${BINDIR}/lzegrep \
	${BINDIR}/grep ${BINDIR}/lzfgrep
d43 7
@


1.6
log
@SVN rev 226271 on 2011-10-11 22:27:23Z by gabor

- Use getprogname() instead of __progname
- Allow disabling bzip2 support with WITHOUT_BZIP2
- Fix handling patterns that start with a dot
- Remove superfluous semicolon

Approved by:	delphij (mentor)
@
text
@d56 1
d63 1
@


1.5
log
@SVN rev 226035 on 2011-10-05 09:56:43Z by gabor

Update BSD grep to the latest development version.  It has some code
backported that was written for the TRE integration project in Google
Summer of Code 2011.  This is a temporary solution until the whole
regex library is not replaced so that BSD grep development can continue
and the backported code gets some review and testing.  This change only
improves scalability slightly, there is no big performance boost yet
but several minor bugs have been found and fixed.

Approved by:	delphij (mentor)
Sposored by:	Google Summer of Code 2011
MFC after:	1 week
@
text
@a28 3
	${BINDIR}/grep ${BINDIR}/bzgrep \
	${BINDIR}/grep ${BINDIR}/bzegrep \
	${BINDIR}/grep ${BINDIR}/bzfgrep \
a40 3
	grep.1 bzgrep.1 \
	grep.1 bzegrep.1 \
	grep.1 bzfgrep.1 \
d49 16
a64 2
LDADD=	-lz -lbz2 -llzma
DPADD=	${LIBZ} ${LIBBZ2} ${LIBLZMA}
@


1.4
log
@SVN rev 222772 on 2011-06-06 20:24:17Z by ed

Remove redundant assignments to WARNS.

For these directories, WARNS is already implied to be 6.
@
text
@d11 4
d16 6
a21 1
SRCS=	fastgrep.c file.c grep.c queue.c util.c
d28 10
a37 1
	${BINDIR}/grep ${BINDIR}/zfgrep
d43 10
a52 1
	grep.1 zfgrep.1
d55 2
a56 5
bsdgrep.1: grep.1
	cp ${.ALLSRC} ${.TARGET}

LDADD=	-lz -lbz2
DPADD=	${LIBZ} ${LIBBZ2}
@


1.4.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.4.2.2
log
@SVN rev 226261 on 2011-10-11 15:03:42Z by gabor

MFC 226035, 226047:

  Update BSD grep to the latest development version.  It has some code
  backported that was written for the TRE integration project in Google
  Summer of Code 2011.  This is a temporary solution until the whole
  regex library is not replaced so that BSD grep development can continue
  and the backported code gets some review and testing.  This change only
  improves scalability slightly, there is no big performance boost yet
  but several minor bugs have been found and fixed.

Approved by:	re (kib), delphij (mentor, implicit)
Sposored by:	Google Summer of Code 2011
@
text
@a10 4
CLEANFILES+= bsdgrep.1

bsdgrep.1: grep.1
	cp ${.ALLSRC} ${.TARGET}
d12 1
a12 6
SRCS=	file.c grep.c queue.c util.c

# Extra files ported backported form some regex improvements
.PATH: ${.CURDIR}/regex
SRCS+=	fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c xmalloc.c
CFLAGS+=-I${.CURDIR}/regex
d19 1
a19 10
	${BINDIR}/grep ${BINDIR}/zfgrep \
	${BINDIR}/grep ${BINDIR}/bzgrep \
	${BINDIR}/grep ${BINDIR}/bzegrep \
	${BINDIR}/grep ${BINDIR}/bzfgrep \
	${BINDIR}/grep ${BINDIR}/xzgrep \
	${BINDIR}/grep ${BINDIR}/xzegrep \
	${BINDIR}/grep ${BINDIR}/xzfgrep \
	${BINDIR}/grep ${BINDIR}/lzgrep \
	${BINDIR}/grep ${BINDIR}/lzegrep \
	${BINDIR}/grep ${BINDIR}/lzfgrep
d25 1
a25 10
	grep.1 zfgrep.1 \
	grep.1 bzgrep.1 \
	grep.1 bzegrep.1 \
	grep.1 bzfgrep.1 \
	grep.1 xzgrep.1 \
	grep.1 xzegrep.1 \
	grep.1 xzfgrep.1 \
	grep.1 lzgrep.1 \
	grep.1 lzegrep.1 \
	grep.1 lzfgrep.1
d28 5
a32 2
LDADD=	-lz -lbz2 -llzma
DPADD=	${LIBZ} ${LIBBZ2} ${LIBLZMA}
@


1.4.2.3
log
@SVN rev 226573 on 2011-10-20 16:08:11Z by gabor

MFC r226432, r226273:
  - Use getprogname() instead of __progname
  - Allow disabling bzip2 support with WITHOUT_BZIP2
  - Fix handling patterns that start with a dot
  - Remove superfluous semicolon
  - Fix counting of match limit (-m)

Approved by:	re (kib), delphij (mentor, implicit)
@
text
@d29 3
d44 3
d55 2
a56 16
LDADD=	-lz -llzma
DPADD=	${LIBZ} ${LIBLZMA}

.if !defined(WITHOUT_BZIP2)
LDADD+=	-lbz2
DPADD+=	${LIBBZ2}

LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \
	${BINDIR}/grep ${BINDIR}/bzegrep \
	${BINDIR}/grep ${BINDIR}/bzfgrep
MLINKS+= grep.1 bzgrep.1 \
	 grep.1 bzegrep.1 \
	 grep.1 bzfgrep.1
.else
CFLAGS+= -DWITHOUT_BZIP2
.endif
@


1.4.2.4
log
@SVN rev 226853 on 2011-10-27 19:18:54Z by gabor

MFC r226664:
- Install BSD grep properly, based on the value of WITH_BSD_GREP

Approved by:	re (kib)
@
text
@a55 1
.if ${MK_BSD_GREP} == "yes"
a61 1
.endif
@


1.4.2.5
log
@SVN rev 229081 on 2011-12-31 13:12:10Z by gabor

MFC r228099:
  - Create links to the xz and lzma versions even if BSD grep is not the
    default. Nor GNU nor liblzma in base provides such functionality so
    it may be useful.

MFC r228319:
  - Match GNU behavior of exit code
  - Rename variable that has a different meaning now
@
text
@d28 7
a34 1
	${BINDIR}/grep ${BINDIR}/zfgrep
a48 7
LINKS+=	${BINDIR}/${PROG} ${BINDIR}/xzgrep \
	${BINDIR}/${PROG} ${BINDIR}/xzegrep \
	${BINDIR}/${PROG} ${BINDIR}/xzfgrep \
	${BINDIR}/${PROG} ${BINDIR}/lzgrep \
	${BINDIR}/${PROG} ${BINDIR}/lzegrep \
	${BINDIR}/${PROG} ${BINDIR}/lzfgrep

@


1.4.2.6
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
#	$FreeBSD: stable/9/usr.bin/grep/Makefile 229081 2011-12-31 13:12:10Z gabor $
@


1.4.2.5.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.4.2.5.2.2
log
@Switch importer
@
text
@d2 1
a2 1
#	$FreeBSD: releng/9.1/usr.bin/grep/Makefile 229081 2011-12-31 13:12:10Z gabor $
@


1.4.2.4.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.4.2.4.2.2
log
@Switch importer
@
text
@d2 1
a2 1
#	$FreeBSD: releng/9.0/usr.bin/grep/Makefile 226853 2011-10-27 19:18:54Z gabor $
@


1.3
log
@SVN rev 222273 on 2011-05-25 01:04:12Z by obrien

Build and install a BSD licensed grep.
If WITH_BSD_GREP is not set, it will be 'bsdgrep' and GNUgrep will be
'[ef]grep'.  Otherwise, BSD-grep will be the grep family, and GNUgrep
will be 'gnugrep'.

Discussed with: brooks
@
text
@a30 2
WARNS?=	6

@


1.2
log
@SVN rev 220422 on 2011-04-07 13:03:35Z by gabor

- Adjust a comment to actual behaviour
- Makefile nit
- Add more CVS/SVN keywords to make it easier to track changes from NetBSD
  in case they add further improvements

Approved by:	delphij (mentor)
Obtained from:	The NetBSD Project
@
text
@d5 3
d9 3
d14 1
d26 4
@


1.1
log
@SVN rev 210389 on 2010-07-22 19:11:57Z by gabor

Add BSD grep to the base system and make it our default grep.

Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC),
              lower memory usage than GNU grep, GNU compatibility,
              BSD license.

TODO:         Performance is somewhat behind GNU grep but it is only
              significant for bigger searches.  The reason is complex, the
              most important factor is that GNU grep uses lots of
              optimizations to improve the speed of the regex library.
              First, we need a modern regex library (practically by adopting
              TRE), add support for GNU-style non-standard regexes and then
              reevalute the performance issues and look for bottlenecks.  In
              the meantime, for those, who need better performance, it is
              possible to build GNU grep by setting WITH_GNU_GREP.

Approved by:            delphij (mentor)
Obtained from:          OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/),
                        freegrep (http://github.com/howardjp/freegrep)
Sponsored by:           Google SoC 2008
Portbuild tests run by: kris, pav, erwin
Acknowledgements to:    fjoe (as SoC 2008 mentor),
                        everyone who helped in reviewing and testing
@
text
@d1 1
d7 1
d12 1
a12 1
	${BINDIR}/grep ${BINDIR}/zfgrep \
@

