From owner-svn-src-head@FreeBSD.ORG Wed May 25 01:04:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5590B1065670; Wed, 25 May 2011 01:04:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE4F8FC14; Wed, 25 May 2011 01:04:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4P14DXA092754; Wed, 25 May 2011 01:04:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4P14DLb092748; Wed, 25 May 2011 01:04:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201105250104.p4P14DLb092748@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 25 May 2011 01:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222273 - in head: gnu/usr.bin gnu/usr.bin/grep tools/build/options usr.bin usr.bin/grep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 01:04:13 -0000 Author: obrien Date: Wed May 25 01:04:12 2011 New Revision: 222273 URL: http://svn.freebsd.org/changeset/base/222273 Log: 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 Modified: head/gnu/usr.bin/Makefile head/gnu/usr.bin/grep/Makefile head/tools/build/options/WITH_BSD_GREP head/usr.bin/Makefile head/usr.bin/grep/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Wed May 25 00:34:25 2011 (r222272) +++ head/gnu/usr.bin/Makefile Wed May 25 01:04:12 2011 (r222273) @@ -27,9 +27,7 @@ _groff= groff .endif .endif -.if ${MK_BSD_GREP} != "yes" _grep= grep -.endif .if ${MK_CVS} != "no" _cvs= cvs Modified: head/gnu/usr.bin/grep/Makefile ============================================================================== --- head/gnu/usr.bin/grep/Makefile Wed May 25 00:34:25 2011 (r222272) +++ head/gnu/usr.bin/grep/Makefile Wed May 25 01:04:12 2011 (r222273) @@ -1,35 +1,50 @@ # $FreeBSD$ +.include + GREP_LIBZ=YES +.if ${MK_BSD_GREP} != "yes" PROG= grep +.else +PROG= gnugrep +.endif SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \ isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \ xstrtoumax.c CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H +.if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/fgrep MLINKS= grep.1 egrep.1 grep.1 fgrep.1 +.endif DPADD= ${LIBGNUREGEX} ${LIBBZ2} LDADD= -lgnuregex -lbz2 +.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 .if defined(GREP_LIBZ) && !empty(GREP_LIBZ) LDADD+= -lz DPADD+= ${LIBZ} CFLAGS+=-DHAVE_LIBZ=1 +.if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \ ${BINDIR}/grep ${BINDIR}/zegrep \ ${BINDIR}/grep ${BINDIR}/zfgrep MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1 .endif +.endif + +gnugrep.1: grep.1 + cp ${.ALLSRC} ${.TARGET} SUBDIR+=doc Modified: head/tools/build/options/WITH_BSD_GREP ============================================================================== --- head/tools/build/options/WITH_BSD_GREP Wed May 25 00:34:25 2011 (r222272) +++ head/tools/build/options/WITH_BSD_GREP Wed May 25 01:04:12 2011 (r222273) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Build BSD-licensed grep instead of GNU grep. +Install BSD-licensed grep as '[ef]grep' instead of GNU grep. Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed May 25 00:34:25 2011 (r222272) +++ head/usr.bin/Makefile Wed May 25 01:04:12 2011 (r222273) @@ -57,7 +57,7 @@ SUBDIR= alias \ getconf \ getent \ getopt \ - ${_grep} \ + grep \ gzip \ head \ hexdump \ @@ -227,10 +227,6 @@ SUBDIR+= bluetooth SUBDIR+= cpio .endif -.if ${MK_BSD_GREP} != "no" -_grep= grep -.endif - .if ${MK_CALENDAR} != "no" SUBDIR+= calendar .endif Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Wed May 25 00:34:25 2011 (r222272) +++ head/usr.bin/grep/Makefile Wed May 25 01:04:12 2011 (r222273) @@ -2,9 +2,16 @@ # $FreeBSD$ # $OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $ +.include + +.if ${MK_BSD_GREP} == "yes" PROG= grep +.else +PROG= bsdgrep +.endif SRCS= fastgrep.c file.c grep.c queue.c util.c +.if ${MK_BSD_GREP} == "yes" LINKS= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/fgrep \ ${BINDIR}/grep ${BINDIR}/zgrep \ @@ -16,6 +23,10 @@ MLINKS= grep.1 egrep.1 \ grep.1 zgrep.1 \ grep.1 zegrep.1 \ grep.1 zfgrep.1 +.endif + +bsdgrep.1: grep.1 + cp ${.ALLSRC} ${.TARGET} WARNS?= 6