Building Berkeley DB, bzip2 and mcpp on Windows for Ice 3.6.0

This page describes how to build Berkeley DB, bzip2 and mcpp on Windows for use with Ice.

On this page:

Berkeley DB

Source Archive

Download the Berkeley DB 5.3.28 source archive from Oracle or ZeroC. You may use the distribution with encryption or without encryption. Since Ice does not use Berkeley DB's encryption features, we recommend downloading the no-encryption (-NC) source archive: https://zeroc.com/download/berkeley-db/db-5.3.28.NC.zip

Then unpack this archive.

Patch for Debug DLL

When building the debug version of the Berkeley DB DLL, you should remove the DIAGNOSTIC and CONFIG_TEST defines and the /export:__db_assert linker option from the project files in build_windows\VS10. Without these modifications, database environments created by the debug DLL are not compatible with environments created by the release DLL.

Patch for Java 

The Oracle Java 7 JDK and Oracle Java 8 JDK were built with Visual Studio 2010 and we recommend you use the same compiler to build Berkeley DB for Java.

We recommend adding a _vc100 suffix to the Berkeley DB DLL built with Visual Studio 2010: open the Berkeley_DB_vs2010 solution and in the db project properties, update Target Name and add the _vc100 suffix. Then, to prevent libdb53_vc100.dll from having an unnecessary dependency on the Visual Studio C++ run time, remove all the .cpp files from the db project.

Finally, edit db_java.vcxproj and replace -target 1.5 by -target 1.7 to use the Java 7 source format.

Build

Follow the Oracle instructions in the docs/installation/build_win.html file included in the source distribution.

bzip2

Source Archive

Download the bzip2 1.0.6 source archive from bzip.org or ZeroC.

Then unpack this tar.gz archive.

Patch

Download the following patch: https://zeroc.com/download/bzip2/patch.bzip2-1.0.6

This patch adds support for building bzip2 as a DLL on Windows.

Apply this patch from the main directory of the bzip2 source distribution:

> patch -p0 < C:\users\%username%\Downloads\patch.bzip2-1.0.6

You can download a patch utility for Windows from http://gnuwin32.sourceforge.net/packages/patch.htm

On Windows 7 or later, UAC can make it difficult to use the patch utility unless you take extra steps. One solution is to run patch.exe in a command window that you started with Administrator privileges (right-click on Command Prompt in the Start menu and choose "Run as administrator"). If running as administrator is not an option, do the following:

1. Do not install patch.exe in a system-protected directory such as C:\Program Files.

2. Update the manifest in patch.exe as described at http://math.nist.gov/oommf/software-patchsets/patch_on_Windows7.html

Build

Open a Visual Studio command prompt.

If you are using Visual Studio 2010, you can optionally set the CPP_COMPILER environment variable to VC100 to create a DLL with the _vc100 suffix:

> set CPP_COMPILER=VC100

Change to the main directory of the bzip2 source distribution and type:

> nmake /f Makefile.mak

mcpp

Git Repository

Clone the zeroc-inc/mcpp repository hosted on GitHub:

> git clone https://github.com/zeroc-ice/mcpp.git

Build

Follow the instructions in README.md.