--- /dev/null +++ bzip2/Makefile.am @@ -0,0 +1,43 @@ +AUTOMAKE_OPTIONS = 1.4 foreign + +lib_LTLIBRARIES = libbz2.la +bin_PROGRAMS = bzip2 bzip2recover +bin_SCRIPTS = bzdiff bzgrep bzmore + +bzip2_SOURCES = bzip2.c +bzip2_LDADD = libbz2.la + +bzip2recover_SOURCES = bzip2recover.c + +include_HEADERS = bzlib.h +man_MANS = bzdiff.1 bzgrep.1 bzip2.1 bzmore.1 +info_TEXINFOS = bzip2.texi + +libbz2_la_SOURCES = \ + blocksort.c \ + huffman.c \ + crctable.c \ + randtable.c \ + compress.c \ + decompress.c \ + bzlib.c +libbz2_la_LDFLAGS = -version-info 1:6:0 + +check-local: samples.sh bzip2 + ./samples.sh + +install-exec-hook: + $(LN_S) bzip2 $(DESTDIR)$(bindir)/bunzip2 + $(LN_S) bzip2 $(DESTDIR)$(bindir)/bzcat + $(LN_S) bzdiff $(DESTDIR)$(bindir)/bzcmp + $(LN_S) bzgrep $(DESTDIR)$(bindir)/bzegrep + $(LN_S) bzgrep $(DESTDIR)$(bindir)/bzfgrep + $(LN_S) bzmore $(DESTDIR)$(bindir)/bzless + +install-data-hook: + echo '.so man1/bzip2.1' >$(DESTDIR)$(mandir)/man1/bunzip2.1 + echo '.so man1/bzip2.1' >$(DESTDIR)$(mandir)/man1/bzcat.1 + echo '.so man1/bzdiff.1' >$(DESTDIR)$(mandir)/man1/bzcmp.1 + echo '.so man1/bzgrep.1' >$(DESTDIR)$(mandir)/man1/bzegrep.1 + echo '.so man1/bzgrep.1' >$(DESTDIR)$(mandir)/man1/bzfgrep.1 + echo '.so man1/bzmore.1' >$(DESTDIR)$(mandir)/man1/bzless.1 --- bzip2/bzip2.c +++ bzip2/bzip2.c @@ -47,6 +47,10 @@ Some stuff for all platforms. --*/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include --- bzip2/bzip2recover.c +++ bzip2/bzip2recover.c @@ -20,6 +20,10 @@ /* This program is a complete hack and should be rewritten properly. It isn't very complicated. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include --- bzip2/bzlib_private.h +++ bzip2/bzlib_private.h @@ -22,6 +22,10 @@ #ifndef _BZLIB_PRIVATE_H #define _BZLIB_PRIVATE_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include #ifndef BZ_NO_STDIO --- /dev/null +++ bzip2/configure.ac @@ -0,0 +1,18 @@ +AC_PREREQ(2.53) +AC_INIT([bzip2],[1.0.6],[Julian Seward ]) +AC_CONFIG_SRCDIR([bzlib.c]) +AM_CONFIG_HEADER([config.h]) + +AC_GNU_SOURCE +AC_CANONICAL_SYSTEM +AC_PROG_LIBTOOL +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +AC_PROG_CC +AC_SYS_LARGEFILE + +AC_PROG_INSTALL +AC_PROG_LN_S + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT --- bzip2/dlltest.c +++ bzip2/dlltest.c @@ -7,6 +7,10 @@ usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename] */ +#ifdef HAVE_CONFIG_H +#include +#endif + #define BZ_IMPORT #include #include --- bzip2/mk251.c +++ bzip2/mk251.c @@ -20,6 +20,10 @@ ------------------------------------------------------------------ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include int main () --- /dev/null +++ bzip2/samples.sh @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +cat words1 +./bzip2 -1 < sample1.ref > sample1.rb2 && cmp sample1.bz2 sample1.rb2 +./bzip2 -2 < sample2.ref > sample2.rb2 && cmp sample2.bz2 sample2.rb2 +./bzip2 -3 < sample3.ref > sample3.rb2 && cmp sample3.bz2 sample3.rb2 +./bzip2 -d < sample1.bz2 > sample1.tst && cmp sample1.tst sample1.ref +./bzip2 -d < sample2.bz2 > sample2.tst && cmp sample2.tst sample2.ref +./bzip2 -ds < sample3.bz2 > sample3.tst && cmp sample3.tst sample3.ref --- bzip2/spewG.c +++ bzip2/spewG.c @@ -24,7 +24,9 @@ ------------------------------------------------------------------ */ -#define _FILE_OFFSET_BITS 64 +#ifdef HAVE_CONFIG_H +#include +#endif #include #include --- bzip2/unzcrash.c +++ bzip2/unzcrash.c @@ -28,6 +28,10 @@ ------------------------------------------------------------------ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include "bzlib.h"