diff options
-rw-r--r-- | contrib/bzip2/bzlib.c | 9 | ||||
-rw-r--r-- | lib/libstand/Makefile | 23 |
2 files changed, 28 insertions, 4 deletions
diff --git a/contrib/bzip2/bzlib.c b/contrib/bzip2/bzlib.c index e9c1e87..f365acd 100644 --- a/contrib/bzip2/bzlib.c +++ b/contrib/bzip2/bzlib.c @@ -73,8 +73,12 @@ bzBuffToBuffDecompress. Fixed. --*/ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include "bzlib_private.h" +#ifndef BZ_NO_COMPRESS /*---------------------------------------------------*/ /*--- Compression stuff ---*/ @@ -130,6 +134,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) } #endif +#endif /* BZ_NO_COMPRESS */ /*---------------------------------------------------*/ static @@ -156,6 +161,7 @@ void default_bzfree ( void* opaque, void* addr ) if (addr != NULL) free ( addr ); } +#ifndef BZ_NO_COMPRESS /*---------------------------------------------------*/ static @@ -528,6 +534,7 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) return BZ_OK; } +#endif /* BZ_NO_COMPRESS */ /*---------------------------------------------------*/ /*--- Decompression stuff ---*/ @@ -921,6 +928,7 @@ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) return BZ_OK; } +#ifndef BZ_NO_COMPRESS #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ @@ -1610,6 +1618,7 @@ const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) } #endif +#endif /* BZ_NO_COMPRESS */ /*-------------------------------------------------------------*/ /*--- end bzlib.c ---*/ diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 9fe1d39..f95a43a 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -127,10 +127,25 @@ SRCS+= syncicache.c .endif SRCS+= _setjmp.S -# decompression functionality from libz +# decompression functionality from libbz2 +# NOTE: to actually test this functionality after libbz2 upgrade compile +# loader(8) with LOADER_BZIP2_SUPPORT defined .PATH: ${.CURDIR}/../../contrib/bzip2 -CFLAGS+= -DBZ_NO_STDIO -I${.CURDIR}/../../contrib/bzip2 -SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c +CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS -I${.CURDIR}/../../contrib/bzip2 +SRCS+= libstand_bzlib_private.h + +.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} +.endfor + +CLEANFILES+= libstand_bzlib_private.h +libstand_bzlib_private.h: bzlib_private.h + sed -e 's|<stdlib.h>|"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} # decompression functionality from libz .PATH: ${.CURDIR}/../libz @@ -147,7 +162,7 @@ _${file}: ${file} # depend on stand.h being able to be included multiple times CLEANFILES+= libstand_zutil.h -libstand_zutil.h: ${.CURDIR}/../libz/zutil.h +libstand_zutil.h: zutil.h sed -e 's|<stddef.h>|"stand.h"|' \ -e 's|<string.h>|"stand.h"|' \ -e 's|<stdlib.h>|"stand.h"|' \ |