summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-02-01 16:33:40 +0000
committersobomax <sobomax@FreeBSD.org>2002-02-01 16:33:40 +0000
commit539011fe16de0fa4f5b918d9880bbadde16a466f (patch)
tree65d0cce39d6af5cb87b36d7af78387c3e03b447f /lib/libstand
parentec6d600e40c8e9c2a5538cf793956c2b074b1af4 (diff)
downloadFreeBSD-src-539011fe16de0fa4f5b918d9880bbadde16a466f.zip
FreeBSD-src-539011fe16de0fa4f5b918d9880bbadde16a466f.tar.gz
Complete bzip2-1.0.2 import.
MFC in: 14 days
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/Makefile22
-rw-r--r--lib/libstand/bzipfs.c2
-rw-r--r--lib/libstand/bzlib.c.diff21
-rw-r--r--lib/libstand/bzlib.h.diff15
-rw-r--r--lib/libstand/bzlib_private.h.diff13
5 files changed, 58 insertions, 15 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 84f4baf..962e739 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 88b7940..5dd6fab 100644
--- a/lib/libstand/bzipfs.c
+++ b/lib/libstand/bzipfs.c
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <string.h>
-#include <bzlib.h>
+#include <_bzlib.h>
#define BZ_BUFSIZE 2048 /* XXX larger? */
diff --git a/lib/libstand/bzlib.c.diff b/lib/libstand/bzlib.c.diff
index f13482b..cbc800d 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 0000000..ef6c4da
--- /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 <stdio.h>
++#endif
+
+ #ifdef _WIN32
+ # include <windows.h>
diff --git a/lib/libstand/bzlib_private.h.diff b/lib/libstand/bzlib_private.h.diff
new file mode 100644
index 0000000..240eb8e
--- /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 <string.h>
+ #endif
+
+-#include "bzlib.h"
++#include "_bzlib.h"
+
+
+
OpenPOWER on IntegriCloud