From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 2 08:04:40 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67558FCD; Mon, 2 Feb 2015 08:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483C8D34; Mon, 2 Feb 2015 08:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1284e1t017885; Mon, 2 Feb 2015 08:04:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1284dmu017879; Mon, 2 Feb 2015 08:04:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502020804.t1284dmu017879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 2 Feb 2015 08:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r278062 - in stable/9: tools/build/make_check tools/build/options usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 08:04:40 -0000 Author: ngie Date: Mon Feb 2 08:04:38 2015 New Revision: 278062 URL: https://svnweb.freebsd.org/changeset/base/278062 Log: MFC r228099,r245171,r277939: 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. r245171: 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 r277939: Create MANLINKS for lzgrep, etc when MK_LZMA_SUPPORT != no Sponsored by: EMC / Isilon Storage Division Added: stable/9/tools/build/options/WITHOUT_LZMA_SUPPORT - copied unchanged from r245171, head/tools/build/options/WITHOUT_LZMA_SUPPORT Modified: stable/9/tools/build/make_check/Makefile stable/9/usr.bin/grep/Makefile stable/9/usr.bin/grep/file.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) stable/9/tools/build/options/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/grep/ (props changed) Modified: stable/9/tools/build/make_check/Makefile ============================================================================== --- stable/9/tools/build/make_check/Makefile Mon Feb 2 08:01:10 2015 (r278061) +++ stable/9/tools/build/make_check/Makefile Mon Feb 2 08:04:38 2015 (r278062) @@ -24,7 +24,7 @@ SMAKE= MAKEFLAGS= ${MAKE} -C ${.CURDIR} all: @echo '1..17' - @${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: stable/9/tools/build/options/WITHOUT_LZMA_SUPPORT (from r245171, head/tools/build/options/WITHOUT_LZMA_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITHOUT_LZMA_SUPPORT Mon Feb 2 08:04:38 2015 (r278062, copy of r245171, head/tools/build/options/WITHOUT_LZMA_SUPPORT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build some programs without optional lzma compression support. Modified: stable/9/usr.bin/grep/Makefile ============================================================================== --- stable/9/usr.bin/grep/Makefile Mon Feb 2 08:01:10 2015 (r278061) +++ stable/9/usr.bin/grep/Makefile Mon Feb 2 08:04:38 2015 (r278062) @@ -31,15 +31,16 @@ 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 + grep.1 zfgrep.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 \ @@ -47,10 +48,17 @@ LINKS+= ${BINDIR}/${PROG} ${BINDIR}/xzgr ${BINDIR}/${PROG} ${BINDIR}/lzegrep \ ${BINDIR}/${PROG} ${BINDIR}/lzfgrep -LDADD= -lz -llzma -DPADD= ${LIBZ} ${LIBLZMA} +MLINKS+= grep.1 xzgrep.1 \ + grep.1 xzegrep.1 \ + grep.1 xzfgrep.1 \ + grep.1 lzgrep.1 \ + grep.1 lzegrep.1 \ + grep.1 lzfgrep.1 +.else +CFLAGS+= -DWITHOUT_LZMA +.endif -.if !defined(WITHOUT_BZIP2) +.if !defined(WITHOUT_BZIP2_SUPPORT) LDADD+= -lbz2 DPADD+= ${LIBBZ2} Modified: stable/9/usr.bin/grep/file.c ============================================================================== --- stable/9/usr.bin/grep/file.c Mon Feb 2 08:01:10 2015 (r278061) +++ stable/9/usr.bin/grep/file.c Mon Feb 2 08:04:38 2015 (r278062) @@ -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);