From d8d77baac2714febf36f4ac37afccbbbdcdc8857 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 22 May 2020 23:34:50 +0200 Subject: [PATCH] libstand: Apply our bzlib.c patch to master. All it does is to add #ifdefs to compile decompression support only. While here, remove some unneeded headers from SRCS. --- contrib/bzip2/README.DRAGONFLY | 5 +++ contrib/bzip2/bzlib.c | 6 ++++ lib/libstand/Makefile | 11 +------ lib/libstand/bzlib.c.diff | 56 ---------------------------------- 4 files changed, 12 insertions(+), 66 deletions(-) delete mode 100644 lib/libstand/bzlib.c.diff diff --git a/contrib/bzip2/README.DRAGONFLY b/contrib/bzip2/README.DRAGONFLY index 0a6d905a95..b210534122 100644 --- a/contrib/bzip2/README.DRAGONFLY +++ b/contrib/bzip2/README.DRAGONFLY @@ -11,6 +11,11 @@ sha1 = bf7badf7e248e0ecf465d33c2f5aeec774209227 The file README.DELETED contains a list of deleted files. +The following files have been patched: +====================================== + + modified: bzlib.c + This is used by: lib/libbz2/ lib/libstand/ diff --git a/contrib/bzip2/bzlib.c b/contrib/bzip2/bzlib.c index 21786551b6..2574a87b29 100644 --- a/contrib/bzip2/bzlib.c +++ b/contrib/bzip2/bzlib.c @@ -30,6 +30,7 @@ #include "bzlib_private.h" +#ifndef BZ_NO_COMPRESS /*---------------------------------------------------*/ /*--- Compression stuff ---*/ @@ -85,6 +86,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) } #endif +#endif /* BZ_NO_COMPRESS */ /*---------------------------------------------------*/ static @@ -111,6 +113,7 @@ void default_bzfree ( void* opaque, void* addr ) if (addr != NULL) free ( addr ); } +#ifndef BZ_NO_COMPRESS /*---------------------------------------------------*/ static @@ -483,6 +486,7 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) return BZ_OK; } +#endif /* BZ_NO_COMPRESS */ /*---------------------------------------------------*/ /*--- Decompression stuff ---*/ @@ -877,6 +881,7 @@ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) return BZ_OK; } +#ifndef BZ_NO_COMPRESS #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ @@ -1566,6 +1571,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 6d3a1a67de..90ae9ee82d 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -90,16 +90,7 @@ SRCS+= icrc32.c BZ2DIR= ${LIBSTAND_SRC}/../../contrib/bzip2 .PATH: ${BZ2DIR} CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \ - bzlib_private.h - -# check your belt - ugly bzip2 stuff ahead -.for file in bzlib.c -CLEANFILES+= ${file} - -${file}: ${BZ2DIR}/${file} ${file}.diff - patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]} -.endfor +SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c # io routines SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ diff --git a/lib/libstand/bzlib.c.diff b/lib/libstand/bzlib.c.diff deleted file mode 100644 index 803ab15871..0000000000 --- a/lib/libstand/bzlib.c.diff +++ /dev/null @@ -1,56 +0,0 @@ -$FreeBSD: src/lib/libstand/bzlib.c.diff,v 1.1.2.2 2002/02/18 09:13:03 sobomax Exp $ -$DragonFly: src/lib/libstand/bzlib.c.diff,v 1.3 2005/06/30 15:55:17 corecode Exp $ - -A patch to avoid linking into libstand compression routines from the bzip2 -that never being used anyway, while bloat loader(8) by additional 15KB. - ---- ../../contrib/bzip2-1.0/bzlib.c 2005-02-15 17:24:58.000000000 +0100 -+++ bzlib.c 2005-06-30 17:45:31.000000000 +0200 -@@ -75,6 +75,7 @@ - - #include "bzlib_private.h" - -+#ifndef BZ_NO_COMPRESS - - /*---------------------------------------------------*/ - /*--- Compression stuff ---*/ -@@ -130,6 +131,7 @@ - } - #endif - -+#endif /* BZ_NO_COMPRESS */ - - /*---------------------------------------------------*/ - static -@@ -156,6 +158,7 @@ - if (addr != NULL) free ( addr ); - } - -+#ifndef BZ_NO_COMPRESS - - /*---------------------------------------------------*/ - static -@@ -528,6 +531,7 @@ - return BZ_OK; - } - -+#endif /* BZ_NO_COMPRESS */ - - /*---------------------------------------------------*/ - /*--- Decompression stuff ---*/ -@@ -921,6 +925,7 @@ - return BZ_OK; - } - -+#ifndef BZ_NO_COMPRESS - - #ifndef BZ_NO_STDIO - /*---------------------------------------------------*/ -@@ -1610,6 +1615,7 @@ - } - #endif - -+#endif /* BZ_NO_COMPRESS */ - - /*-------------------------------------------------------------*/ - /*--- end bzlib.c ---*/ -- 2.41.0