HOWTO Compile Box Backup from source under Windows MingW/Cygwin
This article explain step by step how to compile Box Backup from source as a native Windows binary under MingW/Cygwin.
Install Cygwin
Install Cygwin by downloading the installer from http://www.cygwin.com/setup.exe (1.7.1 as of February 2010) and select the following packages (and the automatic dependencies that get added once you select the packages):
- Devel/autoconf
- Devel/automake
- Devel/gcc-mingw
- Devel/gcc-mingw-core
- Devel/gcc-mingw-g++
- Devel/gettext-devel
- Devel/libtool
- Devel/make
- Devel/mingw-runtime
- Devel/patchutils
- Devel/pkg-config
- Devel/subversion
- Lib/libxml2
- Lib/libxslt
- Mingw/mingw-zlib
- Perl/Perl
- Web/wget
Use Zlib from MinGW
The Mingw/mingw-zlib package installed in step one together with Cygwin eliminates the need to self-compile: some work saved!
Compile and install PCRE
The existing Cygwin package of PCRE introduces a GPL requirement because of its cygwin1.dll dependency, as per the discussion with Chris on mailing list. We therefore want to compile our own standalone version with the following steps:
cd /usr/src
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz
tar xvzf pcre-8.10.tar.gz
cd pcre-8.10
./configure --disable-shared --enable-utf8 --enable-unicode-properties CFLAGS="-mno-cygwin" && make
cp .libs/libpcre.a .libs/libpcreposix.a /lib/mingw && cp pcreposix.h /usr/include/mingw
Compile and install OpenSSL
Version 1.0 of OpenSSL released on 29 March 2010 compiles perfectly under MingW. We compile our standalone versions with the following steps:
cd /usr/src
wget http://openssl.org/source/openssl-1.0.0.tar.gz
tar xzvf openssl-1.0.0.tar.gz
cd openssl-1.0.0
./Configure -DOPENSSL_NO_CAPIENG mingw
make
make install
Compile Box Backup
You can choose to use the bleeding edge version of Box Backup directly from SVN with the following steps:
cd /usr/src
svn co https://www.boxbackup.org/svn/box/trunk/ boxbackup
cd boxbackup
or use the more stable offical releases that might lack some new features:
cd /usr/src
wget http://www.boxbackup.org/svn/box/packages/boxbackup-0.11rc8.tgz
tar xvzf boxbackup-0.11rc8.tgz
cd boxbackup-0.11rc8
Independent of whether you choose SVN or stable releases, we need to configure and build the code:
./infrastructure/mingw/configure.sh
make build-backup-client
The last command compiles the Box Backup client for Windows. You will find the resulting binaries in the parcels sub-directory inside a folder called something like boxbackup-trunk_2618-backup-client-mingw32: the actual SVN revision (2618 in this case) might vary!
Since the server does not work under Win32 anyway, we save ourselves the time by not compiling it. You can type make above (instead of make build-backup-client) if you want to compile both client and server components.