From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 18:37:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6D6E380; Tue, 8 Jan 2013 18:37:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8CAF2C3; Tue, 8 Jan 2013 18:37:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08IbDa9062420; Tue, 8 Jan 2013 18:37:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08IbCwq062414; Tue, 8 Jan 2013 18:37:12 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201301081837.r08IbCwq062414@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 8 Jan 2013 18:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245171 - in head: tools/build/make_check tools/build/options usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 08 Jan 2013 18:37:13 -0000 Author: obrien Date: Tue Jan 8 18:37:12 2013 New Revision: 245171 URL: http://svnweb.freebsd.org/changeset/base/245171 Log: Following r226271, allow disabling lzma support with "WITHOUT_LZMA_SUPPORT". Correct r226271 which should have used WITHOUT_BZIP2_SUPPORT per r166255. Obtained from: Juniper Networks Added: head/tools/build/options/WITHOUT_LZMA_SUPPORT - copied, changed from r245170, head/tools/build/options/WITHOUT_BZIP2_SUPPORT Modified: head/tools/build/make_check/Makefile head/usr.bin/grep/Makefile head/usr.bin/grep/file.c Modified: head/tools/build/make_check/Makefile ============================================================================== --- head/tools/build/make_check/Makefile Tue Jan 8 17:42:03 2013 (r245170) +++ head/tools/build/make_check/Makefile Tue Jan 8 18:37:12 2013 (r245171) @@ -24,7 +24,7 @@ SMAKE= MAKEFLAGS= ${MAKE} -C ${.CURDIR} all: @echo '1..16' - @${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; } + @${SMAKE} C_check || { ${MAKE} -C ${.CURDIR} failure ; } @echo "ok 1 - C_check # Test of -C flag existence detected no regression." @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ diff -u ${.CURDIR}/regress.variables.out - || \ Copied and modified: head/tools/build/options/WITHOUT_LZMA_SUPPORT (from r245170, head/tools/build/options/WITHOUT_BZIP2_SUPPORT) ============================================================================== --- head/tools/build/options/WITHOUT_BZIP2_SUPPORT Tue Jan 8 17:42:03 2013 (r245170, copy source) +++ head/tools/build/options/WITHOUT_LZMA_SUPPORT Tue Jan 8 18:37:12 2013 (r245171) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to build some programs without optional bzip2 support. +Set to build some programs without optional lzma compression support. Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue Jan 8 17:42:03 2013 (r245170) +++ head/usr.bin/grep/Makefile Tue Jan 8 18:37:12 2013 (r245171) @@ -40,17 +40,24 @@ MLINKS= grep.1 egrep.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 -LDADD= -lz -llzma -DPADD= ${LIBZ} ${LIBLZMA} - -.if !defined(WITHOUT_BZIP2) +.if !defined(WITHOUT_BZIP2_SUPPORT) LDADD+= -lbz2 DPADD+= ${LIBBZ2} Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Tue Jan 8 17:42:03 2013 (r245170) +++ head/usr.bin/grep/file.c Tue Jan 8 18:37:12 2013 (r245171) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -50,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_LZMA +#include +#endif + #ifndef WITHOUT_BZIP2 #include #endif @@ -60,7 +63,9 @@ __FBSDID("$FreeBSD$"); #define LNBUFBUMP 80 static gzFile gzbufdesc; +#ifndef WITHOUT_LZMA static lzma_stream lstrm = LZMA_STREAM_INIT; +#endif #ifndef WITHOUT_BZIP2 static BZFILE* bzbufdesc; #endif @@ -116,6 +121,7 @@ grep_refill(struct file *f) nr = -1; } #endif +#ifndef WITHOUT_LZMA } else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { lzma_action action = LZMA_RUN; uint8_t in_buf[MAXBUFSIZ]; @@ -146,6 +152,7 @@ grep_refill(struct file *f) return (-1); bufrem = MAXBUFSIZ - lstrm.avail_out; return (0); +#endif /* WIHTOUT_LZMA */ } else nr = read(f->fd, buffer, MAXBUFSIZ);