The source archive already has the appropriate cygwin patch applied.
To remove and revert to a 'clean' bzip2-1.0.1:
  mv <srctop>/CYGWIN-PATCHES/bzip2-1.0.1-X.patch <srctop>/..
  cd <srctop>
  patch -p1 -R < ../bzip2-1.0.1-X.patch
  
------------------

Requirements:
  gcc-2.95.2-2 or later
       this was released around June 19, 2000. The bzip2 makefile uses
       new gcc switches and features introduced at that time) 
  binutils-20000722-1 or later 
       this was released around July 27, 2000. The bzip2 makefile uses
       new ld switches and features introduced in that binutils release)

Direct Dependencies:
  none

Canonical homepage:
http://sources.redhat.com/bzip2/

Canonical download:
ftp://sourceware.cygnus.com/pub/bzip2/v100/

------------------

To link this library with your projects:
  #1) include bzlib.h
  #2) to link with the static library, use '-static' on the link line and
      use '-DBZLIB_STATIC' when compiling your .c into a .o
  #3) to link with the dll compile and link as usual; no special flags
      or -Ddefines are necessary

See the makefile and inspect how bzip2.exe is built (with the dll)
and how bzip2-stat.exe is built (with the static lib).

------------------

To build the library for cygwin: 

unpack bzip2-1.0.1-X-src.tar.gz
cd bzip2-1.0.1
make
make test 
make install

This will build both a static lib and a dll with an import library.
It will also build and run the tests using both versions of the 
library, so you will see two identical outputs when running 'make test'. 

------------------

Files included in the binary distro

  <prefix>/lib/libbz2.a
  <prefix>/lib/libbz2.dll.a
  <prefix>/bin/cygbz2.dll
  <prefix>/bin/bzip2.exe
  <prefix>/bin/bunzip2.exe
  <prefix>/bin/bzcat.exe
  <prefix>/bin/bzip2recover.exe
  <prefix>/include/bzlib.h
  <prefix>/man/man1/bzip2.1
  <prefix>/doc/bzip2-1.0.1/CHANGES
  <prefix>/doc/bzip2-1.0.1/LICENSE
  <prefix>/doc/bzip2-1.0.1/manual.ps
  <prefix>/doc/bzip2-1.0.1/manual.texi
  <prefix>/doc/bzip2-1.0.1/manual_1.html
  <prefix>/doc/bzip2-1.0.1/manual_2.html
  <prefix>/doc/bzip2-1.0.1/manual_3.html
  <prefix>/doc/bzip2-1.0.1/manual_4.html
  <prefix>/doc/bzip2-1.0.1/manual_toc.html
  <prefix>/doc/bzip2-1.0.1/README
  <prefix>/doc/bzip2-1.0.1/Y2K_INFO
  <prefix>/doc/Cygwin/bzip2-1.0.1.README
  
------------------

Port Notes:

As of 1.0.1-3, the dll is named "cygbz21.0.dll" NOT "libbz2.dll".  This 
  helps to avoid dll naming conflicts between cygwin dll's and 
  dlls from other platforms (native, pw, etc).  If you have an
  executable that depends on "libbz2.dll" you may either recompile 
  your app so that it links with libbz2.dll.a/cygbz21.0.dll, or install
  *just* the dll from bzip-1.0.1-2.tar.gz into your /usr/bin 
  directory.

The dll is VERSIONED. (i.e. "cygbz21.0.dll" NOT "cygbz2.dll") because
  the developers of bzip2 specify that sharedlibs on unix should have
  a so-name of "1.0".  It appears that they are anticipating a
  change in the ABI/API at some point in the future.  To enable the
  the upcoming version(s) and this one to coexist, the dll's are
  versioned (versioning is not necessary for static libs until
  AFTER the release of the newer, incompatible library, but you've
  got to think ahead for the dynamic libs).

This '2' in 'bz2' is part of the library NAME, not a version number.
  Thus, you have "cyg" + "bz2" + "so-version" == "cygbz21.0"

The executables installed are the *statically* linked versions, 
regardless of the name (e.g. bzip2-stat.exe is installed as 
<prefix>/bin/bzip2.exe).

Cygwin port maintained by: Michael Ring (michael-ring@t-online.de) 
