summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-05-29 21:56:38 +0000
committersobomax <sobomax@FreeBSD.org>2005-05-29 21:56:38 +0000
commiteb9b77e827444a8bfd2e0580489e73b02fe751e8 (patch)
treeb2d4afca03b74bbefeee45484453f9cdfd78d2d7
parent404d37a14dc9215307de2ad21dd3a38744d3ccf5 (diff)
downloadFreeBSD-src-eb9b77e827444a8bfd2e0580489e73b02fe751e8.zip
FreeBSD-src-eb9b77e827444a8bfd2e0580489e73b02fe751e8.tar.gz
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.
-rw-r--r--contrib/bzip2/bzlib.c9
-rw-r--r--lib/libstand/Makefile23
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"|' \
OpenPOWER on IntegriCloud