Patches and a PowerShell script to build bzip2 with Visual Studio using a dynamic library (libbz2.dll).
Patches are included in this repository that modify the makefile.msc
file in the bzip2 distribution to:
- Build cleanly with Visual Studio 2013 and later (replacing deprecated command line options).
- Build libbz2 as a DLL (
libbz2.dll
). - Dynamically link the executable outputs with
libbz2.dll
(by default the executables are statically linked). - Add a version resource to the executables and DLL.
- Fix a 'not a normal file' error when using
bzip2.exe
to compress large files.
The PowerShell script, Build-Bzip2.ps1
, performs the following actions:
- Downloads the bzip2 source from https://www.sourceware.org/bzip2/.
- Extracts and verifies the source.
- Applies the patches (see above).
- For the x86 and x64 architectures:
- Executes
nmake
to build bzip2. - Copies build outputs to a directory named
outputs
. - Creates zipped packages containing build outputs in a directory named
packages
.
- Executes
Build-Bzip2.ps1
requires:
- 64-bit Windows.
- Microsoft Visual Studio 2013 or later (set
$VisualStudioDir
accordingly). - PowerShell Community Extensions.
- Git (used to apply patches).
32-bit and 64-bit Windows binaries can be downloaded from the releases page.
The binary releases depend on the Visual Studio C Runtime Library (please refer to the release notes for details).