Make bzip2 support working again after bzip2 upgrade. This time commit
BZ_NO_COMPRESS support to the bzip2 sources directly (yes, this takes file off the vendor branch, but looks like bzip2 maintainer doesn't care), so that it will not be removed when the next upgrade is performed. Also, add a short note on how to test bzip2 support. Pointy hat to: obrien Correct comment (libz -> libbz2) and remove useless full path to zutil.h while I am here.
This commit is contained in:
parent
404d37a14d
commit
eb9b77e827
@ -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 ---*/
|
||||
|
@ -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"|' \
|
||||
|
Loading…
x
Reference in New Issue
Block a user