diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 84f4baf4256d..962e7397dd47 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -116,12 +116,24 @@ SRCS+= _setjmp.S # decompression functionality from libbz2 .PATH: ${.CURDIR}/../../contrib/bzip2 -CFLAGS+=-I${.CURDIR}/../../contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= _bzlib.c crctable.c decompress.c huffman.c randtable.c -CLEANFILES+= _bzlib.c _bzlib.c.orig +CFLAGS+=-I${.CURDIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \ + _bzlib_private.h -_bzlib.c: bzlib.c bzlib.c.diff - patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.c} +# check your belt - ugly bzip2 stuff ahead +.for file in bzlib.c bzlib.h bzlib_private.h +CLEANFILES+= _${file} _${file}.orig + +_${file}: ${file} ${file}.diff + patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]} +.endfor + +.for file in crctable.c decompress.c huffman.c randtable.c +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} +.endfor # decompression functionality from libz .PATH: ${.CURDIR}/../libz diff --git a/lib/libstand/bzipfs.c b/lib/libstand/bzipfs.c index 88b7940924a0..5dd6fabe4c2c 100644 --- a/lib/libstand/bzipfs.c +++ b/lib/libstand/bzipfs.c @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include <_bzlib.h> #define BZ_BUFSIZE 2048 /* XXX larger? */ diff --git a/lib/libstand/bzlib.c.diff b/lib/libstand/bzlib.c.diff index f13482be110b..cbc800d9d5da 100644 --- a/lib/libstand/bzlib.c.diff +++ b/lib/libstand/bzlib.c.diff @@ -3,17 +3,20 @@ $FreeBSD$ A patch to avoid linking into libstand compression routines from the bzip2 that never being used anyway, while bloat loader(8) by additional 15KB. ---- _bzlib.c 2001/09/13 12:20:50 1.1 -+++ _bzlib.c 2001/09/13 12:29:24 -@@ -75,6 +75,7 @@ +--- _bzlib.c 2001/09/13 12:20:50 1.1 ++++ _bzlib.c 2001/09/13 12:29:24 +@@ -73,8 +73,9 @@ + bzBuffToBuffDecompress. Fixed. + --*/ - #include "bzlib_private.h" +-#include "bzlib_private.h" ++#include "_bzlib_private.h" +#ifndef BZ_NO_COMPRESS /*---------------------------------------------------*/ /*--- Compression stuff ---*/ -@@ -101,6 +102,7 @@ +@@ -130,6 +131,7 @@ } #endif @@ -21,7 +24,7 @@ that never being used anyway, while bloat loader(8) by additional 15KB. /*---------------------------------------------------*/ static -@@ -127,6 +128,7 @@ +@@ -156,6 +158,7 @@ if (addr != NULL) free ( addr ); } @@ -29,7 +32,7 @@ that never being used anyway, while bloat loader(8) by additional 15KB. /*---------------------------------------------------*/ static -@@ -499,6 +501,7 @@ +@@ -528,6 +531,7 @@ return BZ_OK; } @@ -37,7 +40,7 @@ that never being used anyway, while bloat loader(8) by additional 15KB. /*---------------------------------------------------*/ /*--- Decompression stuff ---*/ -@@ -869,6 +869,7 @@ +@@ -898,6 +902,7 @@ return BZ_OK; } @@ -45,7 +48,7 @@ that never being used anyway, while bloat loader(8) by additional 15KB. #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ -@@ -1558,6 +1559,7 @@ +@@ -1587,6 +1592,7 @@ } #endif diff --git a/lib/libstand/bzlib.h.diff b/lib/libstand/bzlib.h.diff new file mode 100644 index 000000000000..ef6c4da16f49 --- /dev/null +++ b/lib/libstand/bzlib.h.diff @@ -0,0 +1,15 @@ +$FreeBSD$ + +--- bzlib.h 2002/02/01 15:20:44 1.1 ++++ bzlib.h 2002/02/01 15:20:49 +@@ -110,8 +110,10 @@ + #define BZ_EXPORT + #endif + ++#ifndef BZ_NO_STDIO + /* Need a definitition for FILE */ + #include ++#endif + + #ifdef _WIN32 + # include diff --git a/lib/libstand/bzlib_private.h.diff b/lib/libstand/bzlib_private.h.diff new file mode 100644 index 000000000000..240eb8e56895 --- /dev/null +++ b/lib/libstand/bzlib_private.h.diff @@ -0,0 +1,13 @@ +$FreeBSD$ + +--- bzlib_private.h 2002/02/01 15:41:26 1.1 ++++ bzlib_private.h 2002/02/01 15:41:46 +@@ -70,7 +70,7 @@ + #include + #endif + +-#include "bzlib.h" ++#include "_bzlib.h" + + + diff --git a/usr.bin/bzip2/doc/Makefile b/usr.bin/bzip2/doc/Makefile index f2cd6b431db3..1da51edc5cea 100644 --- a/usr.bin/bzip2/doc/Makefile +++ b/usr.bin/bzip2/doc/Makefile @@ -6,9 +6,9 @@ INFO= bzip2 INFOSECTION= "Programming & development tools." MAKEINFOFLAGS= --no-validate -CLEANFILES+= bzip2.texi +CLEANFILES+= bzip2.texi bzip2.texi.orig -bzip2.texi: manual.texi - ln -sf ${.ALLSRC} ${.TARGET} +bzip2.texi: manual.texi manual.texi.diff + patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.texi} .include diff --git a/usr.bin/bzip2/doc/manual.texi.diff b/usr.bin/bzip2/doc/manual.texi.diff new file mode 100644 index 000000000000..0c14f6307b58 --- /dev/null +++ b/usr.bin/bzip2/doc/manual.texi.diff @@ -0,0 +1,22 @@ +$FreeBSD$ + +--- manual.texi 2002/02/01 16:00:45 1.1 ++++ manual.texi 2002/02/01 16:01:11 +@@ -46,8 +46,6 @@ + find it identical to that contained in the file LICENSE in the + source distribution. + +-@bf{------------------ START OF THE LICENSE ------------------} +- + This program, @code{bzip2}, + and associated library @code{libbzip2}, are + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. +@@ -89,8 +87,6 @@ + @code{jseward@@acm.org} + + @code{bzip2}/@code{libbzip2} version 1.0.2 of 30 December 2001. +- +-@bf{------------------ END OF THE LICENSE ------------------} + + Web sites: +